AnsweredAssumed Answered

Local Value Corruption on MPC5675K | Stack pointer alignment

Question asked by Dhiraj Shetty on Oct 6, 2014
Latest reply on Mar 17, 2016 by stanish



We're running uC/OS-II on the MPC5675K and are facing a few issues in development. We're using CW IDE 10.5


I have two questions in particular and would greatly appreciate if someone can help us debug or resolve the issue. Thanks in advance!


Question 1


At some points in task execution, we notice that the values of global variables and local variables are not in agreement.


For example, as part of the task, we read the global value and store it into the local variable.


However, at certain times, we notice that these values are different from each other.


We have ensured that non-atomic accesses are not the issue, since we have kept mutexes in place.


Also, this issue occurs when the system is handling a lot of interrupts (FlexCAN, UART).


Any pointers on how to debug this?


Question 2


To comply with the EABI, does the stack pointer need to be 8-byte aligned or 16-byte aligned, for Power e200z760n3?


Also, depending on that, could someone provide an example on how to correctly set up the stack frame for context switching?


Thanks once again.


Any help is much appreciated.