How to Jump to application Based on MPC5604b

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

How to Jump to application Based on MPC5604b

Jump to solution
1,358 Views
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 !

Labels (1)
0 Kudos
Reply
1 Solution
1,196 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
1,196 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
1,196 Views
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 Kudos
Reply
1,197 Views
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 Kudos
Reply
1,196 Views
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 Kudos
Reply