est_printf - why use stack space?

jhinkle
Posts: 31
Joined: Tue Apr 19, 2016 12:09 am

est_printf - why use stack space?

Postby jhinkle » Fri Oct 12, 2018 4:07 am

I'm attempting to resolve an issue in ESP8266_RTOS V3.0

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.

Who is online

Users browsing this forum: Google [Bot] and 12 guests