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
{
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
{
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_or2i %r12,0x0004");
asm("e_lwz %r0,0(%r12)");
asm("se_mtlr %r0");
asm("se_blrl");
Thank you!
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_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
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
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
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
Ok, I have done test on MPC5746R, even if it makes no sense as the core is the same as MPC5744P.
And then I execute se_blrl
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
Hi Peter,
Before I execute se_blrl :
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:
The instruction pointer is on address 0x1001060.
Qiao
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