[riot-users] printf float on stm32f4 with toolchain arm-none-eabi-gcc
authmillenon at gmail.com
Fri Dec 19 08:33:20 CET 2014
2014-12-19 6:42 GMT+01:00 Martin Stoilov <martin at rpasearch.com>:
> It looks like this problem is related to thread creation. If I call printf
> from kernel_init it works fine, but if I call it from separate thread
> create with thread_create, float args show up as 0.00000 . I've been using
> riot-os only for about a week, so I don't have too much knowledge about the
> OS internals. If somebody can help me understand of what is going on and
> how I can work around this problem (if possible at all) it will be great.
newlib's printf needs a lot of memory (especially with float), so it might
be possible, that your stack is overflowing (you can check by compiling
with CFLAGS+=-DDEVELHELP USEMODULE+=ps and calling thread_print_all() from
`sys/include/ps.h`; if used is the same number as stack, you have an
overflow). Make sure to use `KERNEL_CONF_STACKSIZE_PRINTF_FLOAT` (or
`KERNEL_CONF_STACKSIZE_PRINTF`) as stack size on `thread_create()` and that
the macro defined (in cpu/<your cpu>/include/cpu-conf.h) big enough for
Hope I could help.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users