CAN or RTOS issue ??

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN or RTOS issue ??

Jump to solution
1,115 Views
freescale_satya
Contributor III

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    

Labels (1)
0 Kudos
1 Solution
577 Views
Lundin
Senior Contributor IV
0 Kudos
5 Replies
578 Views
Lundin
Senior Contributor IV

Stack overflow?

0 Kudos
577 Views
freescale_satya
Contributor III
But how to know that?
0 Kudos
577 Views
Lundin
Senior Contributor IV

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.

 

0 Kudos
577 Views
freescale_satya
Contributor III
Hi Lundin, Thanks for the reply. Yes it is infact a stack issue. i had 3 tasks just i commented one of the tasks to give more space and extended the stack size and was able to resolve the issue. Now i have related another issue to extend the size of the RAM in the PRM which i have never done. i will post it as a new question after trying with sample prm files. Thanks once again for the suggestion. regards, satya
0 Kudos
577 Views
freescale_satya
Contributor III
Hi Lundin, could you please tell me how to extend the RAM memory beyond 8K for s12xE variants. regards, satya
0 Kudos