bmarcot / vega

vega -- The Unix-like Operating System for micro-controllers (ARM Cortex-M4)
6 stars 1 forks source link

Newlib's printf() stack usage is too big #5

Closed bmarcot closed 8 years ago

bmarcot commented 8 years ago

Newlib's printf() seems to allocate a huge buffer on the stack, that requires more than 1KiB stack space. Crashes with a 512B stack.

Solutions:

https://www.lpcware.com/content/forum/newlib-printf-stack-usage

http://comments.gmane.org/gmane.comp.lib.newlib/7566

Is using setvbuf a solution? Check if available in Newlib, and if doing something. https://devzone.nordicsemi.com/question/14581/nrf51822-with-gcc-stacksize-and-heapsize/

bmarcot commented 8 years ago

Using printk() now: fixed size buffer and uses vsnprintf(). Temporary solution.

bmarcot commented 8 years ago

Needs a 2KiB buffer, see 072c78f in devel.

bmarcot commented 8 years ago

Replaced by a lightweight printf() implementation. Fixed in bd0c49b.