AnsweredAssumed Answered

S32K144 bootloader jump into application

Question asked by Kim Fung on May 20, 2017
Latest reply on Sep 21, 2017 by eautopower

Hi,

 

How the bootloader to jump into application? When program jumps into the application, the mcu will reset. I use the function below to jump, does it work?

 

void JumpToExecute(uint32_t SP, uint32_t Startup)
{
    volatile uint32_t avoid_optimization;

 

    /* In order to avoid optimization issue when -Os */
    avoid_optimization = SP;
    /* In order to avoid optimization issue when -Os */
    avoid_optimization = Startup;

 

    /* set up stack pointer */
    __asm("msr msp, r0");
    __asm("msr psp, r0");

 

    /* Jump to PC (r1) */
    __asm("mov pc, r1");
}

 

Thanks & regards,

Jim

Outcomes