-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cfg_page: provide/manage of configuration variables in flash #17092
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
added cfg_page_print added cfg_page_init_reader
…n correctly back up one byte before writing.
…oss the boundary between sectors
… cpd->writer if null
…slot swap, just allow the writer to loop once
…where the header gets initialized so that a single writer is used
mcr
requested review from
aabadie,
cgundogan,
fjmolinas,
jia200x,
leandrolanzieri,
MichelRottleuthner and
smlng
as code owners
November 1, 2021 00:59
github-actions
bot
added
Area: boards
Area: Board ports
Area: doc
Area: Documentation
Area: drivers
Area: Device drivers
Area: examples
Area: Example Applications
Area: Kconfig
Area: Kconfig integration
Area: tests
Area: tests and testing framework
Platform: native
Platform: This PR/issue effects the native platform
labels
Nov 1, 2021
miri64
changed the title
provide/manage of configuration variables in flash
cfg_page: provide/manage of configuration variables in flash
Nov 1, 2021
miri64
added
the
Type: new feature
The issue requests / The PR implemements a new feature for RIOT
label
Nov 1, 2021
Merged
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
stale
bot
added
the
State: stale
State: The issue / PR has no activity for >185 days
label
Jun 12, 2022
This (or an updated version) should work well on top of #18608 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: boards
Area: Board ports
Area: doc
Area: Documentation
Area: drivers
Area: Device drivers
Area: examples
Area: Example Applications
Area: Kconfig
Area: Kconfig integration
Area: tests
Area: tests and testing framework
Platform: native
Platform: This PR/issue effects the native platform
State: stale
State: The issue / PR has no activity for >185 days
Type: new feature
The issue requests / The PR implemements a new feature for RIOT
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
cfg_page is a driver that provides for an interface to store key/value pairs in flash.
It supports continuous updating of variables (such as is required for RPL lollipop counters). This is flash write efficient, and it does not overwrite flash, but rather appends to it in a log-like fashion. The last value is returned.
The keys and values are stored in CBOR format, with a 16-byte header that has a CRC and a revision.
Two "SECTOR"s are needed: when one is full the latest values are copied to the other page and that page is activated.
It is disappointing that the NAND flash interface provided by mtd* means that it is necessary to allocate RAM to read the variables in, and worse, causes the need for a second (4K) page when copying.
There are many opportunities for optimization: at this point many might be premature.
Testing procedure
The driver program tests/drivers_cfg_page is provided.
It uses the mtd_native interface to do testing on a host platform.
The testing process is to write three variables 256 times, and then print the results.
Issues/PRs references
None, but clarifications to mtd interface is desired.