Hi,
do sd_flash_page_erase or sd_flash_write provide any guarantees that the command has executed successfully or should I do a manual check to verify if the page was really erased or the data was written correctly?
Thanks, Marius
Hi,
do sd_flash_page_erase or sd_flash_write provide any guarantees that the command has executed successfully or should I do a manual check to verify if the page was really erased or the data was written correctly?
Thanks, Marius
Hi,
There is no automatic verification of flash content (sd_flash_page_erase /sd_flash_write will not read back the data), so this is something you can add if you want (though I have not heard of this being a problem, and we don't do that ourselves).
Hi,
There is no automatic verification of flash content (sd_flash_page_erase /sd_flash_write will not read back the data), so this is something you can add if you want (though I have not heard of this being a problem, and we don't do that ourselves).
Thanks, so you think this could only happen if the flash is corrupt after too many erase cycles? And there will be no possibility that it works the second time?
Yes, after you exceed the spec, i.e. more than 10 000 Write/erase cycles, you have no "100%" guarantees anymore. See this post.
We use NOR flash in our devices, and in general, NOR flash is reliable and does not require any error correction in software/firmware. (I also believe the underlying NOR HW flash algorithm does verification, i.e it tries to write a number of times until the flash has been verified to have been written properly)
@Sigurdon, can you please give some more information on the underlying HW flash algorithm? Does it really verify? Or can you point me to the HW spec of the actual NVM part used in the nRF52832 boards?
Hi Sigurd, if you can provide any info on this, it would be appreciated! :)
Embedded NOR flash typically implements a kind of programming "state-machine". Verify operation typically consist in controlling the memory cells under program, and checks if they have reached the target threshold voltage. If the target voltage inside the memory cell is not reached, it will typically retry the write operation. See this book chapter from Springer. Nordic is not the company designing the flash used inside our chips, so HW flash algorithms are Intellectual property (IP) owned by the flash vendor company.
What happens when you exceed the spec is that the probability of bit flipping happening gradually increases. In the latest FDS drivers, we have implemented CRC checks on read and write, so that you can verify that the data you once wrote, is matching the one you read back later. See this link.
But again, note that NOR flash is very reliable, and does not generally need any error correction in software/firmware