Reset to App

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

Reset to App

154 Views
rmaier
Contributor III

Hello,

 

We are working on implementing a bootloader on the S32K144. The problem we are having is launching the newly bootloaded App.

The bootloader occupies the flash from 0 to 0x1FF. The application starts at 0x2000. When looking at the memory at 0x2000 the bootloaded memory and app memory look the same.

rmaier_0-1709160338445.png

//We have this def
#define PROG_START 0x00002000
//When the app is ready to launch, call this
JumpToProgram(*((uint32_t *)PROG_START), *((uint32_t *)(PROG_START + 4)));

void JumpToProgram(uint32_t userSP, uint32_t userStartup)
{
    /* Set up stack pointer */
    DISABLE_INTERRUPTS();
    __asm("msr msp, r0");
    __asm("msr psp, r0");
    ENABLE_INTERRUPTS();

    // Set app_start to point to the application's reset handler
    AppAddr resetHandle = (AppAddr)(userStartup);

    (resetHandle)();
}

 

This causes the target to reset and load back into bootloader rather than execute the App. I am using S32DS for ARM. Is there anything I am missing?

 

Thanks,

Robert

 

0 Kudos
1 Reply

118 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @rmaier,

Do you mean the vector table at 0x0 and 0x2000 looks the same?

How did you build the application code? Did you modify the linker file?

Have a look at AN12218 S32K1xx Bootloader

Chapter 3. Building compatible applications

https://www.nxp.com/docs/en/application-note/AN12218.pdf

 

Thank you,

BR, Daniel

0 Kudos