Hi i currently working on Boot loader for S32K144. I read the status from external flash memory via SPI Communication. based on the result whether want to jump to main application or stay in bootloader itself.
if i use SPI Communication using blocking mode bootloader to main application jump not working.
same code with SPI Communication using interrupt mode bootloader to main application jump working fine.
i'm not using DMA for SPI Communication. using SPI Interrupt only.
before jumping i de-initialize all the peripherals.and disable gloabl interupt also.
INT_SYS_DisableIRQGlobal();
rr_timer_deinit();
rr_can_deinit_u8(CAN_0_INSTANCE);
rr_can_deinit_u8(CAN_1_INSTANCE);
rr_spi_deinit(1);
//SysTickIntDisable();
//SysTickDisable();
app_entry_u32 = *((U32*)MAIN_APPLICATION_START_ADDRESS);
JumpAddress = *((U32*)(MAIN_APPLICATION_START_ADDRESS + 4));
JumpToApplication = (pFunction_1) JumpAddress;
/* Initialize user application's Stack Pointer */
// __set_MSP(app_entry_u32);
/* Jump to application */
JumpToApplication();