Skip to content

esp32: add basic support for NVS Non-Volatile-Storage #6780

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 2 commits into from

Conversation

tve
Copy link
Contributor

@tve tve commented Jan 18, 2021

This PR implements basic NVS support for the esp32. It follows the pattern of the esp32.Partition class and exposes an NVS object per NVS namespace. The initial support provided is only for signed 32-bit integers and binary blobs. The ints 'cause I need them to provide some config variables that can be read in main() before python code can execute (PR with a nifty feature coming soon...) and the blobs because they allow anything to be stored. It's easy (albeit a bit tedious) to add support for more types, but I'm not sure what really makes sense. In general, config for python apps should use files, not NVS IMHO...

Previous issues / PRs: #4436 and #4707

@dpgeorge
Copy link
Member

Looks good to me. But maybe we (I) should get to the esp32-cmake stuff first so that we can move on completely from IDF3?

@tve
Copy link
Contributor Author

tve commented Jan 30, 2021

I'm not sure this has any dependency on the cmake stuff, but yes, making progress on that would be awesome.

@dpgeorge
Copy link
Member

I'm not sure this has any dependency on the cmake stuff

You're right, it doesn't directly. I just saw that this NVS feature is not implemented for IDF3. So if merged as-is, that code path for IDF3 would pretty soon just be removed. It's just a question of which one to concentrate on first, cmake and IDF4 only, or these set of PRs with new esp32 features. I don't really mind (but I would actually like to try and cut a release before anything else...).

dpgeorge pushed a commit that referenced this pull request Feb 19, 2021
This commit implements basic NVS support for the esp32.  It follows the
pattern of the esp32.Partition class and exposes an NVS object per NVS
namespace.  The initial support provided is only for signed 32-bit integers
and binary blobs.  It's easy (albeit a bit tedious) to add support for
more types.

See discussions in: #4436, #4707, #6780
@dpgeorge
Copy link
Member

Rebased on latest master and tested to work against IDF v4.1.1 (works also with v4.0.2 but error message names don't work, seems to be a bug in that version of the IDF).

Merged in c10d431

Thank you!

@dpgeorge dpgeorge closed this Feb 19, 2021
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Aug 19, 2022
…ries-8.0.0-beta.0

update frozen libraries for 8.0.0-beta.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants