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();
Hi @prabhus
similar issues are usually caused by insufficient deinitialization. If blocking / non-blocking SPI configuration makes the difference, I would focus on SPI configuration and ARM NVIC configuration. So, I would put a breakpoint at the jump instruction and once you reach the breakpoint, check the SPI registers and NVIC registers. Do the same for both blocking and non-blocking configuration. Then compare the content of registers. I guess there will be some difference which causes the problem. And in any case, make sure that all the interrupts are disabled in NVIC, pending interrupts are cleared and priorities are changed back to default state.
Regards,
Lukas
same thing happen for CAN transmit blocking method also . it means any blocking method transmit it not jumping to bootloader