Global variables change automatically (out of memory ?)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Global variables change automatically (out of memory ?)

566 次查看
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

 

 

   

标签 (1)
0 项奖励
1 回复

558 次查看
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 项奖励