Hello all,
I have a S32K344 bootloader application running on a custom board that I've used to jump to applications that were generated in design studio with no prior issues. I now have a MATLAB generated application that I've been trying to jump to but with no success as it keeps hitting the application's hard fault handler or the debugger crashes (J-Trace).
Boot Flash Start: 0x00400000
App Flash Start: 0x00600000
App VTABLE: 0x0060800
App Jump: 0x00600804
*** This is how I've been jumping that has worked for me and that has appeared on other forums ***
typedef void(*voidFunPtr)(void);
void AppJump(void){
uint32_t pAppJump = (voidFunPtr)(*(uint32_t *) 0x00600804);
S32_SysTick->CSRr = 0;
S32_SCB->VTOR = (uint32_t)0x00600800;
( pAppJump )();
}
Actions I've done:
- Checked the map file generated from the application for the correct jump location, I've confirmed this through the disassembly
- Relocated the vector table to the application's table before the jump ( S32_SCB->VTOR )
- Disabled FreeRTOS and peripheral interrupts before the jump
- DeInit all active peripherals
- Disabled the Systick
- Configured the stack pointer
Are there any configurations going on with the MATLAB generated projects that I have to change? Is there some reinitialization I must do? I've searched through forum posts with boot troubles and tried their solutions but nothing has worked yet. I can jump to the application's startup_cm7.s code but I believe the fault occurs here at some point.