Printing from a timed event function in a worker thread causes watchdog

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable
[WICED-SDK-2.2.1]

I have registered a timed event function to be called in the WICED_HARDWARE_IO_WORKER_THREAD.

When the function is called without printing, it works.

When I try to print inside the function, printing doesnt work and the app watchdogs.

I cant workout what is going wrong?
0 Likes
1 Reply
Anonymous
Not applicable
The default stack size of the WICED_HARDWARE_IO_WORKER_THREAD is only 512 bytes.

See the definition here:

<WICED-SDK>/Wiced/RTOS/<YOUR_RTOS>/wiced/rtos.h

Printing requires at least 4kB as noted in

<WICED-SDK>/include/wiced_defaults.h

So, when you try to print from the WICED_HARDWARE_IO_WORKER_THREAD, the thread blows its stack and the system probably crashes.

FYI, the WICED_NETWORKING_WORKER_THREAD has a 6kB stack size by default, so it is ok to print from this thread by default.
0 Likes