diff --git a/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst b/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst index b6c957e7ed36..51a1d7ca1118 100644 --- a/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst +++ b/doc/nrf/protocols/matter/getting_started/advanced_kconfigs.rst @@ -183,15 +183,15 @@ To enable one of the reactions to the last fabric removal, set the corresponding * :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT` - Remove all saved network credentials and reboot the device. This option is selected by default. - When the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_NVS` Kconfig option is also set to ``y``, the device will also remove all non-volatile data stored on the device, including application-specific entries. + When the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` Kconfig option is also set to ``y``, the device will also remove all non-volatile data stored on the device, including application-specific entries. This means the device is restored to the factory settings. To create a delay between the chosen reaction and the last fabric being removed, set the :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY` Kconfig option to a specific time in milliseconds. By default this Kconfig option is set to 1 second. .. note:: - The :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_NVS` Kconfig option is set to ``y`` by default. - To disable removing application-specific non-volatile data when the :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT` Kconfig option is selected, set the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_NVS` Kconfig option to ``n``. + The :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` Kconfig option is set to ``y`` by default. + To disable removing application-specific non-volatile data when the :kconfig:option:`CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT` Kconfig option is selected, set the :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS` Kconfig option to ``n``. .. _ug_matter_configuring_read_client: diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index b9cde3195264..7cf37ccd9636 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -191,8 +191,13 @@ Matter * The :ref:`ug_matter_device_memory_profiling` section to the :ref:`ug_matter_device_optimizing_memory` page. The section contains useful commands for measuring memory and troubleshooting tips. + * The ZMS file subsystem to all devices that contain RRAM, such as the nRF54L Series devices. -* Changed the default Trusted Storage AEAD key to Hardware Unique Key (HUK) for supported nRF54L Series devices. +* Changed: + + * The default Trusted Storage AEAD key to Hardware Unique Key (HUK) for supported nRF54L Series devices. + * Renamed the ``CONFIG_CHIP_FACTORY_RESET_ERASE_NVS`` Kconfig option to :kconfig:option:`CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS`. + The new Kconfig option now works for both NVS and ZMS file system backends. Matter fork +++++++++++ diff --git a/include/flash_map_pm.h b/include/flash_map_pm.h index 4232f646ccff..baa5cfdb7476 100644 --- a/include/flash_map_pm.h +++ b/include/flash_map_pm.h @@ -29,7 +29,8 @@ #define image_scratch mcuboot_scratch #define image_scratch mcuboot_scratch -#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS || defined(PM_SETTINGS_STORAGE_ID)) +#if (CONFIG_SETTINGS_FCB || CONFIG_SETTINGS_NVS || defined(PM_SETTINGS_STORAGE_ID) ||\ + CONFIG_SETTINGS_ZMS) #define storage settings_storage #define storage_partition settings_storage #elif CONFIG_FILE_SYSTEM_LITTLEFS @@ -38,6 +39,9 @@ #elif CONFIG_NVS #define storage nvs_storage #define storage_partition nvs_storage +#elif CONFIG_ZMS +#define storage zms_storage +#define storage_partition zms_storage #endif #define PM_ID(label) PM_##label##_ID diff --git a/samples/bluetooth/central_and_peripheral_hr/Kconfig b/samples/bluetooth/central_and_peripheral_hr/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_and_peripheral_hr/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_and_peripheral_hr/prj.conf b/samples/bluetooth/central_and_peripheral_hr/prj.conf index 1b40906651a8..f1aeaba65e5c 100644 --- a/samples/bluetooth/central_and_peripheral_hr/prj.conf +++ b/samples/bluetooth/central_and_peripheral_hr/prj.conf @@ -31,8 +31,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_HEAP_MEM_POOL_SIZE=1024 diff --git a/samples/bluetooth/central_bas/Kconfig b/samples/bluetooth/central_bas/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_bas/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_bas/prj.conf b/samples/bluetooth/central_bas/prj.conf index eb0d3394336c..3deae57b598a 100644 --- a/samples/bluetooth/central_bas/prj.conf +++ b/samples/bluetooth/central_bas/prj.conf @@ -22,7 +22,5 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/central_hids/Kconfig b/samples/bluetooth/central_hids/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_hids/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_hids/prj.conf b/samples/bluetooth/central_hids/prj.conf index fbf6615f2c78..11feb1bae423 100644 --- a/samples/bluetooth/central_hids/prj.conf +++ b/samples/bluetooth/central_hids/prj.conf @@ -25,7 +25,5 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/central_nfc_pairing/Kconfig b/samples/bluetooth/central_nfc_pairing/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_nfc_pairing/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_nfc_pairing/prj.conf b/samples/bluetooth/central_nfc_pairing/prj.conf index 49abce0c2d8b..f8a095497e1a 100644 --- a/samples/bluetooth/central_nfc_pairing/prj.conf +++ b/samples/bluetooth/central_nfc_pairing/prj.conf @@ -57,8 +57,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Config logger CONFIG_LOG=y diff --git a/samples/bluetooth/central_uart/Kconfig b/samples/bluetooth/central_uart/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/central_uart/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/central_uart/prj.conf b/samples/bluetooth/central_uart/prj.conf index e7c8a2549b67..3a93cc882c27 100644 --- a/samples/bluetooth/central_uart/prj.conf +++ b/samples/bluetooth/central_uart/prj.conf @@ -34,8 +34,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Config logger CONFIG_LOG=y diff --git a/samples/bluetooth/enocean/Kconfig b/samples/bluetooth/enocean/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/enocean/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/enocean/prj.conf b/samples/bluetooth/enocean/prj.conf index 91a02a14ea5e..4cde6e557342 100644 --- a/samples/bluetooth/enocean/prj.conf +++ b/samples/bluetooth/enocean/prj.conf @@ -8,8 +8,6 @@ CONFIG_NCS_SAMPLES_DEFAULTS=y # General configuration CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_SETTINGS=y -CONFIG_NVS=y CONFIG_DK_LIBRARY=y # Bluetooth configuration diff --git a/samples/bluetooth/fast_pair/input_device/Kconfig b/samples/bluetooth/fast_pair/input_device/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/fast_pair/input_device/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/fast_pair/input_device/prj.conf b/samples/bluetooth/fast_pair/input_device/prj.conf index 85828aaa57db..e31f9d9c0f9e 100644 --- a/samples/bluetooth/fast_pair/input_device/prj.conf +++ b/samples/bluetooth/fast_pair/input_device/prj.conf @@ -14,9 +14,6 @@ CONFIG_DK_LIBRARY=y # Enable settings to store data in non-volatile memory CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y CONFIG_BT=y diff --git a/samples/bluetooth/fast_pair/locator_tag/Kconfig b/samples/bluetooth/fast_pair/locator_tag/Kconfig index beeb05dce424..ad61ef9e8494 100644 --- a/samples/bluetooth/fast_pair/locator_tag/Kconfig +++ b/samples/bluetooth/fast_pair/locator_tag/Kconfig @@ -23,6 +23,15 @@ rsource "src/Kconfig.dfu" rsource "src/ui/Kconfig.ui" rsource "src/battery/Kconfig.battery" +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu source "Kconfig.zephyr" diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf b/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf index 79ef6f8ffe0a..a193d020378e 100644 --- a/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf @@ -20,9 +20,6 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Enable settings to store data in non-volatile memory CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y CONFIG_BT=y diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf b/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf index b0486af2d8fa..c83bc30dc524 100644 --- a/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf @@ -32,9 +32,6 @@ CONFIG_SETTINGS_DYNAMIC_HANDLERS=n # Enable settings to store data in non-volatile memory CONFIG_FLASH=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y CONFIG_BT=y diff --git a/samples/bluetooth/peripheral_ams_client/Kconfig b/samples/bluetooth/peripheral_ams_client/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_ams_client/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_ams_client/prj.conf b/samples/bluetooth/peripheral_ams_client/prj.conf index 7fb314f3256f..48a507c12d3f 100644 --- a/samples/bluetooth/peripheral_ams_client/prj.conf +++ b/samples/bluetooth/peripheral_ams_client/prj.conf @@ -22,8 +22,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_ancs_client/Kconfig b/samples/bluetooth/peripheral_ancs_client/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_ancs_client/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_ancs_client/prj.conf b/samples/bluetooth/peripheral_ancs_client/prj.conf index b0fb0f0daeab..8b4dafba9e5d 100644 --- a/samples/bluetooth/peripheral_ancs_client/prj.conf +++ b/samples/bluetooth/peripheral_ancs_client/prj.conf @@ -25,8 +25,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_bms/Kconfig b/samples/bluetooth/peripheral_bms/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_bms/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_bms/prj.conf b/samples/bluetooth/peripheral_bms/prj.conf index 411923400a0d..3be4aafc12b5 100644 --- a/samples/bluetooth/peripheral_bms/prj.conf +++ b/samples/bluetooth/peripheral_bms/prj.conf @@ -22,5 +22,3 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y diff --git a/samples/bluetooth/peripheral_cgms/Kconfig b/samples/bluetooth/peripheral_cgms/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_cgms/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_cgms/prj.conf b/samples/bluetooth/peripheral_cgms/prj.conf index 5157954b59f2..9502757520ff 100644 --- a/samples/bluetooth/peripheral_cgms/prj.conf +++ b/samples/bluetooth/peripheral_cgms/prj.conf @@ -14,8 +14,6 @@ CONFIG_BT_DEVICE_NAME="Nordic Glucose Sensor" CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_BT_SETTINGS=y # CGMS Specific options diff --git a/samples/bluetooth/peripheral_cts_client/Kconfig b/samples/bluetooth/peripheral_cts_client/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_cts_client/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_cts_client/prj.conf b/samples/bluetooth/peripheral_cts_client/prj.conf index 19bacac2fb53..afa4c300641d 100644 --- a/samples/bluetooth/peripheral_cts_client/prj.conf +++ b/samples/bluetooth/peripheral_cts_client/prj.conf @@ -22,8 +22,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_hids_keyboard/Kconfig b/samples/bluetooth/peripheral_hids_keyboard/Kconfig index 9cd47775b48d..2d5d2f19b084 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/Kconfig +++ b/samples/bluetooth/peripheral_hids_keyboard/Kconfig @@ -18,4 +18,13 @@ config NFC_OOB_PAIRING select NFC_NDEF_RECORD select NFC_NDEF_LE_OOB_REC +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu diff --git a/samples/bluetooth/peripheral_hids_keyboard/prj.conf b/samples/bluetooth/peripheral_hids_keyboard/prj.conf index 793480463329..57b7f262e227 100644 --- a/samples/bluetooth/peripheral_hids_keyboard/prj.conf +++ b/samples/bluetooth/peripheral_hids_keyboard/prj.conf @@ -37,7 +37,5 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_hids_mouse/Kconfig b/samples/bluetooth/peripheral_hids_mouse/Kconfig index 473690e516d9..f94d2470e5e3 100644 --- a/samples/bluetooth/peripheral_hids_mouse/Kconfig +++ b/samples/bluetooth/peripheral_hids_mouse/Kconfig @@ -16,7 +16,8 @@ config BT_HIDS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help "Enable BLE security for the HIDS service" diff --git a/samples/bluetooth/peripheral_lbs/Kconfig b/samples/bluetooth/peripheral_lbs/Kconfig index 96645f78f7b5..8ba880adf79a 100644 --- a/samples/bluetooth/peripheral_lbs/Kconfig +++ b/samples/bluetooth/peripheral_lbs/Kconfig @@ -16,7 +16,8 @@ config BT_LBS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help "Enable BLE security for the LED-Button service" diff --git a/samples/bluetooth/peripheral_mds/Kconfig b/samples/bluetooth/peripheral_mds/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/peripheral_mds/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/peripheral_mds/prj.conf b/samples/bluetooth/peripheral_mds/prj.conf index e4cbed98f614..1fe1b9d3601b 100644 --- a/samples/bluetooth/peripheral_mds/prj.conf +++ b/samples/bluetooth/peripheral_mds/prj.conf @@ -48,8 +48,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # This example requires more stack CONFIG_MAIN_STACK_SIZE=1152 diff --git a/samples/bluetooth/peripheral_nfc_pairing/Kconfig b/samples/bluetooth/peripheral_nfc_pairing/Kconfig index e209575fb41f..9f3667e7f713 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/Kconfig +++ b/samples/bluetooth/peripheral_nfc_pairing/Kconfig @@ -30,6 +30,15 @@ config NFC_TAG_CH_REQUESTER endchoice +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu menu "Zephyr Kernel" diff --git a/samples/bluetooth/peripheral_nfc_pairing/prj.conf b/samples/bluetooth/peripheral_nfc_pairing/prj.conf index dca07cc98114..3c8ddccfec47 100644 --- a/samples/bluetooth/peripheral_nfc_pairing/prj.conf +++ b/samples/bluetooth/peripheral_nfc_pairing/prj.conf @@ -43,8 +43,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_power_profiling/Kconfig b/samples/bluetooth/peripheral_power_profiling/Kconfig index f26dee120fed..7247914aae7e 100644 --- a/samples/bluetooth/peripheral_power_profiling/Kconfig +++ b/samples/bluetooth/peripheral_power_profiling/Kconfig @@ -71,4 +71,13 @@ config BT_POWER_PROFILING_NON_CONNECTABLE_ADV_INTERVAL_MAX help Non-connectable advertising maximum interval in 0.625 milliseconds unit. +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu diff --git a/samples/bluetooth/peripheral_power_profiling/prj.conf b/samples/bluetooth/peripheral_power_profiling/prj.conf index 1a56a24ce496..bbca11cdb8e5 100644 --- a/samples/bluetooth/peripheral_power_profiling/prj.conf +++ b/samples/bluetooth/peripheral_power_profiling/prj.conf @@ -29,8 +29,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_POWEROFF=y diff --git a/samples/bluetooth/peripheral_rscs/Kconfig b/samples/bluetooth/peripheral_rscs/Kconfig index 76214afcc6fc..c6bb851c2fd8 100644 --- a/samples/bluetooth/peripheral_rscs/Kconfig +++ b/samples/bluetooth/peripheral_rscs/Kconfig @@ -16,7 +16,8 @@ config BT_RSCS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help "Enable Bluetooth LE security for the Running Speed and Cadence Service" diff --git a/samples/bluetooth/peripheral_status/Kconfig b/samples/bluetooth/peripheral_status/Kconfig index c9090a30b9d4..06704d337094 100644 --- a/samples/bluetooth/peripheral_status/Kconfig +++ b/samples/bluetooth/peripheral_status/Kconfig @@ -16,7 +16,8 @@ config BT_STATUS_SECURITY_ENABLED select FLASH select FLASH_PAGE_LAYOUT select FLASH_MAP - select NVS + select ZMS if SOC_FLASH_NRF_RRAM + select NVS if !SOC_FLASH_NRF_RRAM select SETTINGS help Enable BLE security implementation for Nordic Status Message instances. diff --git a/samples/bluetooth/peripheral_uart/Kconfig b/samples/bluetooth/peripheral_uart/Kconfig index 4a87afb828b6..a6da8c39ce34 100644 --- a/samples/bluetooth/peripheral_uart/Kconfig +++ b/samples/bluetooth/peripheral_uart/Kconfig @@ -33,4 +33,13 @@ config BT_NUS_UART_RX_WAIT_TIME help Wait for RX complete event time in microseconds +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM + endmenu diff --git a/samples/bluetooth/peripheral_uart/prj.conf b/samples/bluetooth/peripheral_uart/prj.conf index 25deae6ec73a..29f93eb2546c 100644 --- a/samples/bluetooth/peripheral_uart/prj.conf +++ b/samples/bluetooth/peripheral_uart/prj.conf @@ -31,8 +31,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/peripheral_uart/prj_minimal.conf b/samples/bluetooth/peripheral_uart/prj_minimal.conf index b88497414f76..d31653ac666b 100644 --- a/samples/bluetooth/peripheral_uart/prj_minimal.conf +++ b/samples/bluetooth/peripheral_uart/prj_minimal.conf @@ -26,8 +26,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y diff --git a/samples/bluetooth/rpc_host/Kconfig b/samples/bluetooth/rpc_host/Kconfig new file mode 100644 index 000000000000..587856d89b2b --- /dev/null +++ b/samples/bluetooth/rpc_host/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "Kconfig.zephyr" + +config SETTINGS + default y + +config ZMS + default y if SOC_FLASH_NRF_RRAM + +config NVS + default y if !SOC_FLASH_NRF_RRAM diff --git a/samples/bluetooth/rpc_host/prj.conf b/samples/bluetooth/rpc_host/prj.conf index 3025f10bf42f..52565aa48def 100644 --- a/samples/bluetooth/rpc_host/prj.conf +++ b/samples/bluetooth/rpc_host/prj.conf @@ -23,8 +23,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y -CONFIG_SETTINGS=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096 CONFIG_HEAP_MEM_POOL_SIZE=4096 diff --git a/samples/matter/common/src/Kconfig b/samples/matter/common/src/Kconfig index 04cc2f1e7d55..e711b57594a7 100644 --- a/samples/matter/common/src/Kconfig +++ b/samples/matter/common/src/Kconfig @@ -44,7 +44,7 @@ config NCS_SAMPLE_MATTER_SETTINGS_SHELL bool "Settings shell for Matter purposes" default y if CHIP_MEMORY_PROFILING depends on SHELL - depends on NVS + depends on NVS || ZMS help Allows using matter_settings shell commands. You can use the following commands: diff --git a/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp b/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp index f5d819ab8b9e..66a192d15dd1 100644 --- a/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp +++ b/samples/matter/common/src/persistent_storage/persistent_storage_shell.cpp @@ -6,7 +6,11 @@ #include "persistent_storage_shell.h" +#ifdef CONFIG_NVS #include +#elif CONFIG_ZMS +#include +#endif #include #include @@ -14,13 +18,27 @@ using namespace Nrf; namespace { -nvs_fs *sNvsStorage = nullptr; +#ifdef CONFIG_NVS +nvs_fs *sStorage = nullptr; +#elif CONFIG_ZMS +zms_fs *sStorage = nullptr; +#endif + size_t sPeakSize = 0; struct SettingsParams { const struct shell *shell; }; +int CalculateFreeSpace() +{ +#ifdef CONFIG_NVS + return nvs_calc_free_space(sStorage); +#elif CONFIG_ZMS + return zms_calc_free_space(sStorage); +#endif +} + int SettingsReadClb(const char *key, size_t len, settings_read_cb read_cb, void *cb_arg, void *param) { uint8_t buffer[SETTINGS_MAX_VAL_LEN]; @@ -41,13 +59,12 @@ int SettingsReadClb(const char *key, size_t len, settings_read_cb read_cb, void int PeakHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } - size_t maxSize = sNvsStorage->sector_size * sNvsStorage->sector_count; - size_t freeSpace = nvs_calc_free_space(sNvsStorage); - + size_t maxSize = sStorage->sector_size * sStorage->sector_count; + size_t freeSpace = CalculateFreeSpace(); size_t currentPeak = maxSize - freeSpace; if (currentPeak > sPeakSize) { @@ -68,7 +85,7 @@ int ResetHandler(const struct shell *shell, size_t argc, char **argv) int GetSizeHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } @@ -81,12 +98,12 @@ int GetSizeHandler(const struct shell *shell, size_t argc, char **argv) int CurrentHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } - size_t maxSize = sNvsStorage->sector_size * sNvsStorage->sector_count; - size_t freeSpace = nvs_calc_free_space(sNvsStorage); + size_t maxSize = sStorage->sector_size * sStorage->sector_count; + size_t freeSpace = CalculateFreeSpace(); shell_fprintf(shell, SHELL_NORMAL, "%zu\n", maxSize - freeSpace); @@ -95,11 +112,11 @@ int CurrentHandler(const struct shell *shell, size_t argc, char **argv) int FreeHandler(const struct shell *shell, size_t argc, char **argv) { - if (!sNvsStorage) { + if (!sStorage) { return -ENODEV; } - size_t freeSpace = nvs_calc_free_space(sNvsStorage); + size_t freeSpace = CalculateFreeSpace(); shell_fprintf(shell, SHELL_NORMAL, "%zu\n", freeSpace); @@ -116,7 +133,11 @@ bool PersistentStorageShell::Init() return false; } - sNvsStorage = reinterpret_cast(storage); +#ifdef CONFIG_NVS + sStorage = reinterpret_cast(storage); +#elif CONFIG_ZMS + sStorage = reinterpret_cast(storage); +#endif return true; } diff --git a/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 792f30a21fbd..cccb8cde877b 100644 --- a/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/light_bulb/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,5 +12,5 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/light_bulb/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/light_switch/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/light_switch/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/lock/Kconfig b/samples/matter/lock/Kconfig index c4779310e9ab..404e519792b6 100644 --- a/samples/matter/lock/Kconfig +++ b/samples/matter/lock/Kconfig @@ -91,7 +91,7 @@ config THREAD_WIFI_SWITCHING depends on SOC_SERIES_NRF53X depends on NET_L2_OPENTHREAD depends on CHIP_WIFI - depends on !CHIP_FACTORY_RESET_ERASE_NVS + depends on !CHIP_FACTORY_RESET_ERASE_SETTINGS select EXPERIMENTAL help Build the application with both Thread and Wi-Fi support and initialize diff --git a/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/lock/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/lock/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/lock/prj_thread_wifi_switched.conf b/samples/matter/lock/prj_thread_wifi_switched.conf index 5b4d8c6ec7fd..54c1daead59b 100644 --- a/samples/matter/lock/prj_thread_wifi_switched.conf +++ b/samples/matter/lock/prj_thread_wifi_switched.conf @@ -34,7 +34,7 @@ CONFIG_THREAD_WIFI_SWITCHING=y CONFIG_THREAD_WIFI_SWITCHING_SHELL=y CONFIG_CHIP_WIFI=y CONFIG_NET_L2_OPENTHREAD=y -CONFIG_CHIP_FACTORY_RESET_ERASE_NVS=n # Do not restore initial transport on factory reset +CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS=n # Do not restore initial transport on factory reset # Reduce application size CONFIG_USE_SEGGER_RTT=n diff --git a/samples/matter/lock/src/access/access_storage.cpp b/samples/matter/lock/src/access/access_storage.cpp index 61ad72d64405..2bb2fdc3305e 100644 --- a/samples/matter/lock/src/access/access_storage.cpp +++ b/samples/matter/lock/src/access/access_storage.cpp @@ -11,7 +11,11 @@ #include #ifdef CONFIG_LOCK_PRINT_STORAGE_STATUS +#ifdef CONFIG_NVS #include +#elif CONFIG_ZMS +#include +#endif /* CONFIG_NVS */ #include #include @@ -27,11 +31,15 @@ bool GetStorageFreeSpace(size_t &freeBytes) LOG_ERR("AccessStorage: Cannot read NVS free space [error: %d]", status); return false; } +#ifdef CONFIG_NVS freeBytes = nvs_calc_free_space(static_cast(storage)); +#elif CONFIG_ZMS + freeBytes = zms_calc_free_space(static_cast(storage)); +#endif /* NVS */ return true; } } /* namespace */ -#endif +#endif /* CONFIG_LOCK_PRINT_STORAGE_STATUS */ /* Currently the secure storage is available only for non-Wi-Fi builds, because NCS Wi-Fi implementation does not support PSA API yet. */ diff --git a/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/smoke_co_alarm/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 792f30a21fbd..cccb8cde877b 100644 --- a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,5 +12,5 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf index 70931958b619..e2d1a570134f 100644 --- a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf +++ b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 44 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=11 +# Set the ZMS sector count to match the settings partition size that is 44 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=11 # Disable SPI CONFIG_CHIP_SPI_NOR=n diff --git a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf index 86b46bc3af4e..d9673cc89769 100644 --- a/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/template/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf @@ -17,5 +17,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 792f30a21fbd..cccb8cde877b 100644 --- a/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/thermostat/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,5 +12,5 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/thermostat/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf index a891a583a1d7..5f3388a91552 100644 --- a/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/matter/window_covering/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -12,8 +12,8 @@ CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 CONFIG_CHIP_TASK_STACK_SIZE=7168 -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # Low Power mode CONFIG_POWEROFF=y diff --git a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf index be1a6a76be76..facc5415b309 100644 --- a/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf +++ b/samples/matter/window_covering/boards/nrf54l15pdk_nrf54l15_cpuapp_ns.conf @@ -20,5 +20,5 @@ CONFIG_MPSL_WORK_STACK_SIZE=2048 # Enable DAC key migration by default for ns build CONFIG_CHIP_CRYPTO_PSA_MIGRATE_DAC_PRIV_KEY=y -# Set the NVS sector count to match the settings partition size that is 40 kB for this application. -CONFIG_SETTINGS_NVS_SECTOR_COUNT=10 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 diff --git a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf index b64e3785e2d9..f6cb57237eea 100644 --- a/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/openthread/cli/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -11,3 +11,9 @@ CONFIG_NRFX_UARTE0=n # while using CRACEN CONFIG_MAIN_STACK_SIZE=6144 CONFIG_SHELL_STACK_SIZE=5120 + +# Workaround required as Zephyr L2 implies usage of NVS backend for settings. +# It should be removed once the proper fix will be applied in Zephyr. +CONFIG_NVS=n +CONFIG_ZMS=y +CONFIG_SETTINGS_ZMS=y diff --git a/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf b/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf index 051efff8b4db..f4a72c04dba7 100644 --- a/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf +++ b/samples/openthread/coprocessor/boards/nrf54l15dk_nrf54l15_cpuapp.conf @@ -6,3 +6,9 @@ CONFIG_FPU=n CONFIG_SPI_NOR=n + +# Workaround required as Zephyr L2 implies usage of NVS backend for settings. +# It should be removed once the proper fix will be applied in Zephyr. +CONFIG_NVS=n +CONFIG_ZMS=y +CONFIG_SETTINGS_ZMS=y diff --git a/subsys/net/CMakeLists.txt b/subsys/net/CMakeLists.txt index ec4625da2e11..6a52bf3c0599 100644 --- a/subsys/net/CMakeLists.txt +++ b/subsys/net/CMakeLists.txt @@ -8,3 +8,4 @@ add_subdirectory(lib) add_subdirectory_ifdef(CONFIG_OPENTHREAD_RPC openthread/rpc) add_subdirectory_ifdef(CONFIG_L2_WIFI_CONNECTIVITY l2_wifi_if_conn) add_subdirectory_ifdef(CONFIG_OPENTHREAD_REPORT openthread/report) +add_subdirectory_ifdef(CONFIG_NET_L2_OPENTHREAD openthread/settings_check) diff --git a/subsys/net/openthread/settings_check/CMakeLists.txt b/subsys/net/openthread/settings_check/CMakeLists.txt new file mode 100644 index 000000000000..289ff415bdd4 --- /dev/null +++ b/subsys/net/openthread/settings_check/CMakeLists.txt @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +# This script checks if NVS settings backend is used with nRF54L SoC target and prints +# the warning that the recommended backend is ZMS due to the RRAM design. + +if (CONFIG_SOC_SERIES_NRF54LX AND CONFIG_SETTINGS_NVS) + message(WARNING " ###################################################################################\n" + " # #\n" + " # Your application uses NVS backend for the settings storage that is not #\n" + " # optimal solution for the nRF54L SoC family and it may negatively impact #\n" + " # the non-volatile RRAM life-time. #\n" + " # #\n" + " # The recommended settings backend for nRF54L SoC family is ZMS. #\n" + " # You can enable it by selecting CONFIG_SETTINGS_ZMS=y and CONFIG_ZMS=y. #\n" + " # Please note that the other Kconfig options related to NVS like cache #\n" + " # or block size will require alignment on the ZMS side as well. #\n" + " # #\n" + " ###################################################################################\n") +endif() diff --git a/subsys/partition_manager/CMakeLists.txt b/subsys/partition_manager/CMakeLists.txt index 65d063e1347a..c69e54ca6962 100644 --- a/subsys/partition_manager/CMakeLists.txt +++ b/subsys/partition_manager/CMakeLists.txt @@ -60,7 +60,7 @@ if (CONFIG_BOARD_HAS_NRF5_BOOTLOADER) ncs_add_partition_manager_config(pm.yml.nrf5_mbr) endif() -if (CONFIG_SETTINGS_FCB OR CONFIG_SETTINGS_NVS) +if (CONFIG_SETTINGS_FCB OR CONFIG_SETTINGS_NVS OR CONFIG_SETTINGS_ZMS) ncs_add_partition_manager_config(pm.yml.settings) endif() @@ -76,6 +76,10 @@ if (CONFIG_NVS AND NOT CONFIG_SETTINGS_NVS) ncs_add_partition_manager_config(pm.yml.nvs) endif() +if (CONFIG_ZMS AND NOT CONFIG_SETTINGS_ZMS) + ncs_add_partition_manager_config(pm.yml.zms) +endif() + if (CONFIG_NRF_MODEM_LIB) ncs_add_partition_manager_config(pm.yml.libmodem) endif() diff --git a/subsys/partition_manager/Kconfig b/subsys/partition_manager/Kconfig index e71f0edd1dc6..8499886c3946 100644 --- a/subsys/partition_manager/Kconfig +++ b/subsys/partition_manager/Kconfig @@ -72,7 +72,7 @@ rsource "Kconfig.template.partition_region" endif -if SETTINGS_FCB || SETTINGS_NVS +if SETTINGS_FCB || SETTINGS_NVS || SETTINGS_ZMS partition=SETTINGS_STORAGE partition-size=0x2000 rsource "Kconfig.template.partition_config" @@ -94,6 +94,13 @@ rsource "Kconfig.template.partition_config" rsource "Kconfig.template.partition_region" endif +if ZMS && !SETTINGS_ZMS +partition=ZMS_STORAGE +partition-size=0x6000 +rsource "Kconfig.template.partition_config" +rsource "Kconfig.template.partition_region" +endif + if ZIGBEE && !SOC_NRF52833 partition=ZBOSS_NVRAM partition-size=0x8000 diff --git a/subsys/partition_manager/pm.yml.zms b/subsys/partition_manager/pm.yml.zms new file mode 100644 index 000000000000..43f475cba253 --- /dev/null +++ b/subsys/partition_manager/pm.yml.zms @@ -0,0 +1,33 @@ +#include + +# In nRF54L15 we place the TF-M non-secure storage partitions after the +# TF-M non-secure application to avoid splitting the secure/non-secure +# partitions more than necessary. +#if defined(CONFIG_SOC_NRF54L15_ENGA_CPUAPP) || defined(CONFIG_SOC_NRF54L15_CPUAPP) +zms_storage: + placement: + after: [app] + before: [end] +#ifdef CONFIG_PM_PARTITION_REGION_ZMS_STORAGE_EXTERNAL + region: external_flash +#else + inside: [nonsecure_storage] +#endif + size: CONFIG_PM_PARTITION_SIZE_ZMS_STORAGE + + +#else +zms_storage: + placement: + before: [tfm_storage, end] +#ifdef CONFIG_PM_PARTITION_REGION_ZMS_STORAGE_EXTERNAL + region: external_flash +#else +#ifdef CONFIG_BUILD_WITH_TFM + align: {start: CONFIG_NRF_TRUSTZONE_FLASH_REGION_SIZE} +#endif + inside: [nonsecure_storage] +#endif + size: CONFIG_PM_PARTITION_SIZE_ZMS_STORAGE + +#endif /* (CONFIG_SOC_NRF54L15_ENGA_CPUAPP || CONFIG_SOC_NRF54L15_CPUAPP) */ diff --git a/subsys/trusted_storage/Kconfig b/subsys/trusted_storage/Kconfig index f40f52cbc0b9..27ead4ff62a9 100644 --- a/subsys/trusted_storage/Kconfig +++ b/subsys/trusted_storage/Kconfig @@ -158,9 +158,9 @@ choice TRUSTED_STORAGE_STORAGE_BACKEND config TRUSTED_STORAGE_STORAGE_BACKEND_SETTINGS bool "Settings storage backend" - depends on SETTINGS_NVS + depends on SETTINGS_NVS || SETTINGS_ZMS help - Use the Settings subsystem with NVS to store the assets + Use the Settings subsystem to store the assets config TRUSTED_STORAGE_STORAGE_BACKEND_CUSTOM bool "Custom storage backend" diff --git a/west.yml b/west.yml index 288a260fbd22..e37956be4844 100644 --- a/west.yml +++ b/west.yml @@ -72,7 +72,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 2a679b95faef5dd1e5a46d6710d7059b6042758c + revision: 98662fcd51860d23e15471744658f817e34a85ed import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -161,7 +161,7 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: bdec5fd36f56f445c673ac14f9f09377b66ba49b + revision: 9a4ea8e45736c356a58bd7b29774d18a8d78441f west-commands: scripts/west/west-commands.yml submodules: - name: nlio