-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
applications: nrf_desktop: Switch to ZMS for RRAM-based devices #17932
Conversation
CI InformationTo view the history of this post, clich the 'edited' button above Inputs:Sources:sdk-nrf: PR head: c98b2a25af6a12a97c1ac9a2c66e0d533ed4e3e5 more detailssdk-nrf:
Github labels
List of changed files detected by CI (1)
Outputs:ToolchainVersion: 3dd8985b56 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
applications/nrf_desktop/src/modules/Kconfig.caf_settings_loader.default
Outdated
Show resolved
Hide resolved
applications/nrf_desktop/src/modules/Kconfig.caf_settings_loader.default
Show resolved
Hide resolved
applications/nrf_desktop/src/modules/Kconfig.caf_settings_loader.default
Outdated
Show resolved
Hide resolved
5d8ac18
to
a3a261b
Compare
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
applications/nrf_desktop/src/modules/Kconfig.caf_settings_loader.default
Outdated
Show resolved
Hide resolved
applications/nrf_desktop/src/modules/Kconfig.caf_settings_loader.default
Outdated
Show resolved
Hide resolved
a3a261b
to
7cb4475
Compare
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.
Looking good, eventual fine-tuning of ZMS can be done in follow-up PR
@nrfconnect/ncs-co-build-system please review |
choice DESKTOP_SETTINGS_BACKEND | ||
prompt "Settings backend" | ||
default DESKTOP_SETTINGS_BACKEND_ZMS if SOC_FLASH_NRF_RRAM | ||
default DESKTOP_SETTINGS_BACKEND_NVS | ||
help | ||
By default, nRF Desktop application, depending on the non-volatile | ||
memory technology used by the device, uses either the Zephyr Memory | ||
Storage (ZMS) or Non-Volatile Storage (NVS) settings backend. | ||
ZMS is used for the devices with the RRAM non-volatile memory that | ||
do not require explicit erase. Otherwise, the NVS is used. | ||
|
||
config DESKTOP_SETTINGS_BACKEND_ZMS | ||
bool "Zephyr Memory Storage (ZMS) settings backend" | ||
select ZMS | ||
help | ||
This option enables the Zephyr Memory Storage (ZMS) as the settings | ||
backend for the nRF Desktop application. | ||
|
||
config DESKTOP_SETTINGS_BACKEND_NVS | ||
bool "Non-Volatile Storage (NVS) settings backend" | ||
select NVS | ||
help | ||
This option enables the Non-Volatile Storage (NVS) as the settings | ||
backend for the nRF Desktop application. | ||
|
||
endchoice |
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.
why do you need this, just imply in the above, if someone wants to change because of external flash then they can change from SETTINGS_ZMS to SETTINGS_NVS, this choice adds nothing
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.
FYI @MarekPieta
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 agree this could be simplified. We can skip configuring SETTINGS_BACKEND
below as this is autoselected based on FS.
Then you could remove DESKTOP_SETTINGS_BACKEND
altogether and simply add
config DESKTOP_SETTINGS_LOADER
imply ZMS if SOC_FLASH_NRF_RRAM
imply NVS
just check if the end values are correct
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 am worried it might lead to problems if multiple filesystem support is enabled in configuration. E.g. enabling ZMS for any purpose other than settings would silently change the used settings backend - probably not expected. That's why I suggested to make configuration more explicit here.
Can we keep it because of that?
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.
No, the correct backend would be on if SETTINGS_NVS
or SETTINGS_ZMS
is used, this configuration option is completely pointless, it just mirrors another one adding nothing
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.
Keep in mind that FS might be also used "as is" for any purpose (i.e. not as settings backend). The approach currently presented in the PR should ensure correct handling of case with multiple filesystems too. Maybe we can stick with it for now?
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.
Keep in mind that FS might be also used "as is" for any purpose (i.e. not as settings backend).
Then you wouldn't enable SETTINGS_NVS
or SETTINGS_ZMS
, I'm not really sure why this discussion is still going on
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.
Keep in mind that FS might be also used "as is" for any purpose (i.e. not as settings backend).
Then you wouldn't enable
SETTINGS_NVS
orSETTINGS_ZMS
, I'm not really sure why this discussion is still going on
You actually would if you have one FS used for settings and another for provisioning. I think fast pair case has two storage partitions.
I expect the problem would be if these are handled using two different FSs. Likely not the use case at the moment.
Note that this should be owners and maintainers call of this code to make the decision. If @MarekPieta believes this is the best path forward, let's keep it as is. The code is not wrong and indeed there is no point in arguing.
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.
You might use file system "B" (for an application-specific purpose) next to the Zephyr settings using a file system "A". No one forbids enabling multiple file systems for various non-volatile memories (even though IIRC we currently do not support multiple settings instances). That's why I suggested to add the application-specific Kconfig option that ensures no side effects here.
Still, if you insist we will remove the application-specific Kconfigs and stick to the configuration that relies only on implies (and has a potential side effect).
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.
Applied @nordicjm suggestion to switch to implies as the current application-specific Kconfig would not be accepted.
7cb4475
to
42528ac
Compare
Switched to using the Zephyr Memory Storage (ZMS) instead of Non-Volatile Storage (NVS) for all devices that uses the RRAM non-volatile memory (currently only the nRF54L15). Jira: NCSDK-29634 Signed-off-by: Mateusz Kapala <[email protected]>
42528ac
to
c98b2a2
Compare
Rebased |
Switched to using the Zephyr Memory Storage (ZMS) instead of Non-Volatile Storage (NVS) for all devices that uses the RRAM non-volatile memory (currently only the nRF54L15).
Jira: NCSDK-29634