How to Jump to application Based on MPC5604b

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

How to Jump to application Based on MPC5604b

跳至解决方案
2,049 次查看
buckzheng
Contributor II

 I want to design mpc5604b bootloader , i've developed an demo project in CW 2.10, but some probelms occurs ! The demo project copy a led funciton that residents in flash space from 0x000210c6 to 0x000210ea  to the other flash space from 0x00008000 to 0x00008024  , and then jump to 0x8000 to run the led demo function !but it didn't ! 

 

I debuged the demo project ! Based the below figure, I programmed the led function into the other flash space according to flash driver successfully ! 

169973_169973.pngpastedImage_1.png

I use the following jump syntax , i wonder that it jumped to wrong address , or that  the syntax is wrong ! 

the demo project codes : 

169974_169974.pngpastedImage_2.png

169975_169975.pngpastedImage_3.png

This problem has bothered me for a long time.! Please help me !

标签 (1)
0 项奖励
回复
1 解答
1,887 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Hunter,

if you move some piece of code to different location, the code must be either compiled as a PIC code (Position Independent Code) or there can't be absolute jumps (only relative jumps). If is just piece of code, the best way is to write it in assembler. If it is large application, the best way is to use two projects as mentioned in the application note.

Regards,

Lukas

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,887 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport
0 项奖励
回复
1,887 次查看
buckzheng
Contributor II

Hi ,

Lukas !

I debuged the demo project  soon! 

In the function App_led , I called a function LED_TOGGLE , and I modified the App_led function as below ! The led function will run the dead loop forever ! It's strange ! why ! I want to find the original reason of the problem ! Help me ! Give me your suggestions ! 

pastedImage_3.png

Regards,

Hunter

0 项奖励
回复
1,888 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Hunter,

if you move some piece of code to different location, the code must be either compiled as a PIC code (Position Independent Code) or there can't be absolute jumps (only relative jumps). If is just piece of code, the best way is to write it in assembler. If it is large application, the best way is to use two projects as mentioned in the application note.

Regards,

Lukas

0 项奖励
回复
1,887 次查看
buckzheng
Contributor II

Hi,

Lukas !

I have seen the application note AN5319 , but it didn't give me some useful information that could help solve my problem !

My demo project is different to AN5319. I just want to run application in different flash area with only one project.

 I have known the application and bootloader counld resident in one project !Please  make some 

suggestions to help me !

Regards,

Hunter

0 项奖励
回复