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

Support unaligned reads in RmwNorFlashStorage::read #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adri326
Copy link

@adri326 adri326 commented Aug 28, 2024

Fixes #49

I also included some small tests.

One could most definitely choose to use the same method as in RmwNorFlashStorage::write of splitting the range into many small blocks, but I've found in my project that small reads are quite detrimental when the flash instructions have to transit over some channel, like SPI.

In my project, I went with a similar solution of doing two small reads at the head and at the tail of the requested range, and then one big read for the main body, amortizing the runtime cost of individual reads.

I wasn't sure if the read in RmwNorFlashStorage::write was unaligned, but if it happens to be unaligned, then the subsequent calls to erase/write would fail anyway.

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.

RmwNorFlashStorage requires aligned reads
1 participant