MPC5777M: bootloader can't jump to app

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

MPC5777M: bootloader can't jump to app

1,467 Views
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

Tags (2)
0 Kudos
2 Replies

1,275 Views
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 Kudos

1,275 Views
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 Kudos