AnsweredAssumed Answered

Jumping from bootloader to Application

Question asked by Ambarish Hundekar on Jan 17, 2018
Latest reply on Feb 14, 2018 by Lukas Zadrapa

Hi NXP team,

 

I am using S32K144 controller in our project.

I am facing some problems with " jump to application from boot loader".

my application may starts from 0xA000 or 0x9000 address as per our requirement.

 

Problem 1:

code is

 

JumptoApp(T_U32 *ptr)

{

   FSL_SCB->VTOR = (uint32_t)&__VECTOR_TABLE; //don't want to relocate vector table

   DISABLE_INTERRUPTS();

      asm("ldr r0,=0x0000A000");

      asm("blx r0");

 

}

__attribute__((section (".App_codearea"))) void Application(void)

{

int b;

b = 10;

while(1);

// ENABLE_INTERRUPTS();

 

}

 

.App_codearea section starts from 0x0000A000;

If I run the above code , then it goes to default isr, it is not jumping to application.

if I use asm("bl 0x0000A000") it is jumping to the application address.

if I load the PC with 0x8000 address also , it jumps to application and goes to default ISR.

why above code is not jumping to application? 

 

Problem 2 :

 

could you please tell me how to load the other registers with  pointer value?

 

JumptoApp(T_U32 *ptr)

{

//how to load the register with pointer value (passed as input argument to this function)

    asm("ldr r1, ptr"); ????

}

Outcomes