Global variables change automatically (out of memory ?)

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

Global variables change automatically (out of memory ?)

564 Views
ycgxy1650601
Contributor III

HI:

     Software version : codewarrior 2.10    /   Hardware: MPC5606B  Board

     I defined a global variable and initialize  in man.c. I printed the value of these global variable to the termial by uart_tx function in main() function.I found the value which is showed on the terimal (figure 1)  isn't the intial value. I make sure the global variable is only initialled and nothing else.But I find the value of the global variable is the intial value on the Variables Window (figure 2) by debug. The program is stuck When the program runs to this variable location  by debug.I tried many times and got stuck in this location (figure 3)every time . The main.c file is showed as the figure 4.

terminal.JPGVariable Window2.JPGcodewindow.JPGmain.JPG

I find the value of variable "CurrentProt" that isn't equal to the initial value(PROT_DEFAULT) by uart.

but the Variable Window show the value of variable "CurrentProt" that is equal to the initial value(PROT_DEFAULT) by debug.

I have no idea about the problem. I need help .

thanks

 

 

   

Labels (1)
0 Kudos
1 Reply

556 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

The program is stuck When the program runs to this variable location  by debug.I tried many times and got stuck in this location (figure 3)every time . The main.c file is showed as the figure 4.

Program is not stuck. As you can see it runs to E800 opcode (or se_b) which is brunch to itself.

For example in C code this is while(1).

So the program reached the endless loop in your SW.

1.png

 best regards,

Peter

 

0 Kudos