Fault happened when Jump to BootLoader from APP Program

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

Fault happened when Jump to BootLoader from APP Program

193 Views
FanJialin
Contributor II

I encountered an issue while using the S32K146 chip. Please help me analyze the reason.
The details are as follows.
Firstly, when I first powered on, I successfully jumped from BootLoader to running the app.
When I receive an update request without power outage, I hope to jump back to BootLoader from the app to perform the app update.
But there was an error during the jump process.
The code location when the error occurs is in the startup_S32K146.s file

FanJialin_0-1712918998235.png


The value of the CFSR register info is that IBUSERR has been set 1.

Jump Func code:

static void nvdJumpToBootloader(0x10000000)
{
void (*entry)(void);
Type_uWord pc;
Type_uWord __attribute__((unused)) sp;

asm("cpsid i");
S32_SCB->VTOR=(Type_uWord)(start_address); /*Relocate interrupt table ptr*/
sp = *((volatile Type_uWord*)start_address);
asm(" ldr sp, [r0,#0]");
pc = *((volatile Type_uWord *)(start_address + 4));
entry = (void (*)(void))pc;
entry();
asm("cpsie i");
}

Bootloader Address map:

define symbol m_interrupts_start = 0x10000000;
define symbol m_interrupts_end = 0x100003FF;

define symbol m_flash_config_start = 0x10000400;
define symbol m_flash_config_end = 0x1000040F;

define symbol m_text_start = 0x10000410;
define symbol m_text_end = 0x10007FFF;

APP Address map:

define symbol m_interrupts_start = 0x00004000;
define symbol m_interrupts_end = 0x000043FF;

define symbol m_flash_config_start = 0x00004400;
define symbol m_flash_config_end = 0x0000440F;

define symbol m_text_start = 0x00005000;
define symbol m_text_end = 0x000FFFFF;

 

 

0 Kudos
1 Reply

148 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@FanJialin

Can you provide a project that can reproduce the problem so that we can troubleshoot the problem more easily!

0 Kudos