Configuring settings module with NVS (nRF5340 Audio application)

Hi,

i need to store few configuration bytes in non volatile memory. I found out there is settings module that can be enabled in Kconfig GUI (SETTINGS option).

My use is very basic so it seems using file system is overkill and NVS should be the right choice.

I enable NVS option.

Than I think i should configure the settings module to use NVS but the option is not available.

This is what i see when i search for the option SETTINGS_NVS:

I also have some possibly related issues with not being able to enable CONFIG_BT_CTLR_PHY_CODED in the application, maybe it is related??

I than plan to use settings_load/settings_save api.

Is this the correct way to save application data and if yes how should I enable it correctly?

Thank You

  • Hi JeraDrson,

    Notice the bottom right window in when you try to enable SETTINGS_NVS. It says that there are two dependencies, CONFIG_NVS and CONFIG_FLASH_MAP, but it also notes that CONFIG_FLASH_MAP is not enabled now. You should be able to use CONFIG_SETTINGS_NVS after you enable CONFIG_FLASH_MAP.

    Your issue about CONFIG_BT_CTLR_PHY_CODED could also be related, in the sense that it's most likely also dependencies not satisfied.

    Hieu

  • Hi,

    When I enable the the FLASH_MAP i can enable it (although it looks bit strange in Kconfig GUI).

    However to enable FLASH_MAP i had to use TRANSPORT_CIS, but my application is audio broadcast so this is not correct.

  • Hi JeraDrson,

    Please look at the dependency closely. TRANSPORT_CIS isn't the only way to satisfy the dependency. It is also satisfied with just FLASH_HAS_DRIVER_ENABLED. On the nRF5340 Audio DK, the Devicetree is setup with a flash node, so the flash driver would have been loaded, and you will have FLASH_HAS_DRIVER_ENABLED just fine.

Related