I am using nrfx_nvmc_page_partial_erase_init() and nrfx_nvmc_page_partial_erase_continue() to erase flash in-between wireless connection events. The datasheet states:
"The bits in the page are undefined if the flash page erase is incomplete, i.e. if a partial erase has started but the total erase time is less than tERASEPAGE."
I am looking to add protection/ensure data integrity of flash in cases when the device is reset in the middle of the page erase (e.g. after calling *_init() and before *_continue() returns true).
- When the device resets, can we trust flash was successfully erased if it reads 0xFF?
- If we write data to the page and read it back successfully, can we trust that it is fully written (e.g. the flash is not in some meta-stable state)?
- If I want to proactively stop the erase after beginning, can I write 0x00 to one of the bytes in the page to mark it as invalid?
If there are any other best practices regarding partial page erases, please do share.