Skip to content

STM32 Buffered EEPROM #25

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

Closed
wants to merge 1 commit into from
Closed

Conversation

aaron-neal
Copy link

I found the eeprom write slow, which was a known fact due to the EEPROM emulation in the official STM32 core.
I have found using the buffered write and flush methods resolves this problem.
I am not intending this to be the final solution, as my tests have been succesful but minimul in nature.

Happy to help to get this merged if you feel it is helpful for others.

I haven't found the read an issue, maybe eeprom_buffered_read_byte should be used as well?

@bblanchon
Copy link
Owner

Hi @porkyneal,

Thank you for this PR.
However, I want to reduce platform-specific code in this library, and this change is very specific.
Moreover, you can achieve the same result with a BufferedStream:

EepromStream eepromStream{0, 1024};
BufferedStream bufferedEepromStream{eepromStream, 32};

After all, that's the purpose of this library: augment existing streams with decorators.

Best regards,
Benoit

@aaron-neal
Copy link
Author

Thanks @bblanchon I will give this a go and I appreciate wanting to keep it platform agnostic. It is the reason I am here, this helps me keep configuration code the same between ESP32 targets and STM32 ones.

I am not clear how the example helps as the stm32 core underlying non buffered eeprom write is highly ineffective as it updates an entire page for every single byte written. That's why the bufered functions exist in the core. See the commit here

But I may be missing something, will report back at some point.

@nerdyscout
Copy link

I guess supporting SAMD NVM as an EEPROM is not planned for the same reason?
https://github.com/nerdyscout/ArduinoStreamUtils/tree/SAMD

@bblanchon
Copy link
Owner

Indeed, @nerdyscout, the change you suggest relies on a third-party library; I restrict myself to built-in libraries to avoid making maintenance a nightmare.
For example, in your fork, you assume that all SAMD users have FlashStorage_SAMD installed, which will cause a compilation error for most users.

@bblanchon bblanchon closed this Jan 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants