How much stack does the ThreadX System Timer Thread requires?

419 Views Asked by At

I'm using the Azure RTOS ThreadX in a Cortex M0+ with 20k of RAM. The port module for the cortex m0, by default, has 1024 bytes to the timer thread, but after some debugging, I noticed that the thread stack was not used by seeing the 0xEF values, so I reduced it to 256 bytes. I was testing the code, and this thread overflowed. What stack size does this need?

Thanks for all the attention!

1

There are 1 best solutions below

0
On

It is not different than other threads, which means that it is dependant if the functions you are calling inside it using lots of stack or not.

If you want thread to be with very small stack consider to use just little local variables and try to do just minimum things there and make thread with bigger amount of stack to do the rest of the work. Anyway it is good approach that timer thred execution will be very short.