Hi Daniel,
Could you please verify whether the ITCM is properly initialized in the startup code (startup_cm7.s, in the ITCM_Init section)?
I'm using the default S32DS CMSIS Core Device Startup File startup_ARMCM7.c, I'm attaching the standard .c file to this reply.
I checked the "Example_Siul2_Port_Ip_Example_S32K344_ITCM_DTCM_S32DS3.4 RTD300.zip" to get an idea of what it looks like (as shown in screenshot below for for future reference).
fede_ls_0-1753869362851.png
Does it mean that ITCM and DTCM are not initialized by default with non-RTD startup files?
I made sure that SCB->ITCMCR shows that ITCM is indeed enabled and I tried to disable->reenable on startup.
I noticed an error being detected at address 0x508.
Can you check what code is located at that address in the .map file?
fede_ls_1-1753870680244.png
If a genuine ECC error can be ruled out, the issue might be related to the system clock configuration.
NXP does not guarantee proper MCU functionality if the system clock settings do not adhere to the division ratios specified in the clock options.
For example, refer to Table 157, Option A – High Performance Mode (CORE_CLK @ 160 MHz).
I currently successfully configured the clocks to Option A and verified that their configuration is indeed applied.