I am currently porting a working Bootloader project from the S32K312 to the S32K311. I am using S32 Design Studio along with NXP RTD 4.9.0 and the GCC compiler. I am encountering two severe issues related to the Vector Table and Reset Handler that seem specific to the S32K311 / RTD 4.9 environment.
Issue 1: Immediate UsageFault on Debugger Reset When launching the PEMicro debugger, the core crashes immediately during the reset script before ever reaching main().
Reset script (...) completed.
UsageFault: An instruction executed with an invalid EPSR.T or EPSR.IT field.
HardFault: A fault has been escalated to a hard fault.
We checked startup_cm7.s and Vector_Table.s. We noticed that Reset_Handler was missing the .type Reset_Handler, %function directive, causing the ELF entry point to be an even address (e.g., 0x00402420 instead of 0x00402421), which naturally causes an ARM-mode UsageFault on the Cortex-M7.
Even after fixing the .type directive and ensuring the Vector Table has the LSB set for Thumb mode, the PEMicro debugger still occasionally throws this UsageFault immediately upon reset.
Issue 2: Interrupts jump to 0x0 (Uninitialized RAM Vector Table) When we successfully bypass the reset issue and reach main(), the system crashes the moment a hardware interrupt (like FlexCAN or SWT) triggers. The PC jumps to 0x00000000.
Upon investigating memory, we found that the RAM vector table at __interrupts_ram_start (0x20000000) is completely uninitialized (filled with zeroes). We discovered that:
startup_cm7.s sets VTOR to __RAM_INTERRUPT_START at the end of initialization but never copies the table from ROM.
IntCtrl_Ip_Init(&IntCtrlConfig_0) (generated by the Platform component) sets VTOR if INT_CTRL_IP_ENABLE_VTOR_CONFIG is enabled, but it also does not copy the default vector table from flash to RAM.
To work around this, we had to write a manual for-loop in main.c to physically copy the vector table from __interrupts_init_start to __interrupts_ram_start and update S32_SCB->VTOR before calling IntCtrl_Ip_InstallHandler().
got the base code from Unified bootloader Demo
does anyone know a post where the bootloader for S32K311 with CAN was ported and posted??