I posted a few days ago about using a message queue, someone posted a response and it helped solve the issue.
I now have the message queue working just fine. It’s getting messages as I can print out the value passed in in the task handler.
The task handler calls a function to update flash memory. It has a mutex around the call to write.
In creating the task handler, I initially set the size to 120 bytes. However, it was causing a WDT reset when the queue handler called the memory update function. After setting the handler size to 180 bytes on the task creation, it is OK.
I would rather understand what the right approach is to setting the task size. Can someone explain how to establish this?
The stack requirements are determined by your program (how many automatic variables you have, how deep the function call nesting is, etc.) and the compiler options (the higher the compiler optimisation the less stack it will use in most cases). You can calculate this in the same way you would calculate it for a non RTOS (bare metal) application.