-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Description
Is your enhancement proposal related to a problem? Please describe.
It's my understanding of the settings_nvs.c and its usage of NVS_NAMECNT_ID
and NVS_NAME_ID_OFFSET
that the settings will only use NVS key indexes from NVS_NAMECNT_ID
up to NVS_NAMECNT_ID + (NVS_NAME_ID_OFFSET * 2)
.
This means key indexes below NVS_NAMECNT_ID
and above NVS_NAMECNT_ID + (NVS_NAME_ID_OFFSET * 2)
(as long as it's not maxed out) are available for userspace application usage.
Describe the solution you'd like
If my assessment above is correct, can we add some documentation to:
- The NVS page https://docs.zephyrproject.org/latest/services/storage/nvs/nvs.html to mention this
- Additional help text to the SETTINGS_NVS KConfig https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SETTINGS_NVS
Being able to reuse the default board storage dts entry for both userspace and settings is very useful. This lets developers avoid having to split flash space into an NVS partition for application data and another for settings data. Having this larger single partition could help with wear-leveling also.
A few lines of documentation can save quite a bit of developer headache and time trying to figure this out themselves.
This is especially important since I believe Zephyr is shifting to NVS as the default storage backend.
Describe alternatives you've considered
I have not considered any alternatives to not documenting this. I don't see the harm in adding a few lines of documentation, unless of course, my initial assessment is wrong. We obviously should not add incorrect implementation details to the documentation.