s32k3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
2,207 Views
luyq
Contributor III

Hello!

  When the D-flash is executing the erase command, if it is powered off, it will cause an ECC check error on the D-flash. In order to avoid this problem, when I detect a power failure, I call the command to terminate the operation. Can this prevent ECC errors? In addition, does the flash hardware continue to operate after calling the flash termination command?

  Looking forward to your reply!

 

0 Kudos
1 Solution
2,168 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Yes, if the power is loss during a flash operation, the data record and its ECC checksum cannot be guaranteed to be correct.

 

Regards,

Daniel

View solution in original post

0 Kudos
7 Replies
2,147 Views
ferencvalenta
Contributor III

You can handle the exceptions, but that's somewhat complicated. I use the DMA controller to read from flash that was erased/programmed in the application. No exception, only the error bit is set but that's easy to handle.

0 Kudos
2,125 Views
luyq
Contributor III
Do you mean to catch the exception by software and then erase the area to recover from the error?
0 Kudos
2,041 Views
ferencvalenta
Contributor III

Yes that's one option. Actually on another MCU that's what the Tresos Fls driver expects. You have to call the exception handler of the flash driver and then return from the exception or reset the system, and Fls will take care of cleaning up the invalid memory.

I found the DMA solution easier to use.

0 Kudos
2,191 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @luyq,

Unfortunately, aborting the operation leaves the flash in an indeterminate state.

 

  • danielmartynek_0-1690373673746.png

 

 

  • danielmartynek_1-1690373681055.png
  • danielmartynek_2-1690373706903.png

 

Regards,

Daniel

0 Kudos
2,181 Views
luyq
Contributor III
I accept the consequences of data errors after terminating the operation, but if an exception occurs at this time, such as power failure, will it cause ECC errors?
0 Kudos
2,169 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Yes, if the power is loss during a flash operation, the data record and its ECC checksum cannot be guaranteed to be correct.

 

Regards,

Daniel

0 Kudos
2,154 Views
luyq
Contributor III
Is there any processing strategy on the software to avoid this problem after detecting power failure?
0 Kudos