AnsweredAssumed Answered

MPC5744P Bootloader Address Jump Code

Question asked by Jiajia Wu on Feb 8, 2017
Latest reply on Jul 16, 2017 by Kun Liu

We developed a bootloader program to download application program to the MPC5744P.

The application program is generated by S32DS. The linker file is the default one, as follows:

MEMORY
{
flash_rchw : org = 0x00FA0000, len = 0x4
cpu0_reset_vec : org = 0x00FA0004, len = 0x4
m_text : org = 0x01000000, len = 2048K
m_data : org = 0x40000000, len = 384K
int_dram : org = 0x50800000, len = 64K
}

 

The bootloader program linker file was modified as follows:

MEMORY
{

flash_rchw : org = 0x00F98000, len = 0x4
cpu0_reset_vec : org = 0x00F98004, len = 0x4
m_text : org = 0x00F98008, len = 32K-8
m_data : org = 0x40000000, len = 384K
int_dram : org = 0x50800000, len = 64K
}

 

The bootloader program used the address jump code as follows:

__asm__(" e_lis %r3, 0x00FA");
__asm__(" e_ori %r3,%r3,0x0004");
__asm__(" se_mtlr %r3");
__asm__(" se_blr");

 

But now the address jump fails. Once the bootloader program executes the address jump code, it collapses.

I want to know:

1) Is my address jump code correct? Can you give me the correct address jump code?

2) Is my jump address correct? Can you give me the correct jump address?

3) Why the bootloader program collapses? 

4) What shuould I do to fix the probrom?

 

PS:

1) I didn't modify the Startup_Code file startup.S, both the bootloader program and the application program use the default Startup_Code file generated by S32DS.

2) The address jump code is called in the main(), before the address jump code, there's no other initialization operation.

3) The application program is programed correctly, it can work independently.

4) We use the similar method on other MCUs such as MPC5554, MPC5634, it works correctly. But it failed on MPC5744P.

 

Thank you very much.

Outcomes