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.
//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
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