My project uses an S32K324 controller.
I'm facing an issue with standalone SW run without debugger.
SW intends to use Standby RAM of the S32K3 MCU.
After hot attaching the debugger, it's found that the cause of SW stuck is MemManageFault exception.
- MMARVALID bit is SET in MMFSR register
- MMAR register shows address of the starting address [0x20400900] of Standby RAM defined in linker file
Per the S32K3xx reference manual:
- first 32K of SRAM can be used as Standby RAM
- After a chip power-on-reset, RAM must be initialized to a known value using a 64-bit master before any 32-bit read / write operations can be performed
Our SW build would like to use 1K of Standby RAM from the following address and size:
[standby_ram : ORIGIN = 0x20400900, LENGTH = 0x00000400]
We use the following code to initialize the Standby RAM as quoted in the S32K3 reference manual:
RamMemPtr2 = (uint64 *)0x20400900;
if ( ResetReasonB == McuConf_McuResetReasonConf_MCU_POWER_ON_RESET )
{
for ( index =0 ; index<96; index++ )
{
RamMemPtr2[index] = 0U;
}
}
We are unable to use the standby RAM starting from location address 0x20400000 because the Vector FBL package we use require 1KB of space to load the flash driver.
S32K3 manual does not mention explicitly about starting the Standby RAM initialization from address 0x20400000.
Hence, I'm assuming that it's permissible to use a memory region anywhere within the first 32K as starting address.
Has anyone faced the above issue with Standby RAM?
Any thoughts or clue on what's going wrong?