MPC5744P second stage bootloader

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5744P second stage bootloader

ソリューションへジャンプ
2,525件の閲覧回数
VladiKn
Contributor III

Hello,

I am trying to develop a second stage bootloader for the MPC5744P that would perform some checks and then load the actual application and start it. Is there some kind of example that shows how this could be done? Maybe someone already did something similar and can give me some hits.
Also any documentation that could help with this would be great!

Thanks in advance. Cheers!

0 件の賞賛
返信
1 解決策
2,471件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Vladimir,

program counter can be accessed by means of jump instructions, not directly. There's an example in startup file of the bootloader:

...\AN5319SW.zip\MPC5748G-Serial_Bootloader-GHS614\ghs\tgt\libstartup\crt0.ppc

;if the boot header is valid, execute application
;load address of reset vector to r12
e_lis r12,0x00F9
e_or2i r12,0x4010

;load reset vector to r0
e_lwz r0,0(r12)
;move reset vector to link register
mtlr r0
;branch to address in link register
se_blrl

 

Regards,

Lukas

 

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
2,507件の閲覧回数
VladiKn
Contributor III

Thank you very much for the information. I will check it out!

0 件の賞賛
返信
2,510件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

we have this application note written for MPC5748G:

https://www.nxp.com/docs/en/application-note/AN5319.pdf

https://www.nxp.com/docs/en/application-note-software/AN5319SW.zip

However, the principles are still the same, so it can be a nice starting point.

Regards,

Lukas

 

0 件の賞賛
返信
2,492件の閲覧回数
VladiKn
Contributor III

Hi Lukas,

As I've seen, this application loads the new image over the serial to the flash and then restarts with the new application. In my case, I would like to have the application already on some location in the flash. Then, I would perform some checks in the bootloader and jump to the location of the application to execute it.
I had the idea just to put the address of the application into the program counter register with an assembly command but I haven't been able to find a way to access the program counter. Do you have any idea how to do that?

Cheers,
Vladimir

0 件の賞賛
返信
2,472件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Vladimir,

program counter can be accessed by means of jump instructions, not directly. There's an example in startup file of the bootloader:

...\AN5319SW.zip\MPC5748G-Serial_Bootloader-GHS614\ghs\tgt\libstartup\crt0.ppc

;if the boot header is valid, execute application
;load address of reset vector to r12
e_lis r12,0x00F9
e_or2i r12,0x4010

;load reset vector to r0
e_lwz r0,0(r12)
;move reset vector to link register
mtlr r0
;branch to address in link register
se_blrl

 

Regards,

Lukas

 

0 件の賞賛
返信