ECC inject test in MPC5744P EEPROM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ECC inject test in MPC5744P EEPROM

1,176 Views
richardsha
Contributor I

Hello,

We want to do ECC inject test in EEPROM in MPC5744P, I try to refer the example MPC5744P_1b+2b_FLASH_ECC_error_injection-v0_1-GHS614 as below, and interlock write the address of mid block 0 flash 0x00808000 data to 0x00450000 and 0x00580000, but the ECC error is not occured, Could you help to check my code if is correct, or have other method to do ECC inject test for mid block 0/1 in MPC5744P EEPROM?

   register uint32_t test_read_7 = 0; 
   /* Generate flash ECC error */
 
   // step1. unlock all blocks (for simplicity)
   C55FMC.LOCK0.R = 0;
   C55FMC.LOCK1.R = 0;
   C55FMC.LOCK2.R = 0;
   C55FMC.LOCK3.R = 0;
 
   // step2. erase the EEPROM mid block 0 (0x00808000 - 0x0080FFFF)
   C55FMC.MCR.B.ERS = 1;
   C55FMC.SEL0.R = 0x00000001; // select the EEPORM mid block 1
   *(unsigned int*)0x00808000 = 0xFFFFFFFF;    //interlock write
   C55FMC.MCR.B.EHV = 1;
   while(C55FMC.MCR.B.DONE == 0);
   C55FMC.MCR.B.EHV = 0;
   C55FMC.MCR.B.ERS = 0;
   // step3. program data
   C55FMC.MCR.B.PGM = 1;
   *(unsigned int*)0x00808000 = 0x00450000;    //interlock write
   *(unsigned int*)0x00808004 = 0x00000000;
 
   C55FMC.MCR.B.EHV = 1;
   while(C55FMC.MCR.B.DONE == 0);
   C55FMC.MCR.B.EHV = 0;
   C55FMC.MCR.B.PGM = 0;
 
   // step4. over-program data - this generates ECC error
   C55FMC.MCR.B.PGM = 1;
   *(unsigned int*)0x00808000 = 0x00580000;    //interlock write
   *(unsigned int*)0x00808004 = 0x00000000;   
   C55FMC.MCR.B.EHV = 1;
   while(C55FMC.MCR.B.DONE == 0);
   C55FMC.MCR.B.EHV = 0;
   C55FMC.MCR.B.PGM = 0;
 
   // step 5. now here the ECC is checked and non-correctable error found
   test_read_7 = *(unsigned int*)0x00808000;
   //test_read = *(unsigned int*)0x00808004;

Thank you.

Richard

0 Kudos
4 Replies

790 Views
richardsha
Contributor I

Hello David,

I used my above proposal code to try do EEPROM ECC error, but no ECC error, and also the MEMU registers value all are 0(zero), that seem the method is not correrct. could you try to simulate the EEPROM ECC error and let me know your test procedure?

Thank you.

Richard.

0 Kudos

790 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Reading of ECC error in data flash does not respond as bus error nor it is reported to MEMU. Instead it returns 0xFFFF_FFFF.

Check ECC Event Error status flags in C55FMC_MCR register to prove if there is ECC error during read from that area or not.

790 Views
richardsha
Contributor I

Hello David,

The C55FMC_MCR registor value is 0x00008400, the EER bit is set. but it does not report to MEMU(all are 0). and also not interrupt and FCCU fault.

Can we setup a interrupt routine to check the data flash ECC error? or only check the C55FMC_MCR registor in software to find the ECC error?

Becase of we use data flash to simuate EERPROM (read/wirte) to store parameters in our appliction, so we should know data flash ECC error which block will be effected our application function and avoid the appliction fault.

Thank you very much.

Richard

0 Kudos

790 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

It is data flash area and on this device expected reaction is returning of 0xFF, it will not invoke machine check handler.

pastedImage_3.png

pastedImage_2.png

0 Kudos