Hi,
I use EIM to enject a Non-Correctable Error for SRAM_U on board S32K146EVB, but the code alwarys stops at "EIM_DRV_Init();" , if suspend, it stop at " b DefaultISR". And when I run the demo in our developing code, it reset the board directly. but if operates EIM registers directly, instead of EIM_DRV_Init, it run well, I can get the right error address, but I can not get the right value, for example , the address is set value 0x30, after enject a NC error, the value should be 0x33 if data mask is 0x00000003, but I get the value still 0x30. I use address 0x2000EBF0 to test, the address is not over the range. So whether have some special attention for SRAM_U to enject an ECC Non-Correctable error?
Hi Qiuju.ye,
There is the Stack at the end of the SRAM_U region.
The EIM module is enabled in the EIM_DRV_Init() function, then it goes back to the main() function and generates a fault exception on the stack access.
Have you tried this example?
https://community.nxp.com/docs/DOC-342715
Regards,
Daniel
Hi Daniel,
I understand, if use "EIM_DRV_Init" for SRAM_U, it can cause an INVSTATE UsageFault exception on stack access. so I can use the way in SRAM ECC injection example, to avoid use "EIM_DRV_Init". thanks very much.
Best Regards
Qiuju.ye
Hi Qiuju.ye,
Yes, that is the issue.
BR, Daniel
Hi Daniel,
sorry, the last mail is not end, go on last mail.
when the example run "EIM_DRV_Init", it jump to " b DefaultISR".
eim_user_channel_config_t eim1_ChannelConfig0[EIM_CHANNEL_COUNT0] =
{
/* Configuration 0 */
{
.channel = 0x1U,
.checkBitMask = 0x00U,
.dataMask = 0x00000003U,
.enable = true
}
};
Best Regards
Qiuju.ye
Hi Daniel,
Thanks for your reply, I used the SRAM ECC injection example, it run well. the following is my example, can you help me find where is wrong?
int main()
{
/ * clock , pin init */
*(uint32_t *)0x2000A000 = 0x12U;
ERM_DRV_Init(INST_ERM1, ERM_CHANNEL_COUNT0, erm1_InitConfig0);
EIM_DRV_Init(INST_EIM1, EIM_CHANNEL_COUNT0, eim1_ChannelConfig0);
test = *(uint32_t *)0x2000A000;
(void)test;
EIM_DRV_Deinit(INST_EIM1);
ERM_DRV_GetErrorDetail(INST_ERM1, 1U, &addr);
if(addr == 0x2000A000)
{
PINS_DRV_WritePin(LED_GPIO, LED0, 0u); //red
PINS_DRV_WritePin(LED_GPIO, LED1, 0u); // green
PINS_DRV_WritePin(LED_GPIO, LED2, 1u); //blue
}
if(test == 0x11)
{
/* Turn off RED LED */
PINS_DRV_WritePin(LED_GPIO, LED0, 0u);
/* Turn on GREEN LED */
PINS_DRV_WritePin(LED_GPIO, LED1, 1u);
PINS_DRV_WritePin(LED_GPIO, LED2, 0u);
}
else
{
PINS_DRV_WritePin(LED_GPIO, LED0, 1u);
PINS_DRV_WritePin(LED_GPIO, LED1, 0u);
PINS_DRV_WritePin(LED_GPIO, LED2, 0u);
}
/* .....*/
}