Hi,
I am using an RTOS with two tasks defined at 5ms and other 20ms task. I have a configuration file defined which contains the CAN messages to be transmitted there is a RAM memory allocated for this number of messages (id, datalength, priority etc) in one of my .c file. The issue is when the code switches from 5ms task to 20ms and comes back again to 5ms the second time, RAM data is getting corrupted and not getting the expected message id's and data. what i observed from debugging is the RAM area is being overwritten, but i do not know how it is getting overwritten. if i run it in a single 5ms task the message ids and data are expected (i tested only couple of occassions). could somebody help me on this
thanks and regards,
satya
Solved! Go to Solution.
Stack overflow?
Easiest way is to download the program through the debugger, then set each cell in the whole stack memory area to contain a fixed value, like 0xAA. Then run the program and stop it after some time. See if any 0xAA remain on the stack or if they are all overwritten.
Though if you are using a RTOS it should be doing stack handling for each process. How that is done depends on the OS, though surely the OS must have a spec for how much memory it will need.