Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReadNorFlash::read_if_not_empty #65

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bugadani
Copy link

This is a somewhat experimental change, where I'm mainly looking for feedback at first. There are two cases I can imagine, where erased flash may not read back as 0xFF:

  • Devices with transparent flash encryption, like the ESP32
  • Certain CMSIS-Packs (example) indicate this, although I'm not sure whether this is an error in the pack.

In "normal" cases, read_if_not_empty just issues a single read and checks the bytes, like in the default implementation. In the case of ESP32, the implementation would issue a decryption-bypassing read first to check for the empty value, then read the decrypted bytes again if not empty.

The goal of this addition is to enable storage solutions to work with flash encryption without any additional marker traits or similar complications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant