AnsweredAssumed Answered

bootloader faied to run to App with os

Question asked by 张 爱华 on Feb 11, 2019
Latest reply on Apr 11, 2019 by 张 爱华

my mcu is mpc5748g.I try to jump to app throught bootloader.But faile.

 

my bootloader  flash configuration like following:

ps: bootloader with os,only use cpu0

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

flash_rchw : org = 0x00F90000, len = 0x4
cpu0_reset_vec : org = 0x00F90000+0x10, len = 0x4 
cpu1_reset_vec : org = 0x00F90000+0x14, len = 0x4
cpu2_reset_vec : org = 0x00F90000+0x04, len = 0x4 

m_text : org = 0x00F90000 + 0x400, len = 256K - 0x400 
m_vectors_ram : org = 0x40000000, len = 0xC00
m_data : org = 0x40000000+0xC00, len = 768K-0xC00-64K /*left 64k for btl*/

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

my app   flash configuration like following:

ps: app with os,only use cpu0

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

flash_rchw : org = 0x01000000, len = 0x4
cpu0_reset_vec : org = 0x01000000+0x10, len = 0x4 
cpu1_reset_vec : org = 0x01000000+0x14, len = 0x4
cpu2_reset_vec : org = 0x01000000+0x04, len = 0x4 

m_text : org = 0x01000000+ 0x400, len = 256K - 0x400 
m_vectors_ram : org = 0x40000000, len = 0xC00
m_data : org = 0x40000000+0xC00, len = 768K-0xC00-64K /*left 64k for btl*/

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

 

In my bootloader,I use following functions to jump to app

///////////////////////////////////////////////////////////////////////////////////////////////////////////////

function1: faile

***********************************************

typedef void (*start_fun)(void);
start_fun start_entry;

unsigned int *start_addr = (unsigned int *)(0x01000000+0x10);

DISABLE_INTERRUPTS(); //"wrteei      0"

start_entry = (start_fun) * start_addr;
start_entry();

**********************************************

function2: faile

***********************************************

asm("e_lis %r12,0x0100");
asm("e_or2i %r12,0x0010");
asm("e_lwz %r0,0(%r12) ");
asm("mtlr %r0");
asm("se_blrl");

**********************************************

 

 

When jump from bootloader to app,my app can run to main.If run to xTaskCreate,failed in 

  every time.

througth disassembly and watch,I found following state:

 

I try to set the value of INTC->IACKR0 to 0x40000000,but unavailable.It still keep the value of 0x400003c4.Could somebody give me some suggestion about how to solve this problem?

 

ps:

1.when bootloader without os,it can jump to app without os succesfully.

2.when bootloader with os,,it can jump to app without os succesfully.

 

3.when bootloader without os,it can't jump to app with os.

4.when bootloader with os,it can't jump to app with os.

Outcomes