use EIM to enjection SRAM_U Non-Correctable Error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

use EIM to enjection SRAM_U Non-Correctable Error

1,322 次查看
QiujuYe
Contributor III

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?

            
#if 0
            /* Initial for EIM module */
            EIM_DRV_Init(INST_EIM1, EIM_CHANNEL_COUNT0, eim1_ChannelConfig0);
#else
         EIM->EIMCR &= ~EIM_EIMCR_GEIEN_MASK;
         EIM->EICHDn[1].WORD0 = 0x00000000;
         EIM->EICHDn[1].WORD1 = 0x00000003;
         EIM->EICHEN = (EIM_EICHEN_EICH1EN_MASK);
         EIM->EIMCR = EIM_EIMCR_GEIEN_MASK;      /* Global Error Injection Enable */
         (void)EIM->EIMCR;                        /* Read-after_write */
#endif
Best Regards
Qiuju.ye       
0 项奖励
回复
5 回复数

1,206 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Qiuju.ye,

There is the Stack at the end of the SRAM_U region.

pastedImage_1.png

pastedImage_2.png

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.

pastedImage_3.png

pastedImage_4.png

Have you tried this example?

https://community.nxp.com/docs/DOC-342715 

Regards,

Daniel

0 项奖励
回复

1,206 次查看
QiujuYe
Contributor III

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

0 项奖励
回复

1,206 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi Qiuju.ye,

Yes, that is the issue.

BR, Daniel

0 项奖励
回复

1,206 次查看
QiujuYe
Contributor III

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

0 项奖励
回复

1,206 次查看
QiujuYe
Contributor III

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);
    }

  /*  .....*/

}

0 项奖励
回复