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

[esp-storage]: Add ability to Read/Write flash using embedded-io::{Read, Write} #3230

Open
AnthonyGrondin opened this issue Mar 6, 2025 · 0 comments
Labels
status:needs-attention This should be prioritized

Comments

@AnthonyGrondin
Copy link
Contributor

Motivations

Currently esp-storage implements embedded_storage::{ReadStorage, Storage} to read and write to flash storage, but those traits take a slice as input. Let's say a user wants to write a large amount of bytes (> 20k for example), from a data structure that needs serialization, this requires the user to create a whole copy of that data in memory, during serialization, before writing it.

Considering that reading directly from flash would still require a slice to be passed for the bytes to be stored, optimization is more about writing.

Some implementations, such as postcard offer an API to Serialize / De-serialize directly from implementers of embedded-io::{Read, Write}.

Solution

Implement more traits for FlashStorage to allow reading and writing from types implementing embedded-io::{Read, Write} traits

Alternatives

N/A

Additional context

@AnthonyGrondin AnthonyGrondin added the status:needs-attention This should be prioritized label Mar 6, 2025
@github-project-automation github-project-automation bot moved this to Todo in esp-rs Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:needs-attention This should be prioritized
Projects
Status: Todo
Development

No branches or pull requests

1 participant