MPC5777M: bootloader can't jump to app

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

MPC5777M: bootloader can't jump to app

1,497件の閲覧回数
bwp530
Contributor IV

MPC5777M      S32DS-2017R1

I make a bootloader for MPC5777M, which can recv hex file and upgrade code to flash.

But the bootloader can't jump to app.

#define APP_StartAddr (*(uint32_t*)0x00fc4004)

void Prepare_Before_Jump(void)
{
// flexcan_0_deinit_fnc(); /*shutdown the MSCAN module*/
uart_disableInterrupt();
systick_PIT_deinit();
PPCASM (" wrteei 0 "); /*disable the CPU interrupt*/
CleanRAM(); /*clean the bootloader used RAM for NVM driver*/

}

void app_entry(void)
{

Prepare_Before_Jump();

(*(void (*)(void))(APP_StartAddr))();   /*run the function via function pointer convert with a certain address*/

while(1);/*stop here for anyhow*/
}

I tried like this, but it doesn't work:

#define APP_StartAddr (*(uint32_t*)0x1500000)

void Prepare_Before_Jump(void)
{
// flexcan_0_deinit_fnc(); /*shutdown the MSCAN module*/
uart_disableInterrupt();
systick_PIT_deinit();
PPCASM (" wrteei 0 "); /*disable the CPU interrupt*/
CleanRAM(); /*clean the bootloader used RAM for NVM driver*/

}

void app_entry(void)
{

Prepare_Before_Jump();

asm("e_lis %r12,0x0150");
asm("e_or2i %r12,0x0000");
asm("mtlr %r12");
asm("se_blrl");

while(1);/*stop here for anyhow*/
}

the bootloader link file:

1.png

the app code link file:

2.png

when i debug it, the debug info is as follow:

3.png

タグ(2)
0 件の賞賛
2 返答(返信)

1,305件の閲覧回数
chenmin1
Contributor II

hi,

Did you solve this problem?  I used the same jump code as you,but only Z7 core can work normally,Z4 can`t work.

Are you from China? Hope to communicate with you for advice,my wechat --  shengkun1102.

Regards,

sheng kun

0 件の賞賛

1,305件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

is address in this definition correct?

#define APP_StartAddr (*(uint32_t*)0x00fc4004)

Could you double check? This should work if the address is correct. Try to step the asm code to see what happened, which address was loaded and where it jumped.

Regards,

Lukas

0 件の賞賛