s32k3

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
3,099 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
Reply
1 Solution
3,060 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
Reply
7 Replies
3,039 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
Reply
3,017 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
Reply
2,933 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
Reply
3,083 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
Reply
3,073 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
Reply
3,061 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
Reply
3,046 Views
luyq
Contributor III
Is there any processing strategy on the software to avoid this problem after detecting power failure?
0 Kudos
Reply