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 !
I use the following jump syntax , i wonder that it jumped to wrong address , or that the syntax is wrong !
the demo project codes :
This problem has bothered me for a long time.! Please help me !
Solved! Go to Solution.
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
Hi,
have you seen this draft:
https://community.nxp.com/servlet/JiveServlet/download/427962-1-279359/bootloader.zip
... and this application note?
http://www.nxp.com/files/microcontrollers/doc/app_note/AN5319.pdf
http://www.nxp.com/files/microcontrollers/doc/app_note/AN5319SW.zip
I believe it could be a nice start point for you.
Regards,
Lukas
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 !
Regards,
Hunter
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
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