-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Rebase EEPROM Lib. and add partition.csv #8440
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
Conversation
I'm not really going to advocate one way or the other on this, and leave it to Hristo's vision for the project. Now that custom partitions are much easier, it certainly is not a bad thing to be able to rebase to the more mainline EEPROM library. |
👋 Hello fedy0, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Closing this PR, as we came to a conclusion that how EEPROM is currently based on NVS is fine even though there are little incompatibilities with AVR's EEPROM lib. |
Description of Change
Summary:
Rebase EEPROM library to its stable release (even < arduino-esp32 v2.0.0) and add example partition.csv
Details:
@me-no-dev
After a while, I decided to test and compare the following arrangement for speed and code size
Old stable EEPROM implementation (on the right)

Current Bloated EEPROM implementation with nvs (that has been labelled deprecated); additions from by @lbernstone

I respect @lbernstone contributions, but I believe the nvs implementation added another indirection which may not be necessary; thus, a container within a container
NOTE: The comments below are refering to EEPROMClass' old stable implementation (ie. without nvs)
The beauty of the EEPROMClass is its granularity of accessing data and the direct memory control it gives the user.
EEPROMClass is more efficient than Preferences Library in terms of memory usage because a character field (char name[]) is require to save any data; even a signle byte. Although, Preferences Library makes it easier for the user not to keep track of the address of the data stored (better UX), however, sometimes a bit/byte level storage may be required and hence, EEPROMClass.
I think it is important to allow the two libraries to co-exist because, while nvs uses key-value pair to access data, EEPROMClass provides byte-level access with backward compatibility to the original Arduino EEPROM API.
IMHO, it was unnecessary to move EEPROMClass atop nvs.
I have gotten a lot of requests and comments priavately about this library and its stability, thus I have rebased the library to its stable and working release (i.e. prior to the nvs conversion).
Also, I update its examples to fit the new feature of creating custom EEPROM partition within the Arduino project folder while keeping everything simple (Please see the example; I've cleaned it up)
Tests scenarios
Tested With arduino-esp32 v2.0.6.
Tested on ESP32 and ESP32-S3
Related links
Too many issue:
#1929
#5881
#5831
#5159
#3785
#2280
#1263
#1238
#2174
#2919
etc