darrylring commented on PR #20144:
URL: https://github.com/apache/nuttx/pull/20144#issuecomment-5733895110

   There's probably a better place to continue discussing this, but just 
thinking that for word read/write (without block locking), we can do something 
like this:
   
   * read will do the read, check the flash ECC error register, and use a 
return code to indicate the error
   * write will first do a read, and only attempt a write if the read returns 
0xFFFF _and_ an ECC error
   
   Read can return one of `OK`, `ERR_UNWRITTEN`, or `ERR_BAD_ECC`
   Write can return one of `OK`, `ERR_ALREADY_WRITTEN`
   
   That should hopefully prevent data corruption in most use cases?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to