s32k3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决
2,948 次查看
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 项奖励
回复
1 解答
2,909 次查看
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 项奖励
回复
7 回复数
2,888 次查看
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 项奖励
回复
2,866 次查看
luyq
Contributor III
Do you mean to catch the exception by software and then erase the area to recover from the error?
0 项奖励
回复
2,782 次查看
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 项奖励
回复
2,932 次查看
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 项奖励
回复
2,922 次查看
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 项奖励
回复
2,910 次查看
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 项奖励
回复
2,895 次查看
luyq
Contributor III
Is there any processing strategy on the software to avoid this problem after detecting power failure?
0 项奖励
回复