One of my task stack overflow (shown in the attached photo top task) and I add the breakpoint but when I look into the pxCurrentTCB structure it show ‘0’ and the task name also not shown. I’m want to know this is the normal behavior when the stack overflow or it’s overwritten that why it’s overflow.
Looking at the image, all the TCB values are zero which indicates that it has been corrupted already. Is it possible to use data breakpoint to find out what is corrupting this memory?
I have a float array with 25 elements, declared in a function that is used by this task, which is filled by reading the sensors with 25 float data.
Before this weekend, I have changed the size of that array to 50 in my other unit and that unit works fine with no overflow nothing crashed. But one with 25 elements getting crashed and I’m sure the sensor data not exceeding more than 25 data points.
So we need to isolate whether or not this float array is the issue. Is there a reason to allocate it on the stack? If not, can you make a global (or file static) for a moment and see if it fixes the issue. The other test could be to increase the size of the stack of this task.
You can also put a data breakpoint at any TCB member for this task (lets say pxStack which should be 0x0) before it is corrupted. That will you will be able to catch as soon as it is corrupted.
Okay, I declared it globally let’s see, because it takes long time to get this situation. will post tomorrow.