Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

fedy0
Copy link
Contributor

@fedy0 fedy0 commented Jul 21, 2023

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

  1. Old stable EEPROM implementation (on the right)
    image

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

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

@CLAassistant
Copy link

CLAassistant commented Jul 21, 2023

CLA assistant check
All committers have signed the CLA.

@VojtechBartoska VojtechBartoska added the Status: Review needed Issue or PR is awaiting review label Aug 28, 2023
@lbernstone
Copy link
Contributor

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.
However, the other thing you get with nvs is wear levelling. If you put a single sector partition out there for EEPROM, once that sector gets damaged, your EEPROM is dead.

@VojtechBartoska VojtechBartoska added the Status: Awaiting triage Issue is waiting for triage label Nov 28, 2023
@VojtechBartoska VojtechBartoska added this to the 3.0.0 milestone Nov 28, 2023
@VojtechBartoska VojtechBartoska requested review from P-R-O-C-H-Y and lucasssvaz and removed request for me-no-dev and SuGlider January 30, 2024 09:30
@VojtechBartoska VojtechBartoska modified the milestones: 3.0.0, 3.0.0-RC1 Jan 30, 2024
@VojtechBartoska VojtechBartoska removed the Status: Awaiting triage Issue is waiting for triage label Jan 30, 2024
Copy link
Contributor

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "rebase eeprom lib and add partition":
    • summary looks empty
    • type/action looks empty
  • the commit message "remove deprecation readme.md":
    • summary looks empty
    • type/action looks empty

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

Messages
📖 You might consider squashing your 3 commits (simplifying branch history).

👋 Hello fedy0, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 739df62

@P-R-O-C-H-Y
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review needed Issue or PR is awaiting review
Projects
Development

Successfully merging this pull request may close these issues.

5 participants