How to detect Flash ECC error before read

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

How to detect Flash ECC error before read

1,279 Views
ningwang
Contributor III

        Hi, currently I'm using MPC5748G in my project and encounter a problem of flash ECC error in a test of random power lose.  The software uses one of 256K internal code flash (different partition with the code) for data storage to save some system parameters, and load them during system initialization. Flash ECC error occurs when power lose during the operation of program or erase sometimes. After reset, when reading this 256K flash address, it causes machine check exception with the ECC error indicating that address.

       My question is how to detect the ECC error before reading that address? Or how to avoid this address to generate an exception?
       Thanks very much.

0 Kudos
4 Replies

1,071 Views
ningwang
Contributor III

         Hi, Lukas, thanks for you answer very much.

         In the document of "AN4868 EEPROM Emulation with Qorivva MPC55xx, MPC56xx, and MPC57xx Microcontrollers", it says:

pastedImage_1.png

these 'EEPROM Emulation' labeled blocks will not generate ECC error report even if  the operation is unsuccessful. So I used the 32KB block which address is "0x00FB_8000-0x00FB_FFFF" to do the same random power lose experiment, but finally get the same result, in other words, it also will get machine check exception when CPU read it.

       So why these 'EEPROM Emulation' labeled blocks also generate ECC errors ? I get confused.

0 Kudos

1,071 Views
llb8530
Contributor II

I encountered the same problem when using MPC5604,and i am trying to find the solution. i come form china, we can add each other in WeChat. This is my ID 18946636923, add me. 

0 Kudos

1,071 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

there's an erratum on MPC5748G:

pastedImage_1.png

https://www.nxp.com/docs/en/errata/MPC5748G_0N78S.pdf 

Regards,

Lukas

0 Kudos

1,071 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

it's not possible to mask this event on CPU.

One workaround is to use DMA. There are two flags in error status register DMA_ES:

pastedImage_1.png

Read section "70.4.2 Fault reporting and handling" which describes the behavior in detail.

Regards,

Lukas

0 Kudos