Skip to content

Documentation Request for NVS and SETTINGS_NVS #52540

@kiafaldorius

Description

@kiafaldorius

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:

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions