I am using Codewarrior 7.1.1 for MCF5232
I have an ISR, that calls a static method in a C++ Class. The method is called, does some stuff, sets an unsigned char to TRUE (1) and exits. The unsigned character have been declared as both a volatile static member variables and tried as a volatile global variable. Code shows that it is actually set when debugging. Later code uses this form the class to access the static member or global variables and finds that they are set to FALSE (0).
I have looked at the assembly and it seems right. The code seems right. Can anyone make any recommendations on what I am missing?
I guess it could be. How do you flush the cache? And even so, wouldn't volatile remove caching anyway?
I should also note, reading the variables I made in a critical sectio. And the code that reads the variables is called every 5ms every time the highest priority tasks gets marked ready to run again.
The problem turned out to be Instruction Scheduling. I decided to look at CW 6.4 and the problem didn't exist. So I turned off each of Peephole, Instruction Scheduling and Register Coloring to see what would happen. instruction scheduling is the culprit.
Should I write up a bug report on this. This is for 7.1.1, this is still a defect in 7.1.2 and the enum defect still exists in 7.1.2.