ESP8266 Developer Zone The Official ESP8266 Forum 2018-10-12T04:07:49+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=22739 2018-10-12T04:07:49+08:00 2018-10-12T04:07:49+08:00 https://bbs.espressif.com:443/viewtopic.php?t=22739&p=33521#p33521 <![CDATA[est_printf - why use stack space?]]>
ets_printf is used to dump debug messages out the comm port.

ets_printf is implemented using ets_io_vprintf(ets_putc, fmt, ap);

ets_io_vprintf is a rom function and ets_putc is a polling function that waits until there is room in the uart's TX FIFO and then pushes it out -- polling transmit.

Worst case - it should just slow your code down because it does nothing as it waits to output the debug message - not eat up stack space.

I instrumented malloc and free with ets_printf.

When this occurs, there is an exception generated that one of the task's stack has overflowed after a lot of malloc/free related debug messages were sent.

My question is can anyone tell me why the stack comes into play other than the call to ets_printf itself?

Thanks.

Statistics: Posted by jhinkle — Fri Oct 12, 2018 4:07 am


]]>