MPC5744P bootloader jump application failed.

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

MPC5744P bootloader jump application failed.

3,687 Views
my_souls
Contributor III

Hello, my application writes to the flash via the boot loader, but the jump application fails;
The following is the relevant code, how can we successfully jump to the application?

The application program linker file was modified as follows:

MEMORY
{

              
    flash_rchw : org = 0x00FB0000,   len = 0x4

                cpu0_reset_vec : org = 0x00FB0004,   len = 0x4
                m_text : org = 0x1100000, len = 256K  
                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 = 0x00FA0000,   len = 0x4

                cpu0_reset_vec : org = 0x00FA0004,   len = 0x4
                m_text : org = 0x1000000, len = 256K  
                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 %r12,0x00FB");

asm("e_or2i %r12,0x0004");
asm("e_lwz %r0,0(%r12)");
asm("se_mtlr %r0");
asm("se_blrl");

 

Thank you!

10 Replies

2,580 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

this has been discussed over this forum many times.

You are not jumping to valid code, just to reset vector pointer.

use:

asm("e_lis %r12,0x00FB"); - use address with first instruction of code where you want to jump instead of 0x00FB0004

asm("e_or2i %r12,0x0004");
asm("e_lwz %r0,0(%r12)");
asm("se_mtlr %r0");
asm("se_blrl");

Your application starts at address stored at location 0x00FB0004 -> use address stored at 0x00FB0004 instead of using reset vector.

Reset vector is used only by HW (SSCM module) after reset for automatic jumps.

Peter

0 Kudos
Reply

2,580 Views
qiaodeng
Contributor II

Hi Peter,

     I also encountered the same problem, and I have changed the jump address to the location where my application starts, but it doesn't work. Could you please give me some advice? 

     Thanks in advance.

Best Regards,

Qiao

0 Kudos
Reply

2,580 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

From the description of your issue is really not possible to help you.

Describe your problem, share code, or screenshots and I can try to help you.

Peter

0 Kudos
Reply

2,580 Views
qiaodeng
Contributor II

Hi Peter,

     My application locates at 0x01280000, 

MEMORY
{

flash_rchw : org = 0x00FA0000, len = 0x4
cpu0_reset_vec : org = 0x00FA0000+0x10, len = 0x4
cpu1_reset_vec : org = 0x00FA0000+0x14, len = 0x4

m_text : org = 0x01280000, len = 1024K
m_data : org = 0x40000000, len = 128K

In the bootloader, I wrote the following code to jump to the application, but during the jump it reports  "No source available for "IVOR1_Vector() at 0x1001010" .

asm("e_lis %r12,0x0128");
asm("e_or2i %r12,0x0000");
asm("e_lwz %r0,0(%r12)");
asm("mtlr %r0");
asm("se_blrl");

Qiao

0 Kudos
Reply

2,580 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

Your asm code will end in IVOR1 (machine check) exception when you execute

asm("e_lwz %r0,0(%r12)");

use following code snippet to achive correct jump to address 0x1280000:

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

I recommend you to read  core reference manual.

Peter

0 Kudos
Reply

2,580 Views
qiaodeng
Contributor II

Hi Peter,

     I tried it again, but it still failed. "No source available for "IVOR6_Vector() at 0x1001060" " occurred.  The chip I use is MPC5746R.

    Thanks again for your help.

Qiao

0 Kudos
Reply

2,580 Views
petervlna
NXP TechSupport
NXP TechSupport

Ok, I have done test on MPC5746R, even if it makes no sense as the core is the same as MPC5744P.

pastedImage_1.png

And then I execute se_blrl

pastedImage_3.png

And instruction pointer is on address 0x1280000.

So I do not understand why you still struggling here.

However I recommend you to read core reference manual in first place.

Peter

0 Kudos
Reply

2,580 Views
qiaodeng
Contributor II

Hi Peter,

      Before I execute se_blrl :

pastedImage_2.png

   And then I execute se_blrl,  what I executed is single step, but the target was running and did not stop.  I have to click the break and read the register:

pastedImage_3.png

The instruction pointer is on address 0x1001060.

Qiao

0 Kudos
Reply

2,580 Views
petervlna
NXP TechSupport
NXP TechSupport

Your first screenshot is correct.

Once you execute jump you will end up in address 0x1280000. As you require.

If you have any core on this address I cannot see from screenshots.

So everything works fine.

Peter

2,580 Views
qiaodeng
Contributor II

Hi Peter,

    Thanks for your help. The problem has been solved. I checked the code at address 0x1280000, it was not flashed correctly. 

Qiao

0 Kudos
Reply