firmware/sys/storage: Re-modification of storage module #359
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
Read and write dynamically, writing in blocks, to write and read data from mtd_storage. This will remove the old model of storage using mtd_flashpages. Here is presented an distribution using
mtd_addresses
, to knows where is theMTD_START_ADDR
you should know the size of allowed flashpages to save data as an Non volatile memory or EEPROM. TheMTD_LAST_ADDR
refers to the address in theLAST_AVAILABLE_PAGE
to write and read data. Theaddt
parameter allows move dynamically in themtd_storage
. Wherever address between theMTD_START_ADDR
andMTD_LAST_ADDR
will be available to write and read data. The save and write data is protected to overwrite data a specific positioned data, This won´t erase the previous data to that position. So it's necessary clear or remove all flash mtd_data saved.Testing procedure
First activate
DEBUG
intest/storage/main.c
Expected Output
Issues/PRs references