Jumping from bootloader to Application

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

Jumping from bootloader to Application

2,469 Views
ambarishhundeka
Contributor III

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"); ????

}

Labels (1)
3 Replies

1,229 Views
ambarishhundeka
Contributor III

Hi,

address 0xA000 (or 0x9000)  application entry point -  Application() function start address.

yes, by default S32DS projects start with IRQ, flash config etc, as you mentioned it in the above reply and it jump to main.

for the testing purpose , calling the function BLC_Main() in main() function and performing some operation.  jump to application from bootloader based on some condition.

I have created the App_codeArea section in the linker file , placed the Application() code to the App_codeArea section.

so Application() starts from the 0x0A000.

hope I answered your doubt.

I need to copy App start address to some register( Application start address is not fixed, OX0A000 or 0x09000) and jump to the register address.

facing problems with blx and loading the address to PC(please fallow the first post, if I use these two methods , it goes to default ISR).

Regards,

Ambarish.

0 Kudos

1,229 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Just adding a link to this thread:

https://community.nxp.com/thread/469549 

1,229 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

is on address 0xA000 (or 0x9000)  application entry point - main function? By default S32DS project starts with IRQ vector table, flash config and reset handler. All this stuff is maintained by bootloader. App itself should start with some HW config with jump into main() or with main() directly. 

Jiri 

0 Kudos