AnsweredAssumed Answered

Question aobut a Flash ECC module on MPC5674F

Question asked by YoungSeo LEE on Oct 19, 2017
Latest reply on Oct 23, 2017 by David Tosenovjan

Last month, i have implemented a flash ECC error injection code with your help.

 

I have a question about a parity generation in the attached code.

 

================================================================================

/* step2. program data */
DFLASH_0.MCR.B.PGM = 1; // select operation (program)
*((unsigned int*) DATA_FLASH_addr_0) = 0x00450000; // first write
DFLASH_0.MCR.B.EHV = 1; // start the program operation
while(DFLASH_0.MCR.B.DONE == 0){}; // wait for DONE
DFLASH_0.MCR.B.EHV = 0; // operation end
*((unsigned int*) DATA_FLASH_addr_1) = 0x00000000; // additional write
DFLASH_0.MCR.B.EHV = 1; // start the program operation
while(DFLASH_0.MCR.B.DONE == 0){}; // wait for DONE
DFLASH_0.MCR.B.EHV = 0; // operation end
DFLASH_0.MCR.B.PGM = 0; // deselect operation

/* step3. over-program data - this generates ECC error */
DFLASH_0.MCR.B.PGM = 1; // select operation (program)
*((unsigned int*) DATA_FLASH_addr_0) = 0x00580000; // first write
DFLASH_0.MCR.B.EHV = 1; // start the program operation
while(DFLASH_0.MCR.B.DONE == 0){}; // wait for DONE
DFLASH_0.MCR.B.EHV = 0; // operation end
*((unsigned int*) DATA_FLASH_addr_1) = 0x00000000; // additional write
DFLASH_0.MCR.B.EHV = 1; // start the program operation
while(DFLASH_0.MCR.B.DONE == 0){}; // wait for DONE
DFLASH_0.MCR.B.EHV = 0; // operation end
DFLASH_0.MCR.B.PGM = 0; // deselect operation

================================================================================

 

In the step 2 code, parity bits is generated when the data is stored in the flash.

 

however, in the step 3 code, parity bits is not generated whe the data is stored in the flash.

 

I had understood that .

 

I had been understood parity bits is generated every time any data is written in the flash memory. 

 

is this wrong to do understand?

 

is there required some procedures for re-generation the parity bits? 

Outcomes