Skip to content

Support unaligned reads in RmwNorFlashStorage::read#60

Open
adri326 wants to merge 1 commit intorust-embedded-community:masterfrom
adri326:feature/unaligned-storage-reads
Open

Support unaligned reads in RmwNorFlashStorage::read#60
adri326 wants to merge 1 commit intorust-embedded-community:masterfrom
adri326:feature/unaligned-storage-reads

Conversation

@adri326
Copy link
Copy Markdown

@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