Hi,
I tried to test the action of ERM after an double bit ECC error occured(none-correctable),to my understanding,in S32K116 ,after an double bit ECC error occured the hardfault_handler will first be triggered ,and user can add some code to the hardfault_handler to deal the error flag in ERM
but when i injected an double bit ECC error to SRAM_U, the SRAM was dirrectly cleared with the vector_table in SRAM reset to 0x00000000 ,and after an hardfault_handler trigger ,the pc(core register) jumpt to 0x00000000 to fetch code ,and then ,the program crashed.
as you know , stack locte in S32K116'SSRAM_U ,therefor ethe double bit ECC error will be triggered in EIM_DRV_Init() first ,following is the debug info before enable EIM module

I redefined NMI_Handler,HardFault_Handler at following code ,so their func address in SRAM is not default value(WDG_Handler,0x46d)
void ECC_check_init(void)
{
ERM_DRV_Init(INST_ERM1, ERM_CHANNEL_COUNT0, erm1_InitConfig0);
INT_SYS_EnableIRQ(ERM_fault_IRQn);
INT_SYS_InstallHandler(ERM_fault_IRQn,erm_error_cbk,NULL);
INT_SYS_InstallHandler(NonMaskableInt_IRQn,Fault_Handler,NULL);
INT_SYS_InstallHandler(HardFault_IRQn,Fault_Handler,NULL);
INT_SYS_InstallHandler(SVCall_IRQn,Fault_Handler,NULL);
INT_SYS_InstallHandler(PendSV_IRQn,Fault_Handler,NULL);
}
void Fault_Handler(void)
{
while(1);
}

to describe the problem in detail ,the code line before trigger ECC double bit error will need to change to disassembly view as you see in pic2(no breakpoint in the program also will cause crash)
the SRAM was cleared,and the register xpsr == 0x81000000 ,which mean no interrupt triggered,the same time(or before SRAM cleared) the ERM NEC0 was set to 1

then,go on signal step debug, xpsr == 0x81000003 ,it seems an hardfault_handler interrupt was triggered and the program crashed
I guess that after xpsr change to 0x81000003 the pc(register) will go to SRAM address 0x2000000c to fetch the entry of hardfault_handler,but as you see, the SRAM was cleared by some reason,at the end ,the program crashed because the error address
so,what caused the SRAM cleared ,and what should i do to deal double bit error in hardfault handler?