Skip to content
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

backport: ZMS storage system and its backend for Settings #2542

Open
wants to merge 16 commits into
base: v3.7.99-ncs3-branch
Choose a base branch
from

Conversation

rghaddab
Copy link
Contributor

@rghaddab rghaddab commented Feb 21, 2025

Backport from tree the last changes for ZMS storage system and its backend for Settings

anangl and others added 13 commits February 21, 2025 09:49
This reverts commit f73e477.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 77ba3fc)
…ction"

This reverts commit 031c3c0.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit de9f681)
This reverts commit 509ec37.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 0c4f560)
…rage system"

This reverts commit 3af7f05.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit f93d0e1)
This reverts commit 98b2be4.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 75f6b03)
This reverts commit 1a10e62.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 9adc632)
…emory Storage)"

This reverts commit 8ed9b80.

Signed-off-by: Andrzej Głąbek <[email protected]>
(cherry picked from commit 60af425)
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

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit d4e246d)
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

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 004d6d6)
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]>
(cherry picked from commit fb7dae7)
This adds the documentation for the Zephyr Memory Storage system.

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 3c4fcaa)
This resolves some addressed comments in this PR
zephyrproject-rtos/zephyr#77930

It adds as well a section in the documentation about some
recommendations to increase ZMS performance.

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 46e1635)
Add myself "rghaddab" as maintainer to the ZMS storage system as I am
the author of this new storage solution

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit 6cc28c7)
@rghaddab rghaddab force-pushed the rghaddab/backport-zms-backend branch from 5793e25 to 1bd7c4a Compare February 21, 2025 09:30
tomi-font and others added 3 commits February 21, 2025 11:14
Use %zu for size_t.

Signed-off-by: Tomi Fontanilles <[email protected]>
(cherry picked from commit 9ef6788)
…eads

when performing a write ZMS checks if the data exists in the storage to
avoid double writing the same data and save some memory cycle life time.
However this downgrades the write performance.
Enable this feature only when CONFIG_ZMS_NO_DOUBLE_WRITE is enabled.

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit e0f0256)
…orage)

This adds the initial backend support for the ZMS storage system.

Signed-off-by: Riadh Ghaddab <[email protected]>
(cherry picked from commit ef4e8dd5c3f8186ab62d28d92bd3f31ddefade61)
@rghaddab rghaddab force-pushed the rghaddab/backport-zms-backend branch from 1bd7c4a to 0d5ef10 Compare February 21, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants