Global variable problem (the program got stuck after just executing the assignment )

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

Global variable problem (the program got stuck after just executing the assignment )

跳至解决方案
1,285 次查看
ycgxy1650601
Contributor III

HI:
    Software version: CodeWarrior 2.10   /    hardware version: mpc5606b borad

Problem: when I debug the program from step 1 to step 2 by single step debugging(see Figure 1),  the program got stuck.  The software interface is showed in figure 2 when the program got stuck.   I click the stop button,   then the software interface is shown in Figure 3.   I find the result that the pointer always point to  "00001020 e800 se_ B 00001020" after clicking the stop button.   I have tried many times, the result never change(PC 00001020 and 00001020 e800 se_ B 00001020).  The global variable currentprot is described in Figure 4.

Why the program got stuck after executing the assignment statement of global variable currentprot by single step debugging?

 

debug2 - 副本.JPGdebug2-1 - 副本.JPGdebug2-2 - 副本.JPG

list global variables.JPG

THANKS

0 项奖励
回复
1 解答
1,276 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I find the result that the pointer always point to "00001020 e800 se_ B 00001020" after clicking the stop button. I have tried many times, the result never change(PC 00001020 and 00001020 e800 se_ B 00001020). The global variable currentprot is described in Figure 4.

The program is not stuck.

it just run into endless loop like while(1). uC is working correctly. Please check you source code.

 

best regards,
Peter

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,277 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hello,

I find the result that the pointer always point to "00001020 e800 se_ B 00001020" after clicking the stop button. I have tried many times, the result never change(PC 00001020 and 00001020 e800 se_ B 00001020). The global variable currentprot is described in Figure 4.

The program is not stuck.

it just run into endless loop like while(1). uC is working correctly. Please check you source code.

 

best regards,
Peter

0 项奖励
回复