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!
Solved! Go to Solution.
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
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.
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.
Hi @luyq,
Unfortunately, aborting the operation leaves the flash in an indeterminate state.
Regards,
Daniel
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