-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
A new non volatile storage system #77930
base: main
Are you sure you want to change the base?
Conversation
There is no a ZMS User Documentation. |
Yes there is no Documentation yet as this could change a lot from its initial proposal. |
363962a
to
013a303
Compare
716277d
to
acdc1b8
Compare
tests/subsys/fs/zms/src/main.c
Outdated
#include <zephyr/sys/crc.h> | ||
#include "zms_priv.h" | ||
|
||
#define TEST_ZMS_FLASH_AREA storage_partition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope we can standardize on more open terms like NVM
instead of reiterating FLASH
for likely historical reasons. The addition of ZMS should not be tied to any specific type of non volatile memory technology...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, ZMS is not tied to any specific type of volatile or non volatile memory but as its name indicates (Zephyr Mempry Storage) it is for any Storage device.
In this case, tests are made to work on flash_simulator which is a flash.
I can change these defines by removing FLASH refrence (TEST_ZMS_FLASH_AREA => TEST_ZMS_AREA).
But the references to flash will still be there across the file because we are using flash_simulator and flash_api
List of added tests : - zms.test_delete - zms.test_zms_cache_collission - zms.test_zms_cache_gc - zms.test_zms_cache_hash_quality - zms.test_zms_cache_init - zms.test_zms_corrupted_sector_close_operation - zms.test_zms_corrupted_write - zms.test_zms_full_sector - zms.test_zms_gc - zms.test_zms_gc_3sectors - zms.test_zms_gc_corrupt_ate - zms.test_zms_gc_corrupt_close_ate - zms.test_zms_mount - zms.test_zms_write Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit 1f4e92c3da4b738d2dd203348d7a93f5ccdb5b99)
This adds a user application that shows the usage of ZMS The sample app shows three main functions of ZMS: - read/write/delete key/value pairs - fill all storage and delete it - calculate free remaining space Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit f8aaa1eaf15e6607b39c4e36911552a0a2410bc6)
ZMS is the abreviation of Zephyr Memory Storage. It is a storage developed to target especially the non erasable devices. The new memory storage system inherit from the NVS storage multiple features and introduce new ones : * Inherited features : - light key-value based storage - cache for entries - Wear Leveling of flash memory - Resilience to power failures * New features : - cycle counter for non erasable devices (instead of erase emulation) - Keys up to 32-bit - Built-in support of CRC32 for data - Small size data (<= 8 bytes) integrated within entries Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit 7bf5d179cc5d586fb3cf4564f92cea7b66b0e964)
List of added tests : - zms.test_delete - zms.test_zms_cache_collission - zms.test_zms_cache_gc - zms.test_zms_cache_hash_quality - zms.test_zms_cache_init - zms.test_zms_corrupted_sector_close_operation - zms.test_zms_corrupted_write - zms.test_zms_full_sector - zms.test_zms_gc - zms.test_zms_gc_3sectors - zms.test_zms_gc_corrupt_ate - zms.test_zms_gc_corrupt_close_ate - zms.test_zms_mount - zms.test_zms_write Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit 1f4e92c3da4b738d2dd203348d7a93f5ccdb5b99)
This adds a user application that shows the usage of ZMS The sample app shows three main functions of ZMS: - read/write/delete key/value pairs - fill all storage and delete it - calculate free remaining space Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit f8aaa1eaf15e6607b39c4e36911552a0a2410bc6)
@andrisk-dev there's a sample now in the PR that you can use. |
And it likely never will entirely, but it certainly seems to be welcome by several in the community that are facing the lack of a storage system that fulfills their requirements. Those requirements are not artificial, they have been collected by users that are having issues today with Zephyr and storage. So unless you are ready to propose an alternative that also fulfills those, I don't think blocking this PR is constructive at this point. |
@carlescufi, this is for more than 85% a copy of nvs. There shouldn't be two so equal systems in zephyr. Where will this stop? If someone creates a third option that fulfills their requirements, should this be accepted as well? And a fourth? The blocking is to ensure that zephyr is kept maintainable, if two solutions are so similar they should be integrated. I have given all constructive feedback to achieve this, also taking into account the existing install base. |
There is a huge disconnect between what you write here and the reality of the multiple attempts to enhance NVS that have stalled due to what seems to be a clear lack of either understanding or willingness to make it happen. The inability for others, multiple contributors, to improve NVS is a fact, and it doesn't look like it is going to change. If you want to keep Zephyr maintainable, then please review this new storage system when paired with the requirements and goals it was set out to fulfill, or propose your own solution that solves the problems that people have today when using Zephyr on different hardware and in different conditions.
Even if this was completely accurate, which I will leave @rghaddab to comment on, this is establishing the foundations for an advanced memory storage system that can be extended and improved over time. See the list of features that the author plans to include in the description of this PR. |
Again some false statements listed here.
ZMS and NVS are not equal. Each of them have different purposes and different requirements. Merging both of them will make both of them behave worse.
Please read the list of features that will be included in ZMS in the future commits before blocking this PR. About maintainability of two storage systems => that's not a problem as I will maintain this new storage system and I will keep it updated. Unless you want to remain the only maintainer of storage systems. Should there be a third, fourth or even a 10th storage system ? Why not ? As long as they serve a certain purpose and they are maintained by people that developed/used them. Do we have a limited number of maintainers/contributor in Zephyr for each subsystem ? I am not aware if such policy exists |
@Damian-Nordic, @de-nordic and @RICCIARDI-Adrien I added a sample code and fixed some corner cases bugs. |
@carlescufi many thanks for the update. I tried to build the example but the result was the same problem I had when I tried to modify NVS example to use ZMS:
I did the following to run the example:
Could there be some problem with the Kconfigs? Or is some configuration for the board also needed? Andrej |
This builds just fine for me: Can you try cleaning your Git folder ( Edit:
alternatively you can use GitHub's gh tool:
|
I think doing these commands west will create another zephyr folder under the zephyr folder that you checked out. (zephyr/zephyr/...) |
It can be:
The result:
|
@butok right, but those are warnings (@rghaddab can you please fix them) but not a Kconfig error like @andrisk-dev was reporting. |
I think you are right. So the problem was on my side. Sorry Andrej |
This adds a user application that shows the usage of ZMS The sample app shows three main functions of ZMS: - read/write/delete key/value pairs - fill all storage and delete it - calculate free remaining space Signed-off-by: Riadh Ghaddab <[email protected]>
These warnings are fixed now |
ZMS is the abreviation of Zephyr Memory Storage. It is a storage developed to target especially the non erasable devices. The new memory storage system inherit from the NVS storage multiple features and introduce new ones : * Inherited features : - light key-value based storage - cache for entries - Wear Leveling of flash memory - Resilience to power failures * New features : - cycle counter for non erasable devices (instead of erase emulation) - Keys up to 32-bit - Built-in support of CRC32 for data - Small size data (<= 8 bytes) integrated within entries Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit 7bf5d179cc5d586fb3cf4564f92cea7b66b0e964)
List of added tests : - zms.test_delete - zms.test_zms_cache_collission - zms.test_zms_cache_gc - zms.test_zms_cache_hash_quality - zms.test_zms_cache_init - zms.test_zms_corrupted_sector_close_operation - zms.test_zms_corrupted_write - zms.test_zms_full_sector - zms.test_zms_gc - zms.test_zms_gc_3sectors - zms.test_zms_gc_corrupt_ate - zms.test_zms_gc_corrupt_close_ate - zms.test_zms_mount - zms.test_zms_write Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit 1f4e92c3da4b738d2dd203348d7a93f5ccdb5b99)
This adds a user application that shows the usage of ZMS The sample app shows three main functions of ZMS: - read/write/delete key/value pairs - fill all storage and delete it - calculate free remaining space Upstream PR: zephyrproject-rtos/zephyr#77930 Signed-off-by: Riadh Ghaddab <[email protected]> (cherry picked from commit c479fadad817a84da18ea2f2e1873cebbd9c1f12)
Implements RFC #77929
This is the first Draft of a new storage system that is designed especially to work on non erasable devices but supports as well erasable devices.
It is intended that some features described in the RFC are not implemented yet to make it easier to review for contributors that are familiar with NVS filesystem.
Already included feature :
Features in progress: