Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
+++++++++++
Expand Down
6 changes: 5 additions & 1 deletion include/flash_map_pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
16 changes: 16 additions & 0 deletions samples/bluetooth/central_and_peripheral_hr/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

source "Kconfig.zephyr"

config SETTINGS
default y
Comment on lines +9 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't needed


config ZMS
default y if SOC_FLASH_NRF_RRAM
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to add another config file to every sample? If we always want to use the new storage system for settings if we have RRAM can we not set these defaults in the ZMS/NVS subsystems?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZMS or NVS subsystems should be board agnostic, it works on all flash technologies (RRAM, MRAM, classical flash, ...)

Copy link
Contributor

@kapi-no kapi-no Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we define these defaults at the board/SoC level?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried to add this but zephyr does not have good mechanism to do it.
You can enable FS on the board soc/level but if you don't use settings then this FS will likely be a dead code.
You cannot enable it based on settings being enabled as settings backend is set based on fs being used. You have a circular dependency.

I would recommend to change interface to add information about fs in dts.

Copy link
Contributor

@kapi-no kapi-no Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably make Setting backends (choice SETTINGS_BACKEND) select their dependency (their target FS - e.g. select ZMS). Now, these choice options use depends on syntax so this requires modification of zephyr/subsys/settings/Kconfig. Then, you would pick the recommended (default) Settings backend in the Kconfig.default file in the SoC directory (e.g. zephyr/soc/nordic/nrf54l/Kconfig.defconfig).

However, this method has its implications and changes how the Settings subsystem is configured. Right now, the enabled FS (e.g. CONFIG_ZMS=y) causes the Settings backend default to change (e.g. CONFIG_SETTINGS_ZMS symbol is picked as the default choice selection).

Copy link
Contributor

@kapi-no kapi-no Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked the DTS approach initially that was suggested by Jamie. However, then we realized that relying on the DTS partition node wouldn't probably work for targets that use Partition Manager (nRF52 Series / nRF53 Series / nRF54L Series).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will work for the default, assuming that is the same as what PM is using e.g. if you use nrf54l15dk and storage is internal RRAM in DTS and PM is the same, it will work, it will not work if storage is internal RRAM in DTS but PM is using some external QSPI flash device


config NVS
default y if !SOC_FLASH_NRF_RRAM
2 changes: 0 additions & 2 deletions samples/bluetooth/central_and_peripheral_hr/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add CONFIG_SETTINGS=y back here


CONFIG_HEAP_MEM_POOL_SIZE=1024

Expand Down
16 changes: 16 additions & 0 deletions samples/bluetooth/central_bas/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/central_bas/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions samples/bluetooth/central_hids/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/central_hids/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions samples/bluetooth/central_nfc_pairing/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/central_nfc_pairing/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions samples/bluetooth/central_uart/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/central_uart/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions samples/bluetooth/enocean/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/enocean/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions samples/bluetooth/fast_pair/input_device/Kconfig
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions samples/bluetooth/fast_pair/input_device/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions samples/bluetooth/fast_pair/locator_tag/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions samples/bluetooth/peripheral_ams_client/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/peripheral_ams_client/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions samples/bluetooth/peripheral_ancs_client/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/peripheral_ancs_client/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions samples/bluetooth/peripheral_bms/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/peripheral_bms/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions samples/bluetooth/peripheral_cgms/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/peripheral_cgms/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions samples/bluetooth/peripheral_cts_client/Kconfig
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions samples/bluetooth/peripheral_cts_client/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading
Loading