From 414606b18210869cd16f9fcaf1ea52f969afae88 Mon Sep 17 00:00:00 2001 From: Sean Madigan Date: Wed, 4 Dec 2024 11:07:34 +0000 Subject: [PATCH 01/46] manifest: Update sdk-zephyr revision (auto-manifest PR) Automatically created by Github Action, update by me. Signed-off-by: Sean Madigan --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 235752fdb2bd..3db3df973eb2 100644 --- a/west.yml +++ b/west.yml @@ -69,7 +69,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 6baae0823c6953fd1c41e9249c83e3bf3a53fe09 + revision: 48cdbacbd7ee834f9d874be7c4c1c7dc372cedf4 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above From 8e959a07bb7577875a1069418eb55e84c48e5f45 Mon Sep 17 00:00:00 2001 From: Sean Madigan Date: Tue, 19 Nov 2024 10:39:56 +0000 Subject: [PATCH 02/46] doc: requirements: Add anytree requirement Some changes in zephyr docs require anytree. Signed-off-by: Sean Madigan --- doc/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/requirements.txt b/doc/requirements.txt index 56286b373009..5538bdd51f11 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -25,3 +25,4 @@ sphinx_markdown_tables # | | | X | | | sphinxcontrib-mscgen # | X | | | | X | | | sphinxcontrib-plantuml>=0.27 # | | | | | | X | | west>=1.0.0 # | | | | | | | X | +anytree # | | | | | | | X | From 6871faf4dfccce1cfdb23fde4f5f262c8634d8f8 Mon Sep 17 00:00:00 2001 From: Sean Madigan Date: Wed, 4 Dec 2024 11:07:22 +0000 Subject: [PATCH 03/46] doc: nrf: Update docs to use new zephyr code-sample-category These categories have been added upstream, so we need to update the references in our docs. Signed-off-by: Sean Madigan --- .../bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst | 2 +- doc/nrf/app_dev/device_guides/nrf52/features.rst | 6 +++--- doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst | 6 +++--- doc/nrf/app_dev/device_guides/nrf54l/features.rst | 4 ++-- doc/nrf/protocols/bt/bt_solutions.rst | 2 +- .../releases_and_maturity/releases/release-notes-2.4.0.rst | 2 +- doc/nrf/samples.rst | 2 +- doc/nrf/samples/wifi_zephyr.rst | 2 +- doc/nrf/security.rst | 2 +- doc/nrf/security/tfm.rst | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst b/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst index 79f8d153c4c8..165b8d22ab0e 100644 --- a/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst +++ b/doc/nrf/app_dev/bootloaders_dfu/mcuboot_nsib/bootloader_quick_start.rst @@ -61,7 +61,7 @@ This setup supports both UART and Bluetooth® LE connections. The following samples are supported: * :zephyr:code-sample:`smp-svr` -* :ref:`zephyr:with_mcuboot` +* :zephyr:code-sample:`with_mcuboot` .. rst-class:: numbered-step diff --git a/doc/nrf/app_dev/device_guides/nrf52/features.rst b/doc/nrf/app_dev/device_guides/nrf52/features.rst index eaa90ba9170a..20e6a564ca91 100644 --- a/doc/nrf/app_dev/device_guides/nrf52/features.rst +++ b/doc/nrf/app_dev/device_guides/nrf52/features.rst @@ -51,7 +51,7 @@ See :ref:`zephyr:bluetooth` for documentation on the Bluetooth Host and open sou For documentation about the SoftDevice Controller and information on which controller variants support which chips, see :ref:`nrfxlib:softdevice_controller`. The |NCS| contains a variety of :ref:`ble_samples` that target nRF52 Series devices. -In addition, you can run the :ref:`zephyr:bluetooth-samples` that are included from Zephyr. +In addition, you can run the :zephyr:code-sample-category:`bluetooth` samples that are included from Zephyr. For available libraries, see :ref:`lib_bluetooth_services` (|NCS|) and :ref:`zephyr:bluetooth_api` (Zephyr). @@ -64,7 +64,7 @@ It is optimized for creating large-scale device networks, and implemented accord Bluetooth Mesh networking allows one-to-one, one-to-many, and many-to-many communication, using the Bluetooth LE protocol to exchange messages between the mesh nodes in the network. The |NCS| contains a variety of :ref:`bt_mesh_samples` that target nRF52 Series devices. -In addition, you can run the :ref:`Bluetooth Mesh samples ` that are included from Zephyr. +In addition, you can run the :zephyr:code-sample-category:`bluetooth` samples that are included from Zephyr. For available libraries, see :ref:`bt_mesh` (|NCS|) and :ref:`zephyr:bluetooth_mesh` (Zephyr). See the :ref:`ug_bt_mesh` user guide for information about how to use the supplied libraries and work with Bluetooth Mesh. @@ -119,7 +119,7 @@ USB The |NCS| contains a USB device stack for the USB 2.0 Full Speed peripheral that is available on a number of the nRF52 devices. You can find the implementation in the Zephyr repository. -See :ref:`zephyr:usb_api` for documentation and :ref:`zephyr:usb-samples` for a list of available samples. +See :ref:`zephyr:usb_api` for documentation and :zephyr:code-sample-category:`usb` for a list of available samples. The USB stack requires the USBD driver for nRF52 devices, which is available as part of `nrfx`_. The nrfx repository is included in the |NCS| as a module of the Zephyr repository. diff --git a/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst b/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst index 8c6ac82b8159..21cb578c5fad 100644 --- a/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst +++ b/doc/nrf/app_dev/device_guides/nrf53/features_nrf53.rst @@ -130,7 +130,7 @@ Bluetooth Low Energy - Application core * - :zephyr:code-sample:`bluetooth_hci_ipc` - | :ref:`Bluetooth Low Energy samples ` - | :ref:`Bluetooth samples in Zephyr ` + | :zephyr:code-sample-category:`bluetooth` * - :ref:`ble_rpc_host` (supported for development) - Some Bluetooth Low Energy samples, for example, :ref:`peripheral_hids_mouse`, :ref:`peripheral_uart` or :ref:`central_uart` @@ -151,7 +151,7 @@ The sample implements the RPMsg transport using the `OpenAMP`_ library to commun You can use either the SoftDevice Controller or the Zephyr Bluetooth LE Controller for this sample. See :ref:`ug_ble_controller` for more information. -For the application core, the |NCS| provides a series of :ref:`Bluetooth Low Energy samples `, in addition to the :ref:`Bluetooth samples in Zephyr `. +For the application core, the |NCS| provides a series of :ref:`Bluetooth Low Energy samples `, in addition to the :zephyr:code-sample-category:`bluetooth` samples. |multi_image| .. note:: @@ -173,7 +173,7 @@ Bluetooth Mesh Bluetooth Mesh operates on Bluetooth Low Energy (LE), and is implemented according to Bluetooth Mesh Profile Specification v1.0.1 and Bluetooth Mesh Model Specification v1.0.1. For the application core, the |NCS| provides several :ref:`bt_mesh_samples`. -In addition, you can find Bluetooth Mesh samples with :ref:`Bluetooth samples in Zephyr `. +In addition, you can find Bluetooth Mesh samples with :zephyr:code-sample-category:`bluetooth` samples. IEEE 802.15.4 (Thread and Zigbee) --------------------------------- diff --git a/doc/nrf/app_dev/device_guides/nrf54l/features.rst b/doc/nrf/app_dev/device_guides/nrf54l/features.rst index afc1f0237ab5..c58ba42a40b3 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/features.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/features.rst @@ -57,7 +57,7 @@ The :ref:`ug_ble_controller` user guide contains more information about the two See the :ref:`zephyr:bluetooth` section of the Zephyr documentation for information on the Bluetooth Host and open source Bluetooth LE Controller. The |NCS| contains :ref:`ble_samples` that can be run on the nRF54L15 DK device. -In addition, you can run the :ref:`zephyr:bluetooth-samples` that are included from Zephyr. +In addition, you can run the :zephyr:code-sample-category:`bluetooth` samples that are included from Zephyr. For available libraries, see :ref:`lib_bluetooth_services` (|NCS|) and :ref:`zephyr:bluetooth_api` (Zephyr). @@ -66,7 +66,7 @@ Bluetooth Mesh Bluetooth Mesh operates on Bluetooth Low Energy (LE), and is implemented according to Bluetooth Mesh Profile Specification v1.0.1 and Bluetooth Mesh Model Specification v1.0.1. For the application core, the |NCS| provides several :ref:`bt_mesh_samples`. -In addition, you can find Bluetooth Mesh samples with :ref:`Bluetooth samples in Zephyr `. +In addition, you can find Bluetooth Mesh samples with :zephyr:code-sample-category:`bluetooth` samples. IEEE 802.15.4 ============= diff --git a/doc/nrf/protocols/bt/bt_solutions.rst b/doc/nrf/protocols/bt/bt_solutions.rst index 9279c0240a99..36b818dec2c5 100644 --- a/doc/nrf/protocols/bt/bt_solutions.rst +++ b/doc/nrf/protocols/bt/bt_solutions.rst @@ -35,7 +35,7 @@ Support in the |NCS|: * :ref:`peripheral_uart` and :ref:`central_uart`: These samples implement a Nordic-defined GATT service and profile that give a simple TX/RX generic data pipe, providing UART communication over Bluetooth LE. -* :ref:`bluetooth-samples` (Zephyr Project): The Zephyr Project offers additional Bluetooth samples. +* :zephyr:code-sample-category:`bluetooth` (Zephyr Project): The Zephyr Project offers additional Bluetooth samples. These samples are not guaranteed to work as part of the |NCS|, but are helpful as starting point for a relevant use case. Device networks diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst index 6f5724bd6647..eb5bd677ee93 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-2.4.0.rst @@ -58,7 +58,7 @@ The following list includes the summary of the most relevant changes introduced * Charger, BUCKs, LDOs, Load Switches, and GPIOs. * :ref:`Sample showing fuel gauge functionality `. The sample calculates battery state of charge, time to empty, time to full and provides updates of these over the terminal once every second. - * :ref:`Sample providing a shell interface ` that supports PMIC features: regulators (BUCKs, LDO) and GPIOs. + * :zephyr:code-sample:`npm1300_ek` that supports PMIC features: regulators (BUCKs, LDO) and GPIOs. * Bluetooth Low Energy: diff --git a/doc/nrf/samples.rst b/doc/nrf/samples.rst index 68ded04f553c..b12487559441 100644 --- a/doc/nrf/samples.rst +++ b/doc/nrf/samples.rst @@ -7,7 +7,7 @@ The |NCS| provides samples that specifically target Nordic Semiconductor devices Samples showcase a single feature or library, while :ref:`applications` include a variety of libraries to implement a specific use case. -Zephyr also provides a variety of :ref:`zephyr:samples-and-demos`, including very simple :ref:`zephyr:basic-sample`. +Zephyr also provides a variety of :zephyr:code-sample-category:`samples`, including very simple :zephyr:code-sample-category:`basic`. These samples are a good starting point for understanding how to put together your own application. However, Zephyr samples and applications are not tested and verified to work with the |NCS| releases. diff --git a/doc/nrf/samples/wifi_zephyr.rst b/doc/nrf/samples/wifi_zephyr.rst index e994b665cbe1..bd21d7cb21bd 100644 --- a/doc/nrf/samples/wifi_zephyr.rst +++ b/doc/nrf/samples/wifi_zephyr.rst @@ -46,4 +46,4 @@ The following is an example of the CLI command: west build -b nrf5340dk/nrf5340/cpuapp -S wifi-ipv4 -- -DSHIELD=nrf7002ek -DSB_CONFIG_WIFI_NRF70=y -For additional details about running a sample, refer to the respective sample in Zephyr’s :ref:`Samples and Demos documentation `. +For additional details about running a sample, refer to the respective sample in Zephyr’s :zephyr:code-sample-category:`samples`. diff --git a/doc/nrf/security.rst b/doc/nrf/security.rst index 931d8eb5638a..4837f839eaa1 100644 --- a/doc/nrf/security.rst +++ b/doc/nrf/security.rst @@ -40,7 +40,7 @@ Some of them are documented in detail in other parts of this documentation, whil - See :ref:`ug_tfm`. - | - :ref:`tfm_samples` | - :ref:`crypto_samples` - | - :ref:`TF-M integration samples ` in Zephyr + | - :zephyr:code-sample-category:`tfm_integration` in Zephyr * - Cryptographic operations (:ref:`nrf_security`) - The :ref:`nrf_security` library acts as an orchestrator for the different cryptographic libraries available in the system. HW accelerated libraries are prioritized over SW libraries when both are enabled. diff --git a/doc/nrf/security/tfm.rst b/doc/nrf/security/tfm.rst index 69b29519b9e6..48d3f3b30722 100644 --- a/doc/nrf/security/tfm.rst +++ b/doc/nrf/security/tfm.rst @@ -27,7 +27,7 @@ The TF-M implementation in |NCS| is demonstrated in the following samples: * All :ref:`tfm_samples` in this SDK * All :ref:`cryptography samples ` in this SDK -* A series of :ref:`TF-M integration samples ` available in Zephyr +* A series of :zephyr:code-sample-category:`tfm_integration` samples available in Zephyr In addition, the TF-M implementation is used in all samples and applications in this SDK that support the ``*/ns`` :ref:`variant ` of the boards, due to :ref:`Cortex-M Security Extensions (CMSE) ` support. From 5f099600317ba34cb9df13cd7ec536a7bc8e7747 Mon Sep 17 00:00:00 2001 From: Timothy Keys Date: Tue, 3 Dec 2024 14:46:26 +0000 Subject: [PATCH 04/46] doc: nrf: bluetooth: Add documentation for the RREQ This adds documentation for the Ranging service Ranging Requestor. Signed-off-by: Timothy Keys --- doc/nrf/libraries/bluetooth/services/rreq.rst | 49 +++++++++++++++++++ doc/nrf/links.txt | 2 + .../releases/release-notes-changelog.rst | 6 +++ 3 files changed, 57 insertions(+) create mode 100644 doc/nrf/libraries/bluetooth/services/rreq.rst diff --git a/doc/nrf/libraries/bluetooth/services/rreq.rst b/doc/nrf/libraries/bluetooth/services/rreq.rst new file mode 100644 index 000000000000..263ab37bec57 --- /dev/null +++ b/doc/nrf/libraries/bluetooth/services/rreq.rst @@ -0,0 +1,49 @@ +.. _rreq_readme: + +Ranging Requestor (RREQ) +######################## + +.. contents:: + :local: + :depth: 2 + +Overview +******** + +This library implements the Ranging Requestor for Channel Sounding with the corresponding set of characteristics defined in the `Ranging Service Specification`_ and the `Ranging Profile Specification`_. + +This library supports On Demand Ranging Data. + +Configuration +************* + +To enable this library, use the :kconfig:option:`CONFIG_BT_RAS` Kconfig option. + +Check and adjust the following Kconfig options: + +* :kconfig:option:`CONFIG_BT_RAS_MAX_ANTENNA_PATHS` - Sets the maximum number of antenna paths supported by the device. + +* :kconfig:option:`CONFIG_BT_RAS_MODE_3_SUPPORTED` - Sets support for storing Mode 3 Channel Sounding steps. + +* :kconfig:option:`CONFIG_BT_RAS_RREQ` - Enables RREQ Kconfig options. + +* :kconfig:option:`CONFIG_BT_RAS_RREQ_MAX_ACTIVE_CONN` - Sets the number of simultaneously supported RREQ instances. + +* :kconfig:option:`CONFIG_HEAP_MEM_POOL_ADD_SIZE_RAS_RREQ_GATT_DM` - Sets the heap size for the GATT discovery manager module. + +* :kconfig:option:`CONFIG_BT_RAS_RREQ_LOG_LEVEL` - Sets the logging level of the RREQ library. + +Usage +***** + +You can set up the RREQ either as a Channel Sounding Initiator or Reflector. + +| See the sample: :file:`samples/bluetooth/channel_sounding_ras_initiator` + +API documentation +***************** + +| Header file: :file:`include/bluetooth/services/ras.h` +| Source files: :file:`subsys/bluetooth/services/ras` + +.. doxygengroup:: bt_ras diff --git a/doc/nrf/links.txt b/doc/nrf/links.txt index 4074bdd941f3..1b4f01a2ef96 100644 --- a/doc/nrf/links.txt +++ b/doc/nrf/links.txt @@ -984,6 +984,8 @@ .. _`Current Time Service Specification`: https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=292957 .. _`Running Speed and Cadence Service Specification`: https://www.bluetooth.com/specifications/specs/running-speed-and-cadence-service-1-0/ .. _`Continuous Glucose Monitoring Service Specification`: https://www.bluetooth.org/DocMan/handlers/DownloadDoc.ashx?doc_id=531249 +.. _`Ranging Profile Specification`: https://files.bluetooth.com/download/rap_v1-0/ +.. _`Ranging Service Specification`: https://files.bluetooth.com/download/ras_v1-0/ .. _`Bluetooth SIG company identifiers`: https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers/ 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 066b5caefb66..d635507d30eb 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -571,6 +571,12 @@ Binary libraries Bluetooth libraries and services -------------------------------- +* :ref:`rreq_readme` library: + + * Added + + * Added the Ranging Service Ranging Requestor library for Channel Sounding. + * :ref:`hogp_readme` library: * Updated the :c:func:`bt_hogp_rep_read` function to forward the GATT read error code through the registered user callback. From 2d93fdac2a0018a2610c15427a1ce476a868b380 Mon Sep 17 00:00:00 2001 From: Timothy Keys Date: Tue, 3 Dec 2024 16:00:17 +0000 Subject: [PATCH 05/46] doc: nrf: bluetooth: Add documentation for the RRSP This adds documentation for the Ranging Service Ranging Responder. Signed-off-by: Timothy Keys --- doc/nrf/libraries/bluetooth/services/rrsp.rst | 57 +++++++++++++++++++ .../releases/release-notes-changelog.rst | 6 -- 2 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 doc/nrf/libraries/bluetooth/services/rrsp.rst diff --git a/doc/nrf/libraries/bluetooth/services/rrsp.rst b/doc/nrf/libraries/bluetooth/services/rrsp.rst new file mode 100644 index 000000000000..e4cc632d74f0 --- /dev/null +++ b/doc/nrf/libraries/bluetooth/services/rrsp.rst @@ -0,0 +1,57 @@ +.. _rrsp_readme: + +Ranging Responder (RRSP) +######################## + +.. contents:: + :local: + :depth: 2 + +Overview +******** + +This library implements the Ranging Responder for Channel Sounding with the corresponding set of characteristics defined in the `Ranging Service Specification`_ and the `Ranging Profile Specification`_. + +This library supports On Demand Ranging Data. + +Configuration +************* + +To enable this library, use the :kconfig:option:`CONFIG_BT_RAS` Kconfig option. + +Check and adjust the following Kconfig options: + +* :kconfig:option:`CONFIG_BT_RAS_MAX_ANTENNA_PATHS` - Sets the maximum number of antenna paths supported by the device. + This sets the antenna paths for each step that can be stored inside the Ranging Service. + This value must match the supported Channel Sounding capabilities of the device. + This affects the per-instance memory usage of the Ranging Service. + +* :kconfig:option:`CONFIG_BT_RAS_MODE_3_SUPPORTED` - Sets support for storing Mode 3 Channel Sounding steps. + This will allocate memory for the Ranging Service to store Mode 3 Channel Sounding steps. + This value must match the supported Channel Sounding capabilities of the device. + This affects the per-instance memory usage of the Ranging Service. + +* :kconfig:option:`CONFIG_BT_RAS_RRSP` - Enables RRSP Kconfig options. + +* :kconfig:option:`CONFIG_BT_RAS_RRSP_AUTO_ALLOC_INSTANCE` - Sets new connections to be allocated a RRSP instance automatically. + +* :kconfig:option:`CONFIG_BT_RAS_RRSP_MAX_ACTIVE_CONN` - Sets the number of simultaneously supported RRSP instances. + +* :kconfig:option:`CONFIG_BT_RAS_RRSP_RD_BUFFERS_PER_CONN` - Set the number of ranging data buffers per connection. + +* :kconfig:option:`CONFIG_BT_RAS_RRSP_LOG_LEVEL` - Sets the logging level of the RRSP library. + +Usage +***** + +You can set up the RRSP either as a Channel Sounding Initiator or Reflector. + +| See the sample: :file:`samples/bluetooth/channel_sounding_ras_reflector` + +API documentation +***************** + +| Header file: :file:`include/bluetooth/services/ras.h` +| Source files: :file:`subsys/bluetooth/services/ras` + +.. doxygengroup:: bt_ras 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 d635507d30eb..066b5caefb66 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -571,12 +571,6 @@ Binary libraries Bluetooth libraries and services -------------------------------- -* :ref:`rreq_readme` library: - - * Added - - * Added the Ranging Service Ranging Requestor library for Channel Sounding. - * :ref:`hogp_readme` library: * Updated the :c:func:`bt_hogp_rep_read` function to forward the GATT read error code through the registered user callback. From 75b2ff2bce1a4f9fbbf1de64f95a4f091125588a Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Wed, 4 Dec 2024 13:09:24 +0100 Subject: [PATCH 06/46] samples: matter: Enabled reporting on entering ICD active state Enabled sending data reports once ICD enters the active mode for all LIT supporting samples. Signed-off-by: Kamil Kasperczyk --- samples/matter/light_switch/snippets/lit_icd/lit_icd.conf | 1 + samples/matter/smoke_co_alarm/Kconfig | 3 +++ samples/matter/smoke_co_alarm/README.rst | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/samples/matter/light_switch/snippets/lit_icd/lit_icd.conf b/samples/matter/light_switch/snippets/lit_icd/lit_icd.conf index ba79fe688fe7..f46c55c54801 100644 --- a/samples/matter/light_switch/snippets/lit_icd/lit_icd.conf +++ b/samples/matter/light_switch/snippets/lit_icd/lit_icd.conf @@ -7,4 +7,5 @@ # Enable LIT ICD configuration CONFIG_CHIP_ICD_LIT_SUPPORT=y CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT=5000 +CONFIG_CHIP_ICD_REPORT_ON_ACTIVE_MODE=y CONFIG_NCS_SAMPLE_MATTER_ZAP_FILES_PATH="snippets/lit_icd" diff --git a/samples/matter/smoke_co_alarm/Kconfig b/samples/matter/smoke_co_alarm/Kconfig index fbf391a66a30..d0127e0efd34 100644 --- a/samples/matter/smoke_co_alarm/Kconfig +++ b/samples/matter/smoke_co_alarm/Kconfig @@ -22,6 +22,9 @@ config CHIP_ICD_LIT_SUPPORT config CHIP_ICD_SIT_SLOW_POLL_LIMIT default 5000 +config CHIP_ICD_REPORT_ON_ACTIVE_MODE + default y + # Increase the supported event triggers due to the multiple alarm triggers config NCS_SAMPLE_MATTER_TEST_EVENT_TRIGGERS_MAX default 12 diff --git a/samples/matter/smoke_co_alarm/README.rst b/samples/matter/smoke_co_alarm/README.rst index ed64101a3fc5..f936b093a7f2 100644 --- a/samples/matter/smoke_co_alarm/README.rst +++ b/samples/matter/smoke_co_alarm/README.rst @@ -73,8 +73,8 @@ The sample supports ICD Dynamic SIT LIT switching (DSLS) feature to switch betwe The device uses the SIT mode, when the wired power source is active. Otherwise, it switches to the LIT mode, to indicate that it is possible to save the energy, when using a battery power source. Dynamic switching is possible only if the ICD device meets all criteria for operating in the LIT mode (it has at least one client registered). -DSLS support is enabled by default. -To disable it, set the :kconfig:option:`CONFIG_CHIP_ICD_DSLS_SUPPORT` Kconfig option to ``n``. +DSLS support is disabled by default. +To enable it, set the :kconfig:option:`CONFIG_CHIP_ICD_DSLS_SUPPORT` Kconfig option to ``y``. In the LIT mode, the device responsiveness is much lower than in the SIT mode. However, you can request the device to become responsive to, for example, change its configuration. From 584e1c85cd2f058ee69b802bfd913b823e315b2c Mon Sep 17 00:00:00 2001 From: Sean Madigan Date: Wed, 4 Dec 2024 12:10:08 +0000 Subject: [PATCH 07/46] samples: bluetooth: Update distance estimation for mode 3 and multi antenna Mode 3 is a combination of modes 1 and 2, so extract out some of the common logic and use this for mode 3. Adjust array sizes and indexes so they can be used for multi antenna. Signed-off-by: Sean Madigan --- .../src/distance_estimation.c | 178 +++++++++++------- 1 file changed, 106 insertions(+), 72 deletions(-) diff --git a/samples/bluetooth/channel_sounding_ras_initiator/src/distance_estimation.c b/samples/bluetooth/channel_sounding_ras_initiator/src/distance_estimation.c index 62440b3afc49..e0827cfc03d3 100644 --- a/samples/bluetooth/channel_sounding_ras_initiator/src/distance_estimation.c +++ b/samples/bluetooth/channel_sounding_ras_initiator/src/distance_estimation.c @@ -21,7 +21,8 @@ LOG_MODULE_DECLARE(app_main, LOG_LEVEL_INF); #define SPEED_OF_LIGHT_M_PER_S (299792458.0f) #define SPEED_OF_LIGHT_NM_PER_S (SPEED_OF_LIGHT_M_PER_S / 1000000000.0f) #define PI 3.14159265358979323846f -#define MAX_NUM_SAMPLES 256 +#define MAX_NUM_RTT_SAMPLES 256 +#define MAX_NUM_IQ_SAMPLES 256 * CONFIG_BT_RAS_MAX_ANTENNA_PATHS struct iq_sample_and_channel { bool failed; @@ -37,12 +38,12 @@ struct rtt_timing { int16_t tod_toa_reflector; }; -static struct iq_sample_and_channel mode_2_data[MAX_NUM_SAMPLES]; -static struct rtt_timing mode_1_data[MAX_NUM_SAMPLES]; +static struct iq_sample_and_channel iq_sample_channel_data[MAX_NUM_IQ_SAMPLES]; +static struct rtt_timing rtt_timing_data[MAX_NUM_RTT_SAMPLES]; struct processing_context { - uint8_t mode_1_data_index; - uint8_t mode_2_data_index; + uint16_t rtt_timing_data_index; + uint16_t iq_sample_channel_data_index; uint8_t n_ap; enum bt_conn_le_cs_role role; }; @@ -111,8 +112,8 @@ static float estimate_distance_using_phase_slope(struct iq_sample_and_channel *d int32_t combined_i; int32_t combined_q; uint16_t num_angles = 0; - static float theta[MAX_NUM_SAMPLES]; - static float frequencies[MAX_NUM_SAMPLES]; + static float theta[MAX_NUM_IQ_SAMPLES]; + static float frequencies[MAX_NUM_IQ_SAMPLES]; for (uint8_t i = 0; i < len; i++) { if (!data[i].failed) { @@ -162,9 +163,9 @@ static float estimate_distance_using_time_of_flight(uint8_t n_samples) /* Cumulative Moving Average */ for (uint8_t i = 0; i < n_samples; i++) { - if (!mode_1_data[i].failed) { - tof = (mode_1_data[i].toa_tod_initiator - - mode_1_data[i].tod_toa_reflector) / + if (!rtt_timing_data[i].failed) { + tof = (rtt_timing_data[i].toa_tod_initiator - + rtt_timing_data[i].tod_toa_reflector) / 2; tof_mean += (tof - tof_mean) / (i + 1); } @@ -175,6 +176,76 @@ static float estimate_distance_using_time_of_flight(uint8_t n_samples) return tof_mean_ns * SPEED_OF_LIGHT_NM_PER_S; } +static void process_tone_info_data(struct processing_context *context, + struct bt_hci_le_cs_step_data_tone_info local_tone_info[], + struct bt_hci_le_cs_step_data_tone_info peer_tone_info[], + uint8_t channel, uint8_t antenna_permutation_index) +{ + for (uint8_t i = 0; i < (context->n_ap + 1); i++) { + if (local_tone_info[i].extension_indicator != BT_HCI_LE_CS_NOT_TONE_EXT_SLOT || + peer_tone_info[i].extension_indicator != BT_HCI_LE_CS_NOT_TONE_EXT_SLOT) { + continue; + } + + if (context->iq_sample_channel_data_index >= MAX_NUM_IQ_SAMPLES) { + LOG_WRN("More IQ samples than size of iq_sample_channel_data array"); + return; + } + + iq_sample_channel_data[context->iq_sample_channel_data_index].channel = channel; + iq_sample_channel_data[context->iq_sample_channel_data_index].antenna_permutation = + antenna_permutation_index; + iq_sample_channel_data[context->iq_sample_channel_data_index].local_iq_sample = + bt_le_cs_parse_pct(local_tone_info[i].phase_correction_term); + iq_sample_channel_data[context->iq_sample_channel_data_index].peer_iq_sample = + bt_le_cs_parse_pct(peer_tone_info[i].phase_correction_term); + + if (local_tone_info[i].quality_indicator == BT_HCI_LE_CS_TONE_QUALITY_LOW || + local_tone_info[i].quality_indicator == BT_HCI_LE_CS_TONE_QUALITY_UNAVAILABLE || + peer_tone_info[i].quality_indicator == BT_HCI_LE_CS_TONE_QUALITY_LOW || + peer_tone_info[i].quality_indicator == BT_HCI_LE_CS_TONE_QUALITY_UNAVAILABLE) { + iq_sample_channel_data[context->iq_sample_channel_data_index].failed = true; + } + + context->iq_sample_channel_data_index++; + } +} + +static void process_rtt_timing_data(struct processing_context *context, + struct bt_hci_le_cs_step_data_mode_1 *local_rtt_data, + struct bt_hci_le_cs_step_data_mode_1 *peer_rtt_data) +{ + if (context->rtt_timing_data_index >= MAX_NUM_RTT_SAMPLES) { + LOG_WRN("More RTT samples processed than size of rtt_timing_data array"); + return; + } + + if (local_rtt_data->packet_quality_aa_check != + BT_HCI_LE_CS_PACKET_QUALITY_AA_CHECK_SUCCESSFUL || + local_rtt_data->packet_rssi == BT_HCI_LE_CS_PACKET_RSSI_NOT_AVAILABLE || + local_rtt_data->tod_toa_reflector == BT_HCI_LE_CS_TIME_DIFFERENCE_NOT_AVAILABLE || + peer_rtt_data->packet_quality_aa_check != + BT_HCI_LE_CS_PACKET_QUALITY_AA_CHECK_SUCCESSFUL || + peer_rtt_data->packet_rssi == BT_HCI_LE_CS_PACKET_RSSI_NOT_AVAILABLE || + peer_rtt_data->tod_toa_reflector == BT_HCI_LE_CS_TIME_DIFFERENCE_NOT_AVAILABLE) { + rtt_timing_data[context->rtt_timing_data_index].failed = true; + } + + if (context->role == BT_CONN_LE_CS_ROLE_INITIATOR) { + rtt_timing_data[context->rtt_timing_data_index].toa_tod_initiator = + local_rtt_data->toa_tod_initiator; + rtt_timing_data[context->rtt_timing_data_index].tod_toa_reflector = + peer_rtt_data->tod_toa_reflector; + } else if (context->role == BT_CONN_LE_CS_ROLE_REFLECTOR) { + rtt_timing_data[context->rtt_timing_data_index].tod_toa_reflector = + local_rtt_data->tod_toa_reflector; + rtt_timing_data[context->rtt_timing_data_index].toa_tod_initiator = + peer_rtt_data->toa_tod_initiator; + } + + context->rtt_timing_data_index++; +} + static bool process_step_data(struct bt_le_cs_subevent_step *local_step, struct bt_le_cs_subevent_step *peer_step, void *user_data) { @@ -186,68 +257,31 @@ static bool process_step_data(struct bt_le_cs_subevent_step *local_step, struct bt_hci_le_cs_step_data_mode_2 *peer_step_data = (struct bt_hci_le_cs_step_data_mode_2 *)peer_step->data; - for (uint8_t i = 0; i < (context->n_ap + 1); i++) { - if (local_step_data->tone_info[i].extension_indicator != - BT_HCI_LE_CS_NOT_TONE_EXT_SLOT || - peer_step_data->tone_info[i].extension_indicator != - BT_HCI_LE_CS_NOT_TONE_EXT_SLOT) { - continue; - } + process_tone_info_data(context, local_step_data->tone_info, + peer_step_data->tone_info, local_step->channel, + local_step_data->antenna_permutation_index); - mode_2_data[context->mode_2_data_index].channel = local_step->channel; - mode_2_data[context->mode_2_data_index].antenna_permutation = - local_step_data->antenna_permutation_index; - mode_2_data[context->mode_2_data_index].local_iq_sample = - bt_le_cs_parse_pct( - local_step_data->tone_info[i].phase_correction_term); - mode_2_data[context->mode_2_data_index].peer_iq_sample = bt_le_cs_parse_pct( - peer_step_data->tone_info[i].phase_correction_term); - - if (local_step_data->tone_info[i].quality_indicator == - BT_HCI_LE_CS_TONE_QUALITY_LOW || - local_step_data->tone_info[i].quality_indicator == - BT_HCI_LE_CS_TONE_QUALITY_UNAVAILABLE || - peer_step_data->tone_info[i].quality_indicator == - BT_HCI_LE_CS_TONE_QUALITY_LOW || - peer_step_data->tone_info[i].quality_indicator == - BT_HCI_LE_CS_TONE_QUALITY_UNAVAILABLE) { - mode_2_data[context->mode_2_data_index].failed = true; - } - - context->mode_2_data_index++; - } } else if (local_step->mode == BT_HCI_OP_LE_CS_MAIN_MODE_1) { struct bt_hci_le_cs_step_data_mode_1 *local_step_data = (struct bt_hci_le_cs_step_data_mode_1 *)local_step->data; struct bt_hci_le_cs_step_data_mode_1 *peer_step_data = (struct bt_hci_le_cs_step_data_mode_1 *)peer_step->data; - if (local_step_data->packet_quality_aa_check != - BT_HCI_LE_CS_PACKET_QUALITY_AA_CHECK_SUCCESSFUL || - local_step_data->packet_rssi == BT_HCI_LE_CS_PACKET_RSSI_NOT_AVAILABLE || - local_step_data->tod_toa_reflector == - BT_HCI_LE_CS_TIME_DIFFERENCE_NOT_AVAILABLE || - peer_step_data->packet_quality_aa_check != - BT_HCI_LE_CS_PACKET_QUALITY_AA_CHECK_SUCCESSFUL || - peer_step_data->packet_rssi == BT_HCI_LE_CS_PACKET_RSSI_NOT_AVAILABLE || - peer_step_data->tod_toa_reflector == - BT_HCI_LE_CS_TIME_DIFFERENCE_NOT_AVAILABLE) { - mode_1_data[context->mode_1_data_index].failed = true; - } + process_rtt_timing_data(context, local_step_data, peer_step_data); - if (context->role == BT_CONN_LE_CS_ROLE_INITIATOR) { - mode_1_data[context->mode_1_data_index].toa_tod_initiator = - local_step_data->toa_tod_initiator; - mode_1_data[context->mode_1_data_index].tod_toa_reflector = - peer_step_data->tod_toa_reflector; - } else if (context->role == BT_CONN_LE_CS_ROLE_REFLECTOR) { - mode_1_data[context->mode_1_data_index].tod_toa_reflector = - local_step_data->tod_toa_reflector; - mode_1_data[context->mode_1_data_index].toa_tod_initiator = - peer_step_data->toa_tod_initiator; - } + } else if (local_step->mode == BT_HCI_OP_LE_CS_MAIN_MODE_3) { + struct bt_hci_le_cs_step_data_mode_3 *local_step_data = + (struct bt_hci_le_cs_step_data_mode_3 *)local_step->data; + struct bt_hci_le_cs_step_data_mode_3 *peer_step_data = + (struct bt_hci_le_cs_step_data_mode_3 *)peer_step->data; + + process_rtt_timing_data(context, + (struct bt_hci_le_cs_step_data_mode_1 *)local_step_data, + (struct bt_hci_le_cs_step_data_mode_1 *)peer_step_data); - context->mode_1_data_index++; + process_tone_info_data(context, local_step_data->tone_info, + peer_step_data->tone_info, local_step->channel, + local_step_data->antenna_permutation_index); } return true; @@ -257,23 +291,23 @@ void estimate_distance(struct net_buf_simple *local_steps, struct net_buf_simple uint8_t n_ap, enum bt_conn_le_cs_role role) { struct processing_context context = { - .mode_1_data_index = 0, - .mode_2_data_index = 0, + .rtt_timing_data_index = 0, + .iq_sample_channel_data_index = 0, .n_ap = n_ap, .role = role, }; - memset(mode_1_data, 0, sizeof(mode_1_data)); - memset(mode_2_data, 0, sizeof(mode_2_data)); + memset(rtt_timing_data, 0, sizeof(rtt_timing_data)); + memset(iq_sample_channel_data, 0, sizeof(iq_sample_channel_data)); bt_ras_rreq_rd_subevent_data_parse(peer_steps, local_steps, context.role, NULL, process_step_data, &context); - float phase_slope_based_distance = - estimate_distance_using_phase_slope(mode_2_data, context.mode_2_data_index); + float phase_slope_based_distance = estimate_distance_using_phase_slope( + iq_sample_channel_data, context.iq_sample_channel_data_index); float rtt_based_distance = - estimate_distance_using_time_of_flight(context.mode_1_data_index); + estimate_distance_using_time_of_flight(context.rtt_timing_data_index); if (rtt_based_distance == 0.0f && phase_slope_based_distance == 0.0f) { LOG_INF("A reliable distance estimate could not be computed."); @@ -283,10 +317,10 @@ void estimate_distance(struct net_buf_simple *local_steps, struct net_buf_simple if (rtt_based_distance != 0.0f) { LOG_INF("- Round-Trip Timing method: %f meters (derived from %d samples)", - (double)rtt_based_distance, context.mode_1_data_index); + (double)rtt_based_distance, context.rtt_timing_data_index); } if (phase_slope_based_distance != 0.0f) { LOG_INF("- Phase-Based Ranging method: %f meters (derived from %d samples)", - (double)phase_slope_based_distance, context.mode_2_data_index); + (double)phase_slope_based_distance, context.iq_sample_channel_data_index); } } From 27f11591d852f79ff287c35de49574e07ce98555 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Wed, 4 Dec 2024 17:03:23 +0100 Subject: [PATCH 08/46] cmake: remove duplication of TOOLCHAIN_LD_FLAGS flags nRF Security should not duplicate Zephyr toolchain ld flags. Signed-off-by: Torsten Rasmussen --- subsys/nrf_security/cmake/extensions.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/subsys/nrf_security/cmake/extensions.cmake b/subsys/nrf_security/cmake/extensions.cmake index ce49edf83119..f938e4587017 100644 --- a/subsys/nrf_security/cmake/extensions.cmake +++ b/subsys/nrf_security/cmake/extensions.cmake @@ -148,7 +148,6 @@ macro(nrf_security_add_zephyr_options lib_name) # Unsure if these are needed any more target_compile_options(${lib_name} PRIVATE ${TOOLCHAIN_C_FLAGS}) - target_ld_options(${lib_name} PRIVATE ${TOOLCHAIN_LD_FLAGS}) else() target_compile_options(${lib_name} PRIVATE "SHELL: -imacros ${ZEPHYR_AUTOCONF}") target_include_directories(${lib_name} PRIVATE @@ -184,7 +183,6 @@ macro(nrf_security_add_zephyr_options_library lib_name) # Unsure if these are needed any more target_compile_options(${lib_name} PRIVATE ${TOOLCHAIN_C_FLAGS}) - target_ld_options(${lib_name} PRIVATE ${TOOLCHAIN_LD_FLAGS}) else() target_compile_options(${lib_name} PRIVATE "SHELL: -imacros ${ZEPHYR_AUTOCONF}") target_include_directories(${lib_name} PRIVATE From 3d32533485fea1d72ca4c31bd09a7f6d3e0403d0 Mon Sep 17 00:00:00 2001 From: Marcin Jelinski Date: Wed, 4 Dec 2024 12:10:00 +0100 Subject: [PATCH 09/46] applications: machine_learning: Update sample.yaml file Added entry for the board `nrf54l15dk/nrf54l15/cpuapp` in the sample.yaml file. Ref: NCSDK-30382 Signed-off-by: Marcin Jelinski --- applications/machine_learning/sample.yaml | 28 ++++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/applications/machine_learning/sample.yaml b/applications/machine_learning/sample.yaml index bdb211cee2ae..d02e3c6ad1f4 100644 --- a/applications/machine_learning/sample.yaml +++ b/applications/machine_learning/sample.yaml @@ -5,19 +5,24 @@ tests: applications.machine_learning.zdebug: sysbuild: true build_only: true - platform_allow: > - nrf52840dk/nrf52840 thingy53/nrf5340/cpuapp thingy53/nrf5340/cpuapp/ns - nrf5340dk/nrf5340/cpuapp + platform_allow: + - nrf52840dk/nrf52840 + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns + - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp integration_platforms: - nrf52840dk/nrf52840 - thingy53/nrf5340/cpuapp - thingy53/nrf5340/cpuapp/ns - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp tags: ci_build sysbuild ci_applications_machine_learning applications.machine_learning.zdebug_nus: sysbuild: true build_only: true - platform_allow: nrf52840dk/nrf52840 + platform_allow: + - nrf52840dk/nrf52840 integration_platforms: - nrf52840dk/nrf52840 tags: ci_build sysbuild ci_applications_machine_learning @@ -25,7 +30,9 @@ tests: applications.machine_learning.zdebug_rtt: sysbuild: true build_only: true - platform_allow: thingy53/nrf5340/cpuapp thingy53/nrf5340/cpuapp/ns + platform_allow: + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns integration_platforms: - thingy53/nrf5340/cpuapp - thingy53/nrf5340/cpuapp/ns @@ -34,7 +41,10 @@ tests: applications.machine_learning.zrelease: sysbuild: true build_only: true - platform_allow: nrf52840dk/nrf52840 thingy53/nrf5340/cpuapp thingy53/nrf5340/cpuapp/ns + platform_allow: + - nrf52840dk/nrf52840 + - thingy53/nrf5340/cpuapp + - thingy53/nrf5340/cpuapp/ns integration_platforms: - nrf52840dk/nrf52840 - thingy53/nrf5340/cpuapp @@ -44,7 +54,8 @@ tests: applications.machine_learning.sensor_hub.zdebug.singlecore: build_only: true sysbuild: true - platform_allow: nrf54h20dk/nrf54h20/cpuapp + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp tags: ci_build sysbuild ci_applications_machine_learning @@ -54,7 +65,8 @@ tests: applications.machine_learning.sensor_hub.zdebug: build_only: true sysbuild: true - platform_allow: nrf54h20dk/nrf54h20/cpuapp + platform_allow: + - nrf54h20dk/nrf54h20/cpuapp integration_platforms: - nrf54h20dk/nrf54h20/cpuapp tags: ci_build sysbuild ci_applications_machine_learning From 6f444f75bb147ca695ba4f5785ca4d992caff683 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 2 Dec 2024 16:28:02 +0100 Subject: [PATCH 10/46] scripts: hid_configurator: Support pure ED25519 signature Change adds support for pure ED25519 signature (used by nRF54L-based devices that enable MCUboot hardware cryptography). imgtool from MCUboot upstream repository does not support this configuration, a dedicated imgtool version from sdk-mcuboot repository must be used. Jira: NCSDK-30745 Signed-off-by: Marek Pieta Signed-off-by: Pekka Niskanen Signed-off-by: Divya Pillai --- scripts/hid_configurator/README.rst | 23 +++++++++++++++++++++++ scripts/hid_configurator/modules/dfu.py | 16 ++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/scripts/hid_configurator/README.rst b/scripts/hid_configurator/README.rst index ae7e66978ccb..f6d9f21d2df8 100644 --- a/scripts/hid_configurator/README.rst +++ b/scripts/hid_configurator/README.rst @@ -91,6 +91,18 @@ Complete the following steps: py -3 -m pip install -r requirements.txt py -3 -m pip install . +.. note:: + Currently, the ``imgtool`` from PyPI does not support pure ED25519 signature (used by nRF54L-based devices that enable MCUboot hardware cryptography). + This may result in rejecting proper DFU images (``DFU image is invalid``). + ``imgtool`` supporting pure ED25519 signature can be installed from the ``sdk-mcuboot`` repository (:file:`ncs/bootloader/mcuboot/scripts` directory of the |NCS|). + Run the following commands in the source directory to install ``imgtool`` and the required dependencies: + + .. parsed-literal:: + :class: highlight + + py -3 -m pip install -r requirements.txt + py -3 -m pip install . + Debian/Ubuntu/Linux Mint ======================== @@ -151,6 +163,17 @@ Complete the following steps: pip3 install --user -r requirements.txt pip3 install --user . +.. note:: + Currently, the ``imgtool`` from PyPI does not support pure ED25519 signature (used by nRF54L-based devices that enable MCUboot hardware cryptography). + This may result in rejecting proper DFU images (``DFU image is invalid``). + ``imgtool`` supporting pure ED25519 signature can be installed from the ``sdk-mcuboot`` repository (:file:`ncs/bootloader/mcuboot/scripts` directory of the |NCS|). + Run the following commands in the source directory to install ``imgtool`` and the required dependencies: + + .. parsed-literal:: + :class: highlight + + pip3 install --user -r requirements.txt + pip3 install --user . Stopping fwupd daemon ===================== diff --git a/scripts/hid_configurator/modules/dfu.py b/scripts/hid_configurator/modules/dfu.py index eb3ca6032e9f..57d0b517a2ba 100644 --- a/scripts/hid_configurator/modules/dfu.py +++ b/scripts/hid_configurator/modules/dfu.py @@ -209,7 +209,13 @@ def b0_get_dfu_image_bootloader_var(): def mcuboot_common_is_dfu_file_correct(dfu_bin): - res, _, _ = imgtool.image.Image.verify(dfu_bin, None) + try: + res, _, _ = imgtool.image.Image.verify(dfu_bin, None) + except ValueError: + # `imgtool` from `sdk-mcuboot` repository is needed to support pure ED25519 signature. + # This `imgtool` package version modifies the `verify` function signature (the function + # returns one more value). + res, _, _, _ = imgtool.image.Image.verify(dfu_bin, None) if res != imgtool.image.VerifyResult.OK: print('DFU image is invalid') @@ -219,7 +225,13 @@ def mcuboot_common_is_dfu_file_correct(dfu_bin): def mcuboot_common_get_dfu_image_version(dfu_bin): - res, ver, _ = imgtool.image.Image.verify(dfu_bin, None) + try: + res, ver, _ = imgtool.image.Image.verify(dfu_bin, None) + except ValueError: + # `imgtool` from `sdk-mcuboot` repository is needed to support pure ED25519 signature. + # This `imgtool` package version modifies the `verify` function signature (the function + # returns one more value). + res, ver, _, _ = imgtool.image.Image.verify(dfu_bin, None) if res != imgtool.image.VerifyResult.OK: print('Image in file is invalid') From e5b078003afd9a9576b01b886fbb8984ffb79290 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Wed, 4 Dec 2024 17:31:55 +0100 Subject: [PATCH 11/46] maanifest: Update Zephyr revision Point to a batch merge: https://github.com/nrfconnect/sdk-zephyr/pull/2339 Signed-off-by: Carles Cufi --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 3db3df973eb2..c2ba443e6836 100644 --- a/west.yml +++ b/west.yml @@ -69,7 +69,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 48cdbacbd7ee834f9d874be7c4c1c7dc372cedf4 + revision: 15ffa301b3294a769752ad0a1d382bce9803f265 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above From fd049bd9a299262f1ac4e7a988ed179cd7070249 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Wed, 4 Dec 2024 12:18:43 +0100 Subject: [PATCH 12/46] manifest: Update sdk-sidewalk revision Pull commit with libgcc linking fixes. Signed-off-by: Torsten Rasmussen --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index c2ba443e6836..1e6df46e0013 100644 --- a/west.yml +++ b/west.yml @@ -206,7 +206,7 @@ manifest: compare-by-default: false - name: sidewalk repo-path: sdk-sidewalk - revision: 5308f19c25eee01e5e2f819a3fc160131d12e33b + revision: a2433e06b653e0f9a47f17af0fef6bd4c5e90a4e groups: - sidewalk - name: find-my From 67f2d9bed7d9501ee590b45121ee6d459628ab05 Mon Sep 17 00:00:00 2001 From: "Bansidhar P.M" Date: Tue, 3 Dec 2024 22:36:21 +0530 Subject: [PATCH 13/46] samples: wifi: radio_test: Move FICR related file to radio test Move ficr_prog.c from drivers to radio test sample as it is only used in the sample. Signed-off-by: Bansidhar P.M --- samples/wifi/radio_test/CMakeLists.txt | 1 + .../inc/nrf_wifi_radio_test_shell.h | 2 +- samples/wifi/radio_test/src/ficr_prog.c | 380 ++++++++++++++++++ samples/wifi/radio_test/src/ficr_prog.h | 23 ++ 4 files changed, 405 insertions(+), 1 deletion(-) create mode 100644 samples/wifi/radio_test/src/ficr_prog.c create mode 100644 samples/wifi/radio_test/src/ficr_prog.h diff --git a/samples/wifi/radio_test/CMakeLists.txt b/samples/wifi/radio_test/CMakeLists.txt index 6733e6c1949f..b094041d735e 100644 --- a/samples/wifi/radio_test/CMakeLists.txt +++ b/samples/wifi/radio_test/CMakeLists.txt @@ -19,4 +19,5 @@ target_sources(app PRIVATE src/nrf_wifi_radio_test_main.c src/nrf_wifi_radio_test_shell.c src/nrf_wifi_radio_ficr_shell.c + src/ficr_prog.c ) diff --git a/samples/wifi/radio_test/inc/nrf_wifi_radio_test_shell.h b/samples/wifi/radio_test/inc/nrf_wifi_radio_test_shell.h index cb7497aa5889..6105c91cf456 100644 --- a/samples/wifi/radio_test/inc/nrf_wifi_radio_test_shell.h +++ b/samples/wifi/radio_test/inc/nrf_wifi_radio_test_shell.h @@ -16,7 +16,7 @@ #include #include #include -#include "rpu_hw_if.h" +#include struct nrf_wifi_ctx_zep_rt { struct nrf_wifi_fmac_priv *fmac_priv; diff --git a/samples/wifi/radio_test/src/ficr_prog.c b/samples/wifi/radio_test/src/ficr_prog.c new file mode 100644 index 000000000000..58fd4dcf0cb4 --- /dev/null +++ b/samples/wifi/radio_test/src/ficr_prog.c @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* @file + * @brief NRF Wi-Fi radio FICR programming functions + */ + +#include +#include +#include + +#include "rpu_if.h" +#include "ficr_prog.h" + + +LOG_MODULE_DECLARE(otp_prog, CONFIG_WIFI_LOG_LEVEL); + +static void write_word(unsigned int addr, unsigned int data) +{ + rpu_write(addr, &data, 4); +} + +static void read_word(unsigned int addr, unsigned int *data) +{ + rpu_read(addr, data, 4); +} + +unsigned int check_protection(unsigned int *buff, unsigned int off1, unsigned int off2, + unsigned int off3, unsigned int off4) +{ + if ((buff[off1] == OTP_PROGRAMMED) && + (buff[off2] == OTP_PROGRAMMED) && + (buff[off3] == OTP_PROGRAMMED) && + (buff[off4] == OTP_PROGRAMMED)) + return OTP_PROGRAMMED; + else if ((buff[off1] == OTP_FRESH_FROM_FAB) && + (buff[off2] == OTP_FRESH_FROM_FAB) && + (buff[off3] == OTP_FRESH_FROM_FAB) && + (buff[off4] == OTP_FRESH_FROM_FAB)) + return OTP_FRESH_FROM_FAB; + else if ((buff[off1] == OTP_ENABLE_PATTERN) && + (buff[off2] == OTP_ENABLE_PATTERN) && + (buff[off3] == OTP_ENABLE_PATTERN) && + (buff[off4] == OTP_ENABLE_PATTERN)) + return OTP_ENABLE_PATTERN; + else + return OTP_INVALID; +} + + +static void set_otp_timing_reg_40mhz(void) +{ + write_word(OTP_TIMING_REG1_ADDR, OTP_TIMING_REG1_VAL); + write_word(OTP_TIMING_REG2_ADDR, OTP_TIMING_REG2_VAL); +} + +static int poll_otp_ready(void) +{ + int otp_mem_status = 0; + int poll = 0; + + while (poll != 100) { + read_word(OTP_POLL_ADDR, &otp_mem_status); + + if ((otp_mem_status & OTP_READY) == OTP_READY) { + return 0; + } + poll++; + } + LOG_ERR("OTP is not ready"); + return -ENOEXEC; +} + + +static int req_otp_standby_mode(void) +{ + write_word(OTP_RWSBMODE_ADDR, 0x0); + return poll_otp_ready(); +} + + +static int otp_wr_voltage_2V5(void) +{ + int err; + + err = req_otp_standby_mode(); + + if (err) { + LOG_ERR("Failed Setting OTP voltage IOVDD to 2.5V"); + return -ENOEXEC; + } + write_word(OTP_VOLTCTRL_ADDR, OTP_VOLTCTRL_2V5); + return 0; +} + +static int poll_otp_read_valid(void) +{ + int otp_mem_status = 0; + int poll = 0; + + while (poll < 100) { + read_word(OTP_POLL_ADDR, &otp_mem_status); + + if ((otp_mem_status & OTP_READ_VALID) == OTP_READ_VALID) { + return 0; + } + poll++; + } + LOG_ERR("%s: OTP read failed", __func__); + return -ENOEXEC; +} + +static int poll_otp_wrdone(void) +{ + int otp_mem_status = 0; + int poll = 0; + + while (poll < 100) { + read_word(OTP_POLL_ADDR, &otp_mem_status); + + if ((otp_mem_status & OTP_WR_DONE) == OTP_WR_DONE) { + return 0; + } + poll++; + } + LOG_ERR("%s: OTP write done failed", __func__); + return -ENOEXEC; +} + +static int req_otp_read_mode(void) +{ + write_word(OTP_RWSBMODE_ADDR, OTP_READ_MODE); + return poll_otp_ready(); +} + + +static int req_otp_byte_write_mode(void) +{ + write_word(OTP_RWSBMODE_ADDR, OTP_BYTE_WRITE_MODE); + return poll_otp_ready(); +} + +static unsigned int read_otp_location(unsigned int offset, unsigned int *read_val) +{ + int err; + + write_word(OTP_RDENABLE_ADDR, offset); + err = poll_otp_read_valid(); + if (err) { + LOG_ERR("OTP read failed"); + return err; + } + read_word(OTP_READREG_ADDR, read_val); + + return 0; +} + +static int write_otp_location(unsigned int otp_location_offset, unsigned int otp_data) +{ + write_word(OTP_WRENABLE_ADDR, otp_location_offset); + write_word(OTP_WRITEREG_ADDR, otp_data); + + return poll_otp_wrdone(); +} + + +static int otp_rd_voltage_1V8(void) +{ + int err; + + err = req_otp_standby_mode(); + if (err) { + LOG_ERR("error in %s", __func__); + return err; + } + write_word(OTP_VOLTCTRL_ADDR, OTP_VOLTCTRL_1V8); + + return 0; +} + +static int update_mac_addr(unsigned int index, unsigned int *write_val) +{ + int ret = 0; + + for (int i = 0; i < 2; i++) { + ret = write_otp_location(MAC0_ADDR + 2 * index + i, write_val[i]); + if (ret == -ENOEXEC) { + LOG_ERR("FICR: Failed to update MAC ADDR%d", index); + break; + } + LOG_INF("mac addr %d : Reg%d (0x%x) = 0x%04x", + index, (i+1), (MAC0_ADDR + i) << 2, write_val[i]); + } + return ret; +} + +int write_otp_memory(unsigned int otp_addr, unsigned int *write_val) +{ + int err = 0; + int mask_val; + int ret = 0; + int retrim_loc = 0; + + err = poll_otp_ready(); + if (err) { + LOG_ERR("err in otp ready poll"); + return err; + } + + set_otp_timing_reg_40mhz(); + + err = otp_wr_voltage_2V5(); + if (err) { + LOG_ERR("error in write_voltage 2V5"); + goto _exit_otp_write; + } + + err = req_otp_byte_write_mode(); + if (err) { + LOG_ERR("error in OTP byte write mode"); + goto _exit_otp_write; + } + + switch (otp_addr) { + case REGION_PROTECT: + write_otp_location(REGION_PROTECT, write_val[0]); + write_otp_location(REGION_PROTECT+1, write_val[0]); + write_otp_location(REGION_PROTECT+2, write_val[0]); + write_otp_location(REGION_PROTECT+3, write_val[0]); + + LOG_INF("Written REGION_PROTECT0 (0x%x) : 0x%04x", + (REGION_PROTECT << 2), write_val[0]); + LOG_INF("Written REGION_PROTECT1 (0x%x) : 0x%04x", + (REGION_PROTECT+1) << 2, write_val[0]); + LOG_INF("Written REGION_PROTECT2 (0x%x) : 0x%04x", + (REGION_PROTECT+2) << 2, write_val[0]); + LOG_INF("Written REGION_PROTECT3 (0x%x) : 0x%04x", + (REGION_PROTECT+3) << 2, write_val[0]); + break; + case QSPI_KEY: + mask_val = QSPI_KEY_FLAG_MASK; + for (int i = 0; i < QSPI_KEY_LENGTH_BYTES / 4; i++) { + ret = write_otp_location(QSPI_KEY + i, write_val[i]); + if (ret == -ENOEXEC) { + LOG_ERR("FICR: Failed to write QSPI key offset-%d", QSPI_KEY + i); + goto _exit_otp_write; + } + LOG_INF("Written QSPI_KEY0 (0x%x) : 0x%04x", + (QSPI_KEY + i) << 2, write_val[i]); + } + write_otp_location(REGION_DEFAULTS, mask_val); + LOG_INF("Written REGION_DEFAULTS (0x%x) : 0x%04x", + (REGION_DEFAULTS) << 2, mask_val); + break; + case MAC0_ADDR: + mask_val = MAC0_ADDR_FLAG_MASK; + ret = update_mac_addr(0, write_val); + if (ret == -ENOEXEC) { + goto _exit_otp_write; + } + + write_otp_location(REGION_DEFAULTS, mask_val); + LOG_INF("Written MAC address 0"); + LOG_INF("Written REGION_DEFAULTS (0x%x) : 0x%04x", + (REGION_DEFAULTS) << 2, mask_val); + break; + case MAC1_ADDR: + mask_val = MAC1_ADDR_FLAG_MASK; + ret = update_mac_addr(1, write_val); + if (ret == -ENOEXEC) { + goto _exit_otp_write; + } + write_otp_location(REGION_DEFAULTS, mask_val); + LOG_INF("Written MAC address 1"); + LOG_INF("Written REGION_DEFAULTS (0x%x) : 0x%04x", + (REGION_DEFAULTS) << 2, mask_val); + break; + case CALIB_XO: + mask_val = CALIB_XO_FLAG_MASK; + ret = write_otp_location(CALIB_XO, write_val[0]); + + if (ret == -ENOEXEC) { + LOG_ERR("XO_Update Exception"); + goto _exit_otp_write; + } else { + write_otp_location(REGION_DEFAULTS, mask_val); + + LOG_INF("Written CALIB_XO (0x%x) to 0x%04x", + CALIB_XO << 2, write_val[0]); + LOG_INF("Written REGION_DEFAULTS (0x%x) : 0x%04x", + (REGION_DEFAULTS) << 2, mask_val); + } + break; + case PRODRETEST_PROGVERSION: + ret = write_otp_location(PRODRETEST_PROGVERSION, *write_val); + + if (ret == -ENOEXEC) { + LOG_ERR("PRODRETEST.PROGVERSION_Update Exception"); + goto _exit_otp_write; + } else { + LOG_INF("Written PRODRETEST.PROGVERSION 0x%04x", *write_val); + } + break; + case PRODRETEST_TRIM0: + case PRODRETEST_TRIM1: + case PRODRETEST_TRIM2: + case PRODRETEST_TRIM3: + case PRODRETEST_TRIM4: + case PRODRETEST_TRIM5: + case PRODRETEST_TRIM6: + case PRODRETEST_TRIM7: + case PRODRETEST_TRIM8: + case PRODRETEST_TRIM9: + case PRODRETEST_TRIM10: + case PRODRETEST_TRIM11: + case PRODRETEST_TRIM12: + case PRODRETEST_TRIM13: + case PRODRETEST_TRIM14: + retrim_loc = otp_addr - PRODRETEST_TRIM0; + ret = write_otp_location(otp_addr, *write_val); + + if (ret == -ENOEXEC) { + LOG_ERR("PRODRETEST.TRIM_Update Exception"); + goto _exit_otp_write; + } else { + LOG_INF("Written PRODRETEST.TRIM%d 0x%04x", + retrim_loc, *write_val); + } + break; + case REGION_DEFAULTS: + write_otp_location(REGION_DEFAULTS, write_val[0]); + + LOG_INF("Written REGION_DEFAULTS (0x%x) to 0x%04x", + REGION_DEFAULTS << 2, write_val[0]); + break; + default: + LOG_ERR("unknown field received: %d", otp_addr); + + } + return ret; + +_exit_otp_write: + err = req_otp_standby_mode(); + err |= otp_rd_voltage_1V8(); + return err; +} + +int read_otp_memory(unsigned int otp_addr, unsigned int *read_val, int len) +{ + int err; + + err = poll_otp_ready(); + if (err) { + LOG_ERR("err in otp ready poll"); + return -ENOEXEC; + } + + set_otp_timing_reg_40mhz(); + + err = otp_rd_voltage_1V8(); + if (err) { + LOG_ERR("error in read_voltage 1V8"); + return -ENOEXEC; + } + + err = req_otp_read_mode(); + if (err) { + LOG_ERR("error in req_otp_read_mode()"); + return -ENOEXEC; + } + + for (int i = 0; i < len; i++) { + read_otp_location(otp_addr + i, &read_val[i]); + } + + return req_otp_standby_mode(); +} diff --git a/samples/wifi/radio_test/src/ficr_prog.h b/samples/wifi/radio_test/src/ficr_prog.h new file mode 100644 index 000000000000..a9c3eb424841 --- /dev/null +++ b/samples/wifi/radio_test/src/ficr_prog.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/** + * @brief Header containing address/offets and functions for writing + * the FICR fields of the OTP memory on nRF7002 device + */ + +#ifndef __OTP_PROG_H_ +#define __OTP_PROG_H_ + +#include +#include + +int write_otp_memory(unsigned int otp_addr, unsigned int *write_val); +int read_otp_memory(unsigned int otp_addr, unsigned int *read_val, int len); +unsigned int check_protection(unsigned int *buff, unsigned int off1, unsigned int off2, + unsigned int off3, unsigned int off4); + +#endif /* __OTP_PROG_H_ */ From 6e58c861b79aaa6bb86187dc2d372abe040f5edb Mon Sep 17 00:00:00 2001 From: "Bansidhar P.M" Date: Tue, 3 Dec 2024 22:44:46 +0530 Subject: [PATCH 14/46] samples: wifi: radio_test: Disable combo build by default Default build should be Wi-Fi radio test and the Wi-Fi and ble combo build should be enabled via sysbuild Kconfig symbol. Signed-off-by: Bansidhar P.M --- samples/wifi/radio_test/Kconfig.sysbuild | 3 +-- samples/wifi/radio_test/sample.yaml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/samples/wifi/radio_test/Kconfig.sysbuild b/samples/wifi/radio_test/Kconfig.sysbuild index 598cabd66662..6e481f834bd6 100644 --- a/samples/wifi/radio_test/Kconfig.sysbuild +++ b/samples/wifi/radio_test/Kconfig.sysbuild @@ -8,8 +8,7 @@ menu "Network core configuration" depends on SUPPORT_NETCORE config SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST - bool - default y + bool "wi-fi ble radio test combo build" choice NETCORE prompt "Netcore image" diff --git a/samples/wifi/radio_test/sample.yaml b/samples/wifi/radio_test/sample.yaml index 9ed18d9e8db1..d8285a70f996 100644 --- a/samples/wifi/radio_test/sample.yaml +++ b/samples/wifi/radio_test/sample.yaml @@ -21,7 +21,7 @@ tests: sample.nrf7002.radio_test_combo: sysbuild: true build_only: true - extra_args: CONFIG_NRF70_RADIO_TEST_COMBO=y + extra_args: SB_CONFIG_SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST=y integration_platforms: - nrf7002dk/nrf5340/cpuapp platform_allow: nrf7002dk/nrf5340/cpuapp @@ -29,7 +29,7 @@ tests: sample.nrf5340.radio_test_combo: sysbuild: true build_only: true - extra_args: SHIELD=nrf7002ek CONFIG_NRF70_RADIO_TEST_COMBO=y + extra_args: SHIELD=nrf7002ek SB_CONFIG_SUPPORT_NETCORE_PERIPHERAL_RADIO_TEST=y integration_platforms: - nrf5340dk/nrf5340/cpuapp platform_allow: nrf5340dk/nrf5340/cpuapp From 83cec800b34d9d2a260fae578d1230dfedeb3c1e Mon Sep 17 00:00:00 2001 From: "Bansidhar P.M" Date: Wed, 4 Dec 2024 16:11:34 +0530 Subject: [PATCH 15/46] wifi: Sync with nrf70 buslib changes Fix build error due to nrf70 buslib changes. Signed-off-by: Bansidhar P.M --- samples/wifi/sta/src/main.c | 2 +- .../overlay-nrf70-driver-verbose-debug.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/wifi/sta/src/main.c b/samples/wifi/sta/src/main.c index a8196f693942..fdfb3ae458f5 100644 --- a/samples/wifi/sta/src/main.c +++ b/samples/wifi/sta/src/main.c @@ -28,7 +28,7 @@ LOG_MODULE_REGISTER(sta, CONFIG_LOG_DEFAULT_LEVEL); #if defined(CONFIG_BOARD_NRF7002DK_NRF7001_NRF5340_CPUAPP) || \ defined(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP) -#include +#include #endif #include "net_private.h" diff --git a/snippets/nrf70-driver-verbose-debug/overlay-nrf70-driver-verbose-debug.conf b/snippets/nrf70-driver-verbose-debug/overlay-nrf70-driver-verbose-debug.conf index 077a179e5d21..26dbd2c1f053 100644 --- a/snippets/nrf70-driver-verbose-debug/overlay-nrf70-driver-verbose-debug.conf +++ b/snippets/nrf70-driver-verbose-debug/overlay-nrf70-driver-verbose-debug.conf @@ -19,4 +19,4 @@ CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_PRINTK=y CONFIG_WIFI_NRF70_LOG_LEVEL_DBG=y -CONFIG_WIFI_NRF70_BUS_LOG_LEVEL_DBG=y +CONFIG_WIFI_NRF70_BUSLIB_LOG_LEVEL_DBG=y From 433b8502861def27641638ea9990a26b9834a001 Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Thu, 28 Nov 2024 16:15:07 +0100 Subject: [PATCH 16/46] samples: nrf54l: remove direct RAM retention management RAM retention is now managed within sys_poweroff() call. Signed-off-by: Nikodem Kastelik --- .../bluetooth/peripheral_power_profiling/src/main.c | 11 ----------- samples/nfc/system_off/src/main.c | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/samples/bluetooth/peripheral_power_profiling/src/main.c b/samples/bluetooth/peripheral_power_profiling/src/main.c index 879f286fc138..7fc66c25b157 100644 --- a/samples/bluetooth/peripheral_power_profiling/src/main.c +++ b/samples/bluetooth/peripheral_power_profiling/src/main.c @@ -27,9 +27,6 @@ #include #include -#ifdef CONFIG_SOC_NRF54L15_CPUAPP -#include -#endif #include "pwr_service.h" @@ -682,14 +679,6 @@ static void system_off(void) } } -#ifdef CONFIG_SOC_NRF54L15_CPUAPP - /* Disable RAM retention in System OFF as it is not utilized by this sample. */ - uint32_t ram_sections = 8; - - nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false); - nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false); -#endif - sys_poweroff(); #endif /* !IS_ENABLED(CONFIG_SOC_SERIES_NRF54HX) */ } diff --git a/samples/nfc/system_off/src/main.c b/samples/nfc/system_off/src/main.c index 46202c340f5d..be3619c36900 100644 --- a/samples/nfc/system_off/src/main.c +++ b/samples/nfc/system_off/src/main.c @@ -20,9 +20,6 @@ #include #include -#ifdef CONFIG_SOC_NRF54L15_CPUAPP -#include -#endif #define SYSTEM_OFF_DELAY_S 3 @@ -150,14 +147,6 @@ static void system_off(struct k_work *work) } } -#ifdef CONFIG_SOC_NRF54L15_CPUAPP - /* Disable RAM retention in System OFF as it is not utilized by this sample. */ - uint32_t ram_sections = 8; - - nrf_memconf_ramblock_ret_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false); - nrf_memconf_ramblock_ret2_mask_enable_set(NRF_MEMCONF, 0, BIT_MASK(ram_sections), false); -#endif - sys_poweroff(); } From 14d73e312172994c94c844553f9265f6c4df209d Mon Sep 17 00:00:00 2001 From: Nikodem Kastelik Date: Fri, 29 Nov 2024 13:00:43 +0100 Subject: [PATCH 17/46] benchmarks: system_off: align to new RAM retention in system_off sample Zephyr system_off sample changed how RAM retention is handled. Signed-off-by: Nikodem Kastelik --- .../boards/nrf52840dk_nrf52840.overlay | 22 ++++++++++ .../boards/nrf52dk_nrf52832.overlay | 22 ++++++++++ .../boards/nrf54l15dk_nrf54l05_cpuapp.overlay | 25 +++++++++++ .../boards/nrf54l15dk_nrf54l10_cpuapp.overlay | 25 +++++++++++ ...lay => nrf54l15dk_nrf54l15_cpuapp.overlay} | 0 .../system_off/testcase.yaml | 43 ++++++++----------- 6 files changed, 111 insertions(+), 26 deletions(-) create mode 100644 tests/benchmarks/current_consumption/system_off/boards/nrf52840dk_nrf52840.overlay create mode 100644 tests/benchmarks/current_consumption/system_off/boards/nrf52dk_nrf52832.overlay create mode 100644 tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l05_cpuapp.overlay create mode 100644 tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l10_cpuapp.overlay rename tests/benchmarks/current_consumption/system_off/boards/{nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay => nrf54l15dk_nrf54l15_cpuapp.overlay} (100%) diff --git a/tests/benchmarks/current_consumption/system_off/boards/nrf52840dk_nrf52840.overlay b/tests/benchmarks/current_consumption/system_off/boards/nrf52840dk_nrf52840.overlay new file mode 100644 index 000000000000..c203d90a0a14 --- /dev/null +++ b/tests/benchmarks/current_consumption/system_off/boards/nrf52840dk_nrf52840.overlay @@ -0,0 +1,22 @@ +/ { + sram0@2003f000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2003f000 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&sram0 { + /* Shrink SRAM size to avoid overlap with retained memory region */ + reg = <0x20000000 DT_SIZE_K(252)>; +}; diff --git a/tests/benchmarks/current_consumption/system_off/boards/nrf52dk_nrf52832.overlay b/tests/benchmarks/current_consumption/system_off/boards/nrf52dk_nrf52832.overlay new file mode 100644 index 000000000000..13e2e99ddf28 --- /dev/null +++ b/tests/benchmarks/current_consumption/system_off/boards/nrf52dk_nrf52832.overlay @@ -0,0 +1,22 @@ +/ { + sram0@20007000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x20007000 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&sram0 { + /* Shrink SRAM size to avoid overlap with retained memory region */ + reg = <0x20000000 DT_SIZE_K(28)>; +}; diff --git a/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l05_cpuapp.overlay b/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l05_cpuapp.overlay new file mode 100644 index 000000000000..6f4a9be80f9b --- /dev/null +++ b/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l05_cpuapp.overlay @@ -0,0 +1,25 @@ +/ { + cpuapp_sram@20017000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x20017000 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region: + * 96 - 4 = 92KB = 0x17000 + */ + reg = <0x20000000 0x17000>; + ranges = <0x0 0x20000000 0x17000>; +}; diff --git a/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l10_cpuapp.overlay b/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l10_cpuapp.overlay new file mode 100644 index 000000000000..9705cf335a7f --- /dev/null +++ b/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l10_cpuapp.overlay @@ -0,0 +1,25 @@ +/ { + cpuapp_sram@2002f000 { + compatible = "zephyr,memory-region", "mmio-sram"; + reg = <0x2002f000 DT_SIZE_K(4)>; + zephyr,memory-region = "RetainedMem"; + status = "okay"; + + retainedmem0: retainedmem { + compatible = "zephyr,retained-ram"; + status = "okay"; + }; + }; + + aliases { + retainedmemdevice = &retainedmem0; + }; +}; + +&cpuapp_sram { + /* Shrink SRAM size to avoid overlap with retained memory region: + * 192 - 4 = 188KB = 0x2f000 + */ + reg = <0x20000000 0x2f000>; + ranges = <0x0 0x20000000 0x2f000>; +}; diff --git a/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay b/tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l15_cpuapp.overlay similarity index 100% rename from tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay rename to tests/benchmarks/current_consumption/system_off/boards/nrf54l15dk_nrf54l15_cpuapp.overlay diff --git a/tests/benchmarks/current_consumption/system_off/testcase.yaml b/tests/benchmarks/current_consumption/system_off/testcase.yaml index 717052bf0d98..ad781fd87f38 100644 --- a/tests/benchmarks/current_consumption/system_off/testcase.yaml +++ b/tests/benchmarks/current_consumption/system_off/testcase.yaml @@ -6,6 +6,8 @@ tests: benchmarks.current_consumption.systemoff.gpio_wakeup: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l05/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_gpio_wakeup.overlay" @@ -15,18 +17,16 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_with_wakeups" timeout: 80 - benchmarks.current_consumption.systemoff.gpio_wakeup_retained_mem: + benchmarks.current_consumption.systemoff.gpio_wakeup.retained_mem: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l05/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp - extra_args: - - "DTC_OVERLAY_FILE= - boards/nrf54l15dk_nrf54l15_cpuapp_gpio_wakeup.overlay; - boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay" + extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf54l15dk_nrf54l15_cpuapp_gpio_wakeup.overlay" extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y - - CONFIG_RETAINED_MEM=y harness: pytest harness_config: fixture: ppk_power_measure @@ -36,6 +36,8 @@ tests: benchmarks.current_consumption.systemoff.grtc_wakeup: platform_allow: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l05/cpuapp integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_configs: @@ -48,15 +50,17 @@ tests: timeout: 80 benchmarks.current_consumption.sample.boards.nrf.system_off: platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - nrf52840dk/nrf52840 - nrf52dk/nrf52832 - nrf5340dk/nrf5340/cpuapp - integration_platforms: - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l05/cpuapp + integration_platforms: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp tags: ppk_power_measure harness: pytest harness_config: @@ -64,34 +68,21 @@ tests: pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_systemoff" timeout: 90 - benchmarks.current_consumption.sample.boards.nrf.system_off.nrf_retained: + benchmarks.current_consumption.sample.boards.nrf.system_off.retained_mem: platform_allow: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 - - nrf5340dk/nrf5340/cpuapp + - nrf54l15dk/nrf54l15/cpuapp + - nrf54l15dk/nrf54l10/cpuapp + - nrf54l15dk/nrf54l05/cpuapp integration_platforms: - nrf52840dk/nrf52840 - nrf52dk/nrf52832 - - nrf5340dk/nrf5340/cpuapp - extra_configs: - - CONFIG_APP_USE_NRF_RETENTION=y - tags: ppk_power_measure - harness: pytest - harness_config: - fixture: ppk_power_measure - pytest_root: - - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_power_consumption_systemoff" - timeout: 90 - benchmarks.current_consumption.sample.boards.nrf.system_off.retained_mem: - platform_allow: - - nrf54l15dk/nrf54l15/cpuapp - integration_platforms: - nrf54l15dk/nrf54l15/cpuapp extra_args: - - "DTC_OVERLAY_FILE=boards/nrf54l15dk_nrf54l15_cpuapp_ret_mem.overlay" + - "-DBOARD_ROOT=${ZEPHYR_BASE}/samples/boards/nordic/system_off" extra_configs: - CONFIG_APP_USE_RETAINED_MEM=y - - CONFIG_RETAINED_MEM=y tags: ppk_power_measure harness: pytest harness_config: From f11550ae84c7d056b7cd90480aeb1d449bbdcece Mon Sep 17 00:00:00 2001 From: Nordic Builder Date: Fri, 29 Nov 2024 08:57:16 +0000 Subject: [PATCH 18/46] manifest: Update sdk-nrfxlib revision (auto-manifest PR) Automatically created by Github Action Signed-off-by: Nordic Builder --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index 1e6df46e0013..04a975e70af1 100644 --- a/west.yml +++ b/west.yml @@ -147,7 +147,7 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: 84157212bb4e45454869ee07822605f8f00ad551 + revision: c4a3e93743d4025c509a931d58fa744292d0f121 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m @@ -178,7 +178,7 @@ manifest: - name: nrf-802154 repo-path: sdk-nrf-802154 path: nrf-802154 - revision: 5681104b148c48f9e51b89614fca28357dd0ad5f + revision: b5764deaf3c05fc4343a17ed2ac86e07589af4bb groups: - nrf-802154 - name: soc-hwmv1 From 450527356f3bf758c103d3120ff6ddece2645f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ku=C5=BAnia?= Date: Thu, 21 Nov 2024 16:38:44 +0100 Subject: [PATCH 19/46] modules: nrfxlib: nrf_802154: Use DPPI and PPIB allocators MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GRTC LPTIMER platform implementation now uses the DPPI and PPIB allocators provided by NRFX, which avoids conflicts with other modules. Signed-off-by: Rafał Kuźnia --- ..._802154_platform_sl_lptimer_grtc_hw_task.c | 81 +++++++++++-------- .../nrf_802154_platform_timestamper.c | 54 +++++++------ 2 files changed, 75 insertions(+), 60 deletions(-) diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c index c3b9d22dbc01..30cd47292290 100644 --- a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_sl_lptimer_grtc_hw_task.c @@ -226,6 +226,9 @@ void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) #elif defined(NRF54L_SERIES) +#include +#include + /* To trigger GRTC.TASKS_CAPTURE[#cc] with RADIO.EVENT_{?}, the following connection chain must be * created: * - starting from RADIO domain (_R_): @@ -238,71 +241,81 @@ void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) * {e} DPPIC_20 <-- GRTC.CC */ -/* Peripherals used for timestamping - located in radio power domain (_R_) */ -/* - DPPIC_L : DPPIC10 */ -#define DPPIC_R_INST NRF_DPPIC10 -#define PPIB_R_INST NRF_PPIB11 +#define INVALID_CHANNEL UINT8_MAX -/* Peripherals used for timestamping - located in peripheral power domain (_P_) */ +static nrfx_dppi_t dppi20 = NRFX_DPPI_INSTANCE(20); +static nrfx_ppib_interconnect_t ppib11_21 = NRFX_PPIB_INTERCONNECT_INSTANCE(11, 21); +static uint8_t peri_dppi_ch = INVALID_CHANNEL; +static uint8_t peri_ppib_ch = INVALID_CHANNEL; -/* - DPPIC_P : DPPIC20 */ -#define DPPIC_P_INST NRF_DPPIC20 +void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(uint32_t cc_channel) +{ + nrfx_err_t err; -/* - PPIB_P : PPIB21 */ -#define PPIB_P_INST NRF_PPIB21 + err = nrfx_dppi_channel_alloc(&dppi20, &peri_dppi_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); -static uint32_t m_dppi_ch = NRF_802154_SL_HW_TASK_PPI_INVALID; + err = nrfx_ppib_channel_alloc(&ppib11_21, &peri_ppib_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); -void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_setup(uint32_t cc_channel) -{ - /* Intentionally empty. */ + /* {c} PPIB_11 <-- PPIB_21 + * One of HW-fixed connections, so nothing to do. + */ + + /* {d} PPIB_21 <-- DPPIC_20 */ + NRF_DPPI_ENDPOINT_SETUP( + nrfx_ppib_send_task_address_get(&ppib11_21.right, peri_ppib_ch), peri_dppi_ch); + + /* {e} DPPIC_20 <-- GRTC.CC */ + NRF_DPPI_ENDPOINT_SETUP( + z_nrf_grtc_timer_compare_evt_address_get(cc_channel), peri_dppi_ch); } void nrf_802154_platform_sl_lptimer_hw_task_cross_domain_connections_clear(void) { - /* Intentionally empty. */ + nrfx_err_t err; + + err = nrfx_ppib_channel_free(&ppib11_21, peri_ppib_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); + + err = nrfx_dppi_channel_free(&dppi20, peri_dppi_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); + + peri_dppi_ch = INVALID_CHANNEL; + peri_ppib_ch = INVALID_CHANNEL; } void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_setup(uint32_t dppi_ch, uint32_t cc_channel) { + nrfx_err_t err; + if (dppi_ch == NRF_802154_SL_HW_TASK_PPI_INVALID) { return; } - m_dppi_ch = dppi_ch; - /* {a} RADIO.TASKS_{?} <-- DPPIC_10[dppi_ch] * It is the responsibility of the user of this platform to make the {a} connection * and pass the DPPI channel number as a parameter here. */ /* {b} DPPIC_10 <-- PPIB_11 */ - nrf_ppib_publish_set(PPIB_R_INST, nrf_ppib_receive_event_get(dppi_ch), dppi_ch); - - /* {c} PPIB_11 <-- PPIB_21 - * One of HW-fixed connections, so nothing to do. - */ - - /* {d} PPIB_21 <-- DPPIC_20 */ - nrf_ppib_subscribe_set(PPIB_P_INST, nrf_ppib_send_task_get(dppi_ch), dppi_ch); - - /* {e} DPPIC_20 <-- GRTC.CC */ NRF_DPPI_ENDPOINT_SETUP( - z_nrf_grtc_timer_compare_evt_address_get(cc_channel), dppi_ch); + nrfx_ppib_receive_event_address_get(&ppib11_21.left, peri_ppib_ch), dppi_ch); - nrfy_dppi_channels_enable(DPPIC_P_INST, 1UL << dppi_ch); + err = nrfx_dppi_channel_enable(&dppi20, peri_dppi_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); } void nrf_802154_platform_sl_lptimer_hw_task_local_domain_connections_clear(void) { - uint32_t dppi_ch = m_dppi_ch; + nrfx_err_t err; - if (dppi_ch != NRF_802154_SL_HW_TASK_PPI_INVALID) { - nrf_ppib_subscribe_clear(PPIB_R_INST, nrf_ppib_send_task_get(dppi_ch)); - nrf_ppib_publish_clear(PPIB_P_INST, nrf_ppib_receive_event_get(dppi_ch)); - nrfy_dppi_channels_disable(DPPIC_P_INST, 1UL << dppi_ch); - } + NRF_DPPI_ENDPOINT_CLEAR( + nrfx_ppib_receive_event_address_get(&ppib11_21.left, peri_ppib_ch)); + + err = nrfx_dppi_channel_disable(&dppi20, peri_dppi_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); } #endif diff --git a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c index ea6aec6c2b2b..fe53cc6fe9df 100644 --- a/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c +++ b/modules/nrfxlib/nrf_802154/sl/platform/nrf_802154_platform_timestamper.c @@ -227,22 +227,37 @@ void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dpp * {e} DPPIC_20 --> GRTC.CC */ -/* Peripherals used for timestamping - located in radio power domain (_R_) */ -/* - DPPIC_L : DPPIC10 */ -#define DPPIC_R_INST NRF_DPPIC10 -#define PPIB_R_INST NRF_PPIB11 +#include +#include -/* Peripherals used for timestamping - located in peripheral power domain (_P_) */ +#define INVALID_CHANNEL UINT8_MAX -/* - DPPIC_P : DPPIC20 */ -#define DPPIC_P_INST NRF_DPPIC20 - -/* - PPIB_P : PPIB21 */ -#define PPIB_P_INST NRF_PPIB21 +static nrfx_dppi_t dppi20 = NRFX_DPPI_INSTANCE(20); +static nrfx_ppib_interconnect_t ppib11_21 = NRFX_PPIB_INTERCONNECT_INSTANCE(11, 21); +static uint8_t peri_dppi_ch = INVALID_CHANNEL; +static uint8_t peri_ppib_ch = INVALID_CHANNEL; void nrf_802154_platform_timestamper_cross_domain_connections_setup(void) { - /* Intentionally empty. */ + nrfx_err_t err; + + err = nrfx_dppi_channel_alloc(&dppi20, &peri_dppi_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); + + err = nrfx_ppib_channel_alloc(&ppib11_21, &peri_ppib_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); + + /* {d} PPIB_21 --> DPPIC_20 */ + NRF_DPPI_ENDPOINT_SETUP( + nrfx_ppib_receive_event_address_get(&ppib11_21.right, peri_ppib_ch), peri_dppi_ch); + + /* {e} DPPIC_20[dppi_ch] --> GRTC.CC[cc_channel] */ + nrf_grtc_task_t capture_task = + nrfy_grtc_sys_counter_capture_task_get(m_timestamp_cc_channel); + NRF_DPPI_ENDPOINT_SETUP(nrfy_grtc_task_address_get(NRF_GRTC, capture_task), peri_dppi_ch); + + err = nrfx_dppi_channel_enable(&dppi20, peri_dppi_ch); + __ASSERT_NO_MSG(err == NRFX_SUCCESS); } void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dppi_ch) @@ -255,21 +270,8 @@ void nrf_802154_platform_timestamper_local_domain_connections_setup(uint32_t dpp */ /* {b} DPPIC_10 --> PPIB_11 */ - nrf_ppib_subscribe_set(PPIB_R_INST, nrf_ppib_send_task_get(dppi_ch), dppi_ch); - - /* {c} PPIB_11 --> PPIB_21 - * One of HW-fixed connections, so nothing to do. - */ - - /* {d} PPIB_21 --> DPPIC_20 */ - nrf_ppib_publish_set(PPIB_P_INST, nrf_ppib_receive_event_get(dppi_ch), dppi_ch); - - /* {e} DPPIC_20[dppi_ch] --> GRTC.CC[cc_channel] */ - nrf_grtc_task_t capture_task = - nrfy_grtc_sys_counter_capture_task_get(m_timestamp_cc_channel); - NRF_DPPI_ENDPOINT_SETUP(nrfy_grtc_task_address_get(NRF_GRTC, capture_task), dppi_ch); - - nrfy_dppi_channels_enable(DPPIC_P_INST, 1UL << dppi_ch); + NRF_DPPI_ENDPOINT_SETUP( + nrfx_ppib_send_task_address_get(&ppib11_21.left, peri_ppib_ch), dppi_ch); } #endif From 51c15dab75fd3665c5c572dd3b2b92f36d902ebd Mon Sep 17 00:00:00 2001 From: Maciej Baczmanski Date: Mon, 2 Dec 2024 09:19:40 +0100 Subject: [PATCH 20/46] samples: matter: bootloader size optimizations Add LTO and size optimization configs for mcuboot and remove redundant configs. Set mcuboot size to `0xD000` for nRF54Lxx Remove PDK overlays. Signed-off-by: Maciej Baczmanski --- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../light_bulb/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../light_switch/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- samples/matter/lock/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- .../smoke_co_alarm/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...ic_nrf54l15dk_nrf54l15_cpuapp_internal.yml | 30 ++++++++-------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../matter/template/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../thermostat/sysbuild/mcuboot/prj.conf | 7 ++-- .../pm_static_nrf54l15dk_nrf54l15_cpuapp.yml | 26 +++++++------- ...m_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml | 34 +++++++++---------- .../boards/nrf54l15pdk_nrf54l15_cpuapp.conf | 32 ----------------- .../nrf54l15pdk_nrf54l15_cpuapp.overlay | 25 -------------- .../window_covering/sysbuild/mcuboot/prj.conf | 7 ++-- 33 files changed, 243 insertions(+), 564 deletions(-) delete mode 100644 samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay delete mode 100644 samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf delete mode 100644 samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay diff --git a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 mcuboot_primary: orig_span: &id001 - mcuboot_pad - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x166000 + size: 0x165000 mcuboot_primary_app: orig_span: &id002 - app span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 factory_data: address: 0x172000 region: flash_primary @@ -32,14 +32,14 @@ factory_data: settings_storage: address: 0x173000 region: flash_primary - size: 0xa000 + size: 0xA000 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x166000 + size: 0x165000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -48,9 +48,9 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x165800 + size: 0x164800 external_flash: - address: 0x166000 - size: 0x69a000 + address: 0x165000 + size: 0x69B000 device: MX25R64 region: external_flash diff --git a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/light_bulb/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 tfm: - address: 0xc800 + address: 0xD800 region: flash_primary size: 0x1F800 app: - address: 0x2C000 + address: 0x2D000 region: flash_primary - size: 0x13E000 + size: 0x13D000 factory_data: address: 0x16A000 region: flash_primary @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -33,8 +33,8 @@ tfm_storage: size: 0x8000 span: *id006 external_flash: - address: 0x15E000 - size: 0x6A2000 + address: 0x15D000 + size: 0x6A3000 device: MX25R64 region: external_flash ### Bootloader configuration @@ -44,24 +44,24 @@ mcuboot_primary: - tfm - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x15E000 + size: 0x15D000 mcuboot_primary_app: orig_span: &id002 - app - tfm span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x15D800 + size: 0x15C800 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x15E000 + size: 0x15D000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -70,10 +70,10 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x15D800 + size: 0x15C800 ### TFM configuration tfm_secure: - address: 0xc000 + address: 0xD000 orig_span: &id004 - mcuboot_pad - tfm @@ -81,11 +81,11 @@ tfm_secure: size: 0x20000 span: *id004 tfm_nonsecure: - address: 0x2C000 + address: 0x2D000 orig_span: &id005 - app region: flash_primary - size: 0x13E000 + size: 0x13D000 span: *id005 tfm_its: address: 0x175000 diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/light_bulb/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf b/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf +++ b/samples/matter/light_bulb/sysbuild/mcuboot/prj.conf @@ -13,8 +13,6 @@ CONFIG_PM=n CONFIG_FLASH=y CONFIG_FPROTECT=y -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_NRF_ENABLE_ICACHE=n +CONFIG_SIZE_OPTIMIZATIONS=y + +# Activate LTO +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 mcuboot_primary: orig_span: &id001 - mcuboot_pad - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x166000 + size: 0x165000 mcuboot_primary_app: orig_span: &id002 - app span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 factory_data: address: 0x172000 region: flash_primary @@ -32,14 +32,14 @@ factory_data: settings_storage: address: 0x173000 region: flash_primary - size: 0xa000 + size: 0xA000 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x166000 + size: 0x165000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -48,9 +48,9 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x165800 + size: 0x164800 external_flash: - address: 0x166000 - size: 0x69a000 + address: 0x165000 + size: 0x69B000 device: MX25R64 region: external_flash diff --git a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/light_switch/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 tfm: - address: 0xc800 + address: 0xD800 region: flash_primary size: 0x1F800 app: - address: 0x2C000 + address: 0x2D000 region: flash_primary - size: 0x13E000 + size: 0x13D000 factory_data: address: 0x16A000 region: flash_primary @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -33,8 +33,8 @@ tfm_storage: size: 0x8000 span: *id006 external_flash: - address: 0x15E000 - size: 0x6A2000 + address: 0x15D000 + size: 0x6A3000 device: MX25R64 region: external_flash ### Bootloader configuration @@ -44,24 +44,24 @@ mcuboot_primary: - tfm - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x15E000 + size: 0x15D000 mcuboot_primary_app: orig_span: &id002 - app - tfm span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x15D800 + size: 0x15C800 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x15E000 + size: 0x15D000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -70,10 +70,10 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x15D800 + size: 0x15C800 ### TFM configuration tfm_secure: - address: 0xc000 + address: 0xD000 orig_span: &id004 - mcuboot_pad - tfm @@ -81,11 +81,11 @@ tfm_secure: size: 0x20000 span: *id004 tfm_nonsecure: - address: 0x2C000 + address: 0x2D000 orig_span: &id005 - app region: flash_primary - size: 0x13E000 + size: 0x13D000 span: *id005 tfm_its: address: 0x175000 diff --git a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/light_switch/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/light_switch/sysbuild/mcuboot/prj.conf b/samples/matter/light_switch/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/light_switch/sysbuild/mcuboot/prj.conf +++ b/samples/matter/light_switch/sysbuild/mcuboot/prj.conf @@ -13,8 +13,6 @@ CONFIG_PM=n CONFIG_FLASH=y CONFIG_FPROTECT=y -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_NRF_ENABLE_ICACHE=n +CONFIG_SIZE_OPTIMIZATIONS=y + +# Activate LTO +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 mcuboot_primary: orig_span: &id001 - mcuboot_pad - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x166000 + size: 0x165000 mcuboot_primary_app: orig_span: &id002 - app span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 factory_data: address: 0x172000 region: flash_primary @@ -32,14 +32,14 @@ factory_data: settings_storage: address: 0x173000 region: flash_primary - size: 0xa000 + size: 0xA000 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x166000 + size: 0x165000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -48,9 +48,9 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x165800 + size: 0x164800 external_flash: - address: 0x166000 - size: 0x69a000 + address: 0x165000 + size: 0x69B000 device: MX25R64 region: external_flash diff --git a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/lock/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 tfm: - address: 0xc800 + address: 0xD800 region: flash_primary size: 0x1F800 app: - address: 0x2C000 + address: 0x2D000 region: flash_primary - size: 0x13E000 + size: 0x13D000 factory_data: address: 0x16A000 region: flash_primary @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -33,8 +33,8 @@ tfm_storage: size: 0x8000 span: *id006 external_flash: - address: 0x15E000 - size: 0x6A2000 + address: 0x15D000 + size: 0x6A3000 device: MX25R64 region: external_flash ### Bootloader configuration @@ -44,24 +44,24 @@ mcuboot_primary: - tfm - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x15E000 + size: 0x15D000 mcuboot_primary_app: orig_span: &id002 - app - tfm span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x15D800 + size: 0x15C800 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x15E000 + size: 0x15D000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -70,10 +70,10 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x15D800 + size: 0x15C800 ### TFM configuration tfm_secure: - address: 0xc000 + address: 0xD000 orig_span: &id004 - mcuboot_pad - tfm @@ -81,11 +81,11 @@ tfm_secure: size: 0x20000 span: *id004 tfm_nonsecure: - address: 0x2C000 + address: 0x2D000 orig_span: &id005 - app region: flash_primary - size: 0x13E000 + size: 0x13D000 span: *id005 tfm_its: address: 0x175000 diff --git a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/lock/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/lock/sysbuild/mcuboot/prj.conf b/samples/matter/lock/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/lock/sysbuild/mcuboot/prj.conf +++ b/samples/matter/lock/sysbuild/mcuboot/prj.conf @@ -13,8 +13,6 @@ CONFIG_PM=n CONFIG_FLASH=y CONFIG_FPROTECT=y -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_NRF_ENABLE_ICACHE=n +CONFIG_SIZE_OPTIMIZATIONS=y + +# Activate LTO +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/smoke_co_alarm/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 mcuboot_primary: orig_span: &id001 - mcuboot_pad - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x166000 + size: 0x165000 mcuboot_primary_app: orig_span: &id002 - app span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 factory_data: address: 0x172000 region: flash_primary @@ -32,14 +32,14 @@ factory_data: settings_storage: address: 0x173000 region: flash_primary - size: 0xa000 + size: 0xA000 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x166000 + size: 0x165000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -48,9 +48,9 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x165800 + size: 0x164800 external_flash: - address: 0x166000 - size: 0x69a000 + address: 0x165000 + size: 0x69B000 device: MX25R64 region: external_flash diff --git a/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf b/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf index ac67aa9b15d9..17b3e8b90ff3 100644 --- a/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf +++ b/samples/matter/smoke_co_alarm/sysbuild/mcuboot/prj.conf @@ -13,8 +13,6 @@ CONFIG_PM=n CONFIG_FLASH=y CONFIG_FPROTECT=y -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_NRF_ENABLE_ICACHE=n +CONFIG_SIZE_OPTIMIZATIONS=y + +# Activate LTO +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 mcuboot_primary: orig_span: &id001 - mcuboot_pad - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x166000 + size: 0x165000 mcuboot_primary_app: orig_span: &id002 - app span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 factory_data: address: 0x172000 region: flash_primary @@ -32,14 +32,14 @@ factory_data: settings_storage: address: 0x173000 region: flash_primary - size: 0xa000 + size: 0xA000 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x166000 + size: 0x165000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -48,9 +48,9 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x165800 + size: 0x164800 external_flash: - address: 0x166000 - size: 0x69a000 + address: 0x165000 + size: 0x69B000 device: MX25R64 region: external_flash diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml index 1b34a86cb297..a73ddb883041 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml @@ -1,32 +1,32 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xa000 + size: 0xD000 mcuboot_pad: - address: 0xa000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xa800 + address: 0xD800 region: flash_primary - size: 0xd6800 + size: 0xD4800 mcuboot_primary: - address: 0xa000 + address: 0xD000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xd7000 + size: 0xD5000 span: *id001 mcuboot_primary_app: - address: 0xa800 + address: 0xD800 orig_span: &id002 - app region: flash_primary - size: 0xd6800 + size: 0xD4800 span: *id002 mcuboot_secondary: - address: 0xe1000 + address: 0xE2000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app @@ -35,17 +35,17 @@ mcuboot_secondary: span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xe1000 + address: 0xE2000 size: 0x800 mcuboot_secondary_app: region: flash_primary - address: 0xe1800 - size: 0x8f800 + address: 0xE2800 + size: 0x8F800 factory_data: - address: 0x171000 + address: 0x172000 region: flash_primary size: 0x1000 settings_storage: - address: 0x172000 + address: 0x173000 region: flash_primary - size: 0xb000 + size: 0xA000 diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 tfm: - address: 0xc800 + address: 0xD800 region: flash_primary size: 0x1F800 app: - address: 0x2C000 + address: 0x2D000 region: flash_primary - size: 0x13E000 + size: 0x13D000 factory_data: address: 0x16A000 region: flash_primary @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -33,8 +33,8 @@ tfm_storage: size: 0x8000 span: *id006 external_flash: - address: 0x15E000 - size: 0x6A2000 + address: 0x15D000 + size: 0x6A3000 device: MX25R64 region: external_flash ### Bootloader configuration @@ -44,24 +44,24 @@ mcuboot_primary: - tfm - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x15E000 + size: 0x15D000 mcuboot_primary_app: orig_span: &id002 - app - tfm span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x15D800 + size: 0x15C800 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x15E000 + size: 0x15D000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -70,10 +70,10 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x15D800 + size: 0x15C800 ### TFM configuration tfm_secure: - address: 0xc000 + address: 0xD000 orig_span: &id004 - mcuboot_pad - tfm @@ -81,11 +81,11 @@ tfm_secure: size: 0x20000 span: *id004 tfm_nonsecure: - address: 0x2C000 + address: 0x2D000 orig_span: &id005 - app region: flash_primary - size: 0x13E000 + size: 0x13D000 span: *id005 tfm_its: address: 0x175000 diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/template/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/template/sysbuild/mcuboot/prj.conf b/samples/matter/template/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/template/sysbuild/mcuboot/prj.conf +++ b/samples/matter/template/sysbuild/mcuboot/prj.conf @@ -13,8 +13,6 @@ CONFIG_PM=n CONFIG_FLASH=y CONFIG_FPROTECT=y -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_NRF_ENABLE_ICACHE=n +CONFIG_SIZE_OPTIMIZATIONS=y + +# Activate LTO +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 mcuboot_primary: orig_span: &id001 - mcuboot_pad - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x166000 + size: 0x165000 mcuboot_primary_app: orig_span: &id002 - app span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 factory_data: address: 0x172000 region: flash_primary @@ -32,14 +32,14 @@ factory_data: settings_storage: address: 0x173000 region: flash_primary - size: 0xa000 + size: 0xA000 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x166000 + size: 0x165000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -48,9 +48,9 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x165800 + size: 0x164800 external_flash: - address: 0x166000 - size: 0x69a000 + address: 0x165000 + size: 0x69B000 device: MX25R64 region: external_flash diff --git a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/thermostat/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 tfm: - address: 0xc800 + address: 0xD800 region: flash_primary size: 0x1F800 app: - address: 0x2C000 + address: 0x2D000 region: flash_primary - size: 0x13E000 + size: 0x13D000 factory_data: address: 0x16A000 region: flash_primary @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -33,8 +33,8 @@ tfm_storage: size: 0x8000 span: *id006 external_flash: - address: 0x15E000 - size: 0x6A2000 + address: 0x15D000 + size: 0x6A3000 device: MX25R64 region: external_flash ### Bootloader configuration @@ -44,24 +44,24 @@ mcuboot_primary: - tfm - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x15E000 + size: 0x15D000 mcuboot_primary_app: orig_span: &id002 - app - tfm span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x15D800 + size: 0x15C800 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x15E000 + size: 0x15D000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -70,10 +70,10 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x15D800 + size: 0x15C800 ### TFM configuration tfm_secure: - address: 0xc000 + address: 0xD000 orig_span: &id004 - mcuboot_pad - tfm @@ -81,11 +81,11 @@ tfm_secure: size: 0x20000 span: *id004 tfm_nonsecure: - address: 0x2C000 + address: 0x2D000 orig_span: &id005 - app region: flash_primary - size: 0x13E000 + size: 0x13D000 span: *id005 tfm_its: address: 0x175000 diff --git a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/thermostat/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/thermostat/sysbuild/mcuboot/prj.conf b/samples/matter/thermostat/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/thermostat/sysbuild/mcuboot/prj.conf +++ b/samples/matter/thermostat/sysbuild/mcuboot/prj.conf @@ -13,8 +13,6 @@ CONFIG_PM=n CONFIG_FLASH=y CONFIG_FPROTECT=y -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_NRF_ENABLE_ICACHE=n +CONFIG_SIZE_OPTIMIZATIONS=y + +# Activate LTO +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y diff --git a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml index 08c63d0f0ea8..a8e64916b893 100644 --- a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml +++ b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp.yml @@ -1,30 +1,30 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 app: - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 mcuboot_primary: orig_span: &id001 - mcuboot_pad - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x166000 + size: 0x165000 mcuboot_primary_app: orig_span: &id002 - app span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x165800 + size: 0x164800 factory_data: address: 0x172000 region: flash_primary @@ -32,14 +32,14 @@ factory_data: settings_storage: address: 0x173000 region: flash_primary - size: 0xa000 + size: 0xA000 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x166000 + size: 0x165000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -48,9 +48,9 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x165800 + size: 0x164800 external_flash: - address: 0x166000 - size: 0x69a000 + address: 0x165000 + size: 0x69B000 device: MX25R64 region: external_flash diff --git a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml index ba713218b5c4..b34558ee9e2d 100644 --- a/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml +++ b/samples/matter/window_covering/pm_static_nrf54l15dk_nrf54l15_cpuapp_ns.yml @@ -2,19 +2,19 @@ mcuboot: address: 0x0 region: flash_primary - size: 0xc000 + size: 0xD000 mcuboot_pad: - address: 0xc000 + address: 0xD000 region: flash_primary size: 0x800 tfm: - address: 0xc800 + address: 0xD800 region: flash_primary size: 0x1F800 app: - address: 0x2C000 + address: 0x2D000 region: flash_primary - size: 0x13E000 + size: 0x13D000 factory_data: address: 0x16A000 region: flash_primary @@ -22,7 +22,7 @@ factory_data: settings_storage: address: 0x16B000 region: flash_primary - size: 0xa000 + size: 0xA000 tfm_storage: address: 0x175000 orig_span: &id006 @@ -33,8 +33,8 @@ tfm_storage: size: 0x8000 span: *id006 external_flash: - address: 0x15E000 - size: 0x6A2000 + address: 0x15D000 + size: 0x6A3000 device: MX25R64 region: external_flash ### Bootloader configuration @@ -44,24 +44,24 @@ mcuboot_primary: - tfm - app span: *id001 - address: 0xc000 + address: 0xD000 region: flash_primary - size: 0x15E000 + size: 0x15D000 mcuboot_primary_app: orig_span: &id002 - app - tfm span: *id002 - address: 0xc800 + address: 0xD800 region: flash_primary - size: 0x15D800 + size: 0x15C800 mcuboot_secondary: address: 0x0 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: external_flash - size: 0x15E000 + size: 0x15D000 span: *id003 mcuboot_secondary_pad: region: external_flash @@ -70,10 +70,10 @@ mcuboot_secondary_pad: mcuboot_secondary_app: region: external_flash address: 0x800 - size: 0x15D800 + size: 0x15C800 ### TFM configuration tfm_secure: - address: 0xc000 + address: 0xD000 orig_span: &id004 - mcuboot_pad - tfm @@ -81,11 +81,11 @@ tfm_secure: size: 0x20000 span: *id004 tfm_nonsecure: - address: 0x2C000 + address: 0x2D000 orig_span: &id005 - app region: flash_primary - size: 0x13E000 + size: 0x13D000 span: *id005 tfm_its: address: 0x175000 diff --git a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf deleted file mode 100644 index 52300bdd681b..000000000000 --- a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.conf +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# TODO: Workaround, disable memory guard to avoid false faults in application after boot -CONFIG_HW_STACK_PROTECTION=n - -CONFIG_BOOT_WATCHDOG_FEED=n - -# nRF54L15DK uses SPI NOR external flash -CONFIG_GPIO=y -CONFIG_SPI=y -CONFIG_SPI_NOR=y -CONFIG_SPI_NOR_SFDP_DEVICETREE=y -CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096 - -# required by SPI driver -CONFIG_MULTITHREADING=y - -CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y - -# Adjust the maximum sectors to the app image size of ~1.4MB -CONFIG_BOOT_MAX_IMG_SECTORS=512 - -# Currently, without tickless kernel, the SYSCOUNTER value after the software -# reset is not set properly and due to that the first system interrupt is not called -# in the proper time - the SYSCOUNTER value is set to the value from before -# reset + 1. Hence, the reboot time increases more and more. -# To avoid it enable tickles kernel for mcuboot. -CONFIG_TICKLESS_KERNEL=y diff --git a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay b/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay deleted file mode 100644 index e54f91119944..000000000000 --- a/samples/matter/window_covering/sysbuild/mcuboot/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause - */ - -/ { - chosen { - nordic,pm-ext-flash = &mx25r64; - }; -}; - -// restore full RRAM and SRAM space - by default some parts are dedicated to FLRP -&cpuapp_rram { - reg = <0x0 DT_SIZE_K(1524)>; -}; - -&cpuapp_sram { - reg = <0x20000000 DT_SIZE_K(256)>; - ranges = <0x0 0x20000000 0x40000>; -}; - -&mx25r64 { - status = "okay"; -}; diff --git a/samples/matter/window_covering/sysbuild/mcuboot/prj.conf b/samples/matter/window_covering/sysbuild/mcuboot/prj.conf index a15727a92c24..350bdca19926 100644 --- a/samples/matter/window_covering/sysbuild/mcuboot/prj.conf +++ b/samples/matter/window_covering/sysbuild/mcuboot/prj.conf @@ -13,8 +13,6 @@ CONFIG_PM=n CONFIG_FLASH=y CONFIG_FPROTECT=y -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - # Use minimal C library instead of the Picolib CONFIG_MINIMAL_LIBC=y @@ -37,3 +35,8 @@ CONFIG_MULTITHREADING=n CONFIG_TICKLESS_KERNEL=n CONFIG_TIMEOUT_64BIT=n CONFIG_NRF_ENABLE_ICACHE=n +CONFIG_SIZE_OPTIMIZATIONS=y + +# Activate LTO +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y From be457b959e80b7c796cee4e68ac5ec5e1b6a5830 Mon Sep 17 00:00:00 2001 From: Arkadiusz Balys Date: Wed, 4 Dec 2024 08:50:25 +0100 Subject: [PATCH 21/46] samples: matter: Align nRF54L15 internal pm_static We need to reach 35% of the compression rate, so we need to align the nRF54L15 internal partition map in the pm_static file. Signed-off-by: Arkadiusz Balys --- .../nrf54l15dk_nrf54l15_cpuapp_internal.conf | 4 ++-- ...atic_nrf54l15dk_nrf54l15_cpuapp_internal.yml | 17 +++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf index 5a9bff26e66b..892cdfca3db4 100644 --- a/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf +++ b/samples/matter/template/boards/nrf54l15dk_nrf54l15_cpuapp_internal.conf @@ -11,8 +11,8 @@ CONFIG_BT_LL_SOFTDEVICE_MULTIROLE=y CONFIG_CHIP_MALLOC_SYS_HEAP_SIZE=10240 CONFIG_MPSL_WORK_STACK_SIZE=2048 -# Set the ZMS sector count to match the settings partition size that is 44 kB for this application. -CONFIG_SETTINGS_ZMS_SECTOR_COUNT=11 +# Set the ZMS sector count to match the settings partition size that is 40 kB for this application. +CONFIG_SETTINGS_ZMS_SECTOR_COUNT=10 # 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 diff --git a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml index a73ddb883041..a8bcbce256bf 100644 --- a/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml +++ b/samples/matter/template/pm_static_nrf54l15dk_nrf54l15_cpuapp_internal.yml @@ -9,38 +9,39 @@ mcuboot_pad: app: address: 0xD800 region: flash_primary - size: 0xD4800 + size: 0xD7800 mcuboot_primary: address: 0xD000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xD5000 + size: 0xD8000 span: *id001 mcuboot_primary_app: address: 0xD800 orig_span: &id002 - app region: flash_primary - size: 0xD4800 + size: 0xD7800 span: *id002 mcuboot_secondary: - address: 0xE2000 + address: 0xE5000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: flash_primary - size: 0x90000 + size: 0x8D000 span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xE2000 + address: 0xE5000 size: 0x800 +# Compression rate 34.80% mcuboot_secondary_app: region: flash_primary - address: 0xE2800 - size: 0x8F800 + address: 0xE5800 + size: 0x8C800 factory_data: address: 0x172000 region: flash_primary From 3de6875166109c6b377ad4ca5351bbfa7dcc4b91 Mon Sep 17 00:00:00 2001 From: Mirko Covizzi Date: Wed, 4 Dec 2024 15:34:02 +0100 Subject: [PATCH 22/46] trusted_storage: improve Kconfig description Improves Kconfig description. Signed-off-by: Mirko Covizzi --- subsys/trusted_storage/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/trusted_storage/Kconfig b/subsys/trusted_storage/Kconfig index 2c73931b4fde..30ab8009954e 100644 --- a/subsys/trusted_storage/Kconfig +++ b/subsys/trusted_storage/Kconfig @@ -10,8 +10,8 @@ menuconfig TRUSTED_STORAGE bool "Trusted Storage" depends on !BUILD_WITH_TFM help - The secure storage subsystem allows its users to store in a secure - way data ensuring data integrity and confidentially by using AEAD + The secure storage subsystem allows its users to store data in a + secure way, ensuring data integrity and confidentiality by using AEAD algorithms. It supports several secure implementation back-ends to provide various levels of trust depending on the device security features. From 2e94a01969fb9c056c591d4bb62a571bb1fd3f73 Mon Sep 17 00:00:00 2001 From: Dominik Ermel Date: Thu, 28 Nov 2024 16:48:59 +0000 Subject: [PATCH 23/46] sysbuild: Reduce MCUboot memory usage for nRF54L's ED25519 signature Optimize CRACEN driver configuration to reduce MCUboot bootloader's memory footprint for nRF54L's ED25519 signature. Signed-off-by: Dominik Ermel Signed-off-by: Marek Pieta --- sysbuild/CMakeLists.txt | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sysbuild/CMakeLists.txt b/sysbuild/CMakeLists.txt index 74eecfdec575..b960f8dba7fa 100644 --- a/sysbuild/CMakeLists.txt +++ b/sysbuild/CMakeLists.txt @@ -229,10 +229,17 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) # The NRF54LX goes with PSA crypto by default if(SB_CONFIG_SOC_SERIES_NRF54LX AND SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519) set_config_bool(mcuboot CONFIG_NRF_SECURITY y) - set_config_bool(mcuboot CONFIG_BOOT_IMG_HASH_ALG_SHA512 y) set_config_bool(${DEFAULT_IMAGE} CONFIG_MCUBOOT_BOOTLOADER_SIGNATURE_TYPE_ED25519 y) set_config_bool(${DEFAULT_IMAGE} CONFIG_MCUBOOT_BOOTLOADER_USES_SHA512 y) + # We are sure that ED25519 signature on MCUboot does not need these + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_CIPHER_DRIVER n) + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_AEAD_DRIVER n) + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_MAC_DRIVER n) + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER n) + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_PAKE_DRIVER n) + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_KEY_DERIVATION_DRIVER n) + if(SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU) set_config_bool(mcuboot CONFIG_BOOT_SIGNATURE_USING_KMU y) else() @@ -246,8 +253,15 @@ function(${SYSBUILD_CURRENT_MODULE_NAME}_pre_cmake) set_config_bool(mcuboot CONFIG_BOOT_SIGNATURE_TYPE_PURE n) set_config_bool(${DEFAULT_IMAGE} CONFIG_MCUBOOT_BOOTLOADER_SIGNATURE_TYPE_PURE n) endif() - else() - set_config_bool(${DEFAULT_IMAGE} CONFIG_MCUBOOT_BOOTLOADER_USES_SHA512 n) + + # MCUboot uses hash function to identify key internally when KMU is disabled. + if(SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU AND SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE) + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_HASH_DRIVER n) + set_config_bool(mcuboot CONFIG_BOOT_IMG_HASH_ALG_SHA512 n) + else() + set_config_bool(mcuboot CONFIG_PSA_USE_CRACEN_HASH_DRIVER y) + set_config_bool(mcuboot CONFIG_BOOT_IMG_HASH_ALG_SHA512 y) + endif() endif() # A v1 board doesn't define board qualifiers, thus below test will just test the pure board From 26fd6fe9b8f422a0144f5b8071a9ac1a91260ac6 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Wed, 20 Nov 2024 15:27:45 +0100 Subject: [PATCH 24/46] applications: nrf_desktop: Increase MCUboot partition size on nRF54L DK Change increases partition size of MCUboot bootloader on nRF54L15 DK. Hardware crypto increases memory footprint of the immutable bootloader. Jira: NCSDK-30472 Signed-off-by: Marek Pieta --- .../nrf54l15dk_nrf54l15_cpuapp/pm_static.yml | 26 +++++++++---------- .../pm_static_fast_pair.yml | 26 +++++++++---------- .../pm_static_keyboard.yml | 26 +++++++++---------- .../pm_static_release.yml | 26 +++++++++---------- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static.yml b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static.yml index 4c7ce0cfd765..6694e3ed01b2 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static.yml +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static.yml @@ -1,46 +1,46 @@ app: - address: 0x5800 + address: 0x7800 region: flash_primary - size: 0xb9800 + size: 0xb8800 mcuboot: address: 0x0 region: flash_primary - size: 0x5000 + size: 0x7000 mcuboot_pad: - address: 0x5000 + address: 0x7000 region: flash_primary size: 0x800 mcuboot_primary: - address: 0x5000 + address: 0x7000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xba000 + size: 0xb9000 span: *id001 mcuboot_primary_app: - address: 0x5800 + address: 0x7800 orig_span: &id002 - app region: flash_primary - size: 0xb9800 + size: 0xb8800 span: *id002 mcuboot_secondary: - address: 0xbf000 + address: 0xc0000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: flash_primary - size: 0xba000 + size: 0xb9000 span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xbf000 + address: 0xc0000 size: 0x800 mcuboot_secondary_app: region: flash_primary - address: 0xbf800 - size: 0xb9800 + address: 0xc0800 + size: 0xb8800 settings_storage: address: 0x179000 region: flash_primary diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_fast_pair.yml b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_fast_pair.yml index 4fb2435bb646..ee5da8233112 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_fast_pair.yml +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_fast_pair.yml @@ -1,46 +1,46 @@ app: - address: 0x5800 + address: 0x7800 region: flash_primary - size: 0xb8800 + size: 0xb7800 mcuboot: address: 0x0 region: flash_primary - size: 0x5000 + size: 0x7000 mcuboot_pad: - address: 0x5000 + address: 0x7000 region: flash_primary size: 0x800 mcuboot_primary: - address: 0x5000 + address: 0x7000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xb9000 + size: 0xb8000 span: *id001 mcuboot_primary_app: - address: 0x5800 + address: 0x7800 orig_span: &id002 - app region: flash_primary - size: 0xb8800 + size: 0xb7800 span: *id002 mcuboot_secondary: - address: 0xbe000 + address: 0xbf000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: flash_primary - size: 0xb9000 + size: 0xb8000 span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xbe000 + address: 0xbf000 size: 0x800 mcuboot_secondary_app: region: flash_primary - address: 0xbe800 - size: 0xb8800 + address: 0xbf800 + size: 0xb7800 bt_fast_pair: address: 0x177000 region: flash_primary diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_keyboard.yml b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_keyboard.yml index 4c7ce0cfd765..6694e3ed01b2 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_keyboard.yml +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_keyboard.yml @@ -1,46 +1,46 @@ app: - address: 0x5800 + address: 0x7800 region: flash_primary - size: 0xb9800 + size: 0xb8800 mcuboot: address: 0x0 region: flash_primary - size: 0x5000 + size: 0x7000 mcuboot_pad: - address: 0x5000 + address: 0x7000 region: flash_primary size: 0x800 mcuboot_primary: - address: 0x5000 + address: 0x7000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xba000 + size: 0xb9000 span: *id001 mcuboot_primary_app: - address: 0x5800 + address: 0x7800 orig_span: &id002 - app region: flash_primary - size: 0xb9800 + size: 0xb8800 span: *id002 mcuboot_secondary: - address: 0xbf000 + address: 0xc0000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: flash_primary - size: 0xba000 + size: 0xb9000 span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xbf000 + address: 0xc0000 size: 0x800 mcuboot_secondary_app: region: flash_primary - address: 0xbf800 - size: 0xb9800 + address: 0xc0800 + size: 0xb8800 settings_storage: address: 0x179000 region: flash_primary diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_release.yml b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_release.yml index 4c7ce0cfd765..6694e3ed01b2 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_release.yml +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/pm_static_release.yml @@ -1,46 +1,46 @@ app: - address: 0x5800 + address: 0x7800 region: flash_primary - size: 0xb9800 + size: 0xb8800 mcuboot: address: 0x0 region: flash_primary - size: 0x5000 + size: 0x7000 mcuboot_pad: - address: 0x5000 + address: 0x7000 region: flash_primary size: 0x800 mcuboot_primary: - address: 0x5000 + address: 0x7000 orig_span: &id001 - app - mcuboot_pad region: flash_primary - size: 0xba000 + size: 0xb9000 span: *id001 mcuboot_primary_app: - address: 0x5800 + address: 0x7800 orig_span: &id002 - app region: flash_primary - size: 0xb9800 + size: 0xb8800 span: *id002 mcuboot_secondary: - address: 0xbf000 + address: 0xc0000 orig_span: &id003 - mcuboot_secondary_pad - mcuboot_secondary_app region: flash_primary - size: 0xba000 + size: 0xb9000 span: *id003 mcuboot_secondary_pad: region: flash_primary - address: 0xbf000 + address: 0xc0000 size: 0x800 mcuboot_secondary_app: region: flash_primary - address: 0xbf800 - size: 0xb9800 + address: 0xc0800 + size: 0xb8800 settings_storage: address: 0x179000 region: flash_primary From 889f4c0b312a9408b6ae248a4846cf44728ea192 Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Wed, 20 Nov 2024 15:33:33 +0100 Subject: [PATCH 25/46] applications: nrf_desktop: Use hardware crypto for nRF54L's MCUboot Change switches to using pure ED25519 signature and hardware crypto. MCUboot key is stored in KMU. Jira: NCSDK-30472 Signed-off-by: Marek Pieta --- .../images/mcuboot/mcuboot_private.pem | 27 +------------------ .../mcuboot/mcuboot_private_fast_pair.pem | 27 +------------------ .../images/mcuboot/prj.conf | 2 -- .../images/mcuboot/prj_fast_pair.conf | 1 - .../images/mcuboot/prj_keyboard.conf | 1 - .../images/mcuboot/prj_release.conf | 1 - .../nrf54l15dk_nrf54l15_cpuapp/sysbuild.conf | 4 ++- .../sysbuild_fast_pair.conf | 4 ++- .../sysbuild_keyboard.conf | 4 ++- .../sysbuild_release.conf | 4 ++- 10 files changed, 14 insertions(+), 61 deletions(-) diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private.pem b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private.pem index ab184393c40e..84f6f8659829 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private.pem +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private.pem @@ -1,28 +1,3 @@ -----BEGIN PRIVATE KEY----- -MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCi7guPvor+uIpE -XrWftc/csrYkozi6Sm7V7J9iXogTdNvD/745Vnz6p/z5UOQkWZDnPaQXxCtZeMM4 -QHJ6eTLg8OoLfLSl7gx2NyAyIz4w4VnqkpT9wOVo5imJVJ19F6AEbnv9N07Uq8Ph -bUMJWWFYSaObFlkCrETdU/OpuO927OIbsZEFnC4OlMSmjoASNsrcCD6ELyGhCpjU -tRiDb6paDHJKnKzVMT7bGza9tRveTuQscs6D+Vn4jB1+ChhmAcuHsVm7Yzsz99yZ -vQdLfLo4U6KKSPG/uvNX/jcBLLyohDy2h24q/+PXUTAWQ+PyVGXwuun6/hbYW1JM -XYNGfUh7AgMBAAECggEAM9l9ZGlG4njnx4o8Um8RjzJwNIic7OvzCbEbp7pdo5N0 -vJMOfkC/1STQpKbRc5/tNSmwpr+O7BI6ThR0WfVn8523XaB5/LQc0yIH5OzCRdvx -OW0cbQSN/SwB2+pJlB2IluByJMsNEzD2TS7wPnFrQSVuI1ShTvBzmdu1lzV7P2Tx -Hj/2ZG3FV5wRT4Hed3/tkBtIYBJNxHkW/BP31XX2ndq7/Apyo471Ef9RMRBQUhOP -7s+oYZJq95JUiMvlhGjg7Z7sShrvJ+VMMylBDUNK5fBCOBv70i21aXhz1Uf7i0l9 -751yfa5BQA10WigMOqgxC/1bpHOs4EVU+1fYG4rLwQKBgQDTk0CZ6ddTCdwRgsc2 -F1Bav+7c+AK+Sa+L58Mn7XOVjrL+cgenSHmcnEu/OTCq+xrOYV8ht1nf9uqfIg/p -wiVwTEcLj8cQS0t7cLtttGzk9UFPEynsnzdlgXoImx2iobgwIAaSShPAbZjFpwPc -7Ha1LwcfrSpa1s5Tm+NLTK5SRwKBgQDFI/jpTpWAtY6o+0g/KV363KdFIJ1XYE4+ -DxTZlxeGwR7OZhp84jo6cHG/ZK7YW6TKcmjriD5NyxD+w0aAiGKf4+xkpRbmCbYM -/+SUgIV4pZ9u9LzGTapx9cTtIBiEugsTpP64yKiXgLbjhDXVsdpnjGacnr/7AAz6 -wNEt0eeeLQKBgQCREyV25FtbeyVFdJE4y9+zemxFZGItLMWMf0zYMf/Ri1m9E1+g -GxgYhSuDYam3dBs7bJUYv2qHIf5bQ7X5qcCWMhd9HAd5asfFStWaMd+BV5KCsDdN -IxePKKsO/53giFeN2EfpQ5Yrmnro/M6vTA1Ry39s/wZN54Du37OJTHkzvQKBgEfZ -FWWKU2hmQwkJE8qZO/wqoPfLrCxlF/78JiArNdLR3XVhtvOey5Py2THk8ug9djCm -Q+DbdcGKabY/2xkLG86kFcqUdGUAUw4n0NnigUJ4MkQRBB/NvHnuFYhKc0UkPNc7 -Ae68it00dvMygyBPwoaMn/Ui0lsbKJ/W2CW34489AoGAfBF0VLVLLCXq0P3vtuiX -s+Bzi3UowjVI4+yBZdHpcm0pjzgiQmqoGWj0F3T5Jv8+5KVqfot9nWX3ePzS9zlJ -XmagOt6W5I3JNtARdqEJusspCWbOOUkOJT9CLIWZsN5Zf9XPAWaJ7UrVOhhuktv2 -33zKWryP8cRkCFzxjK08f/o= +MC4CAQAwBQYDK2VwBCIEIKLdbGhr2fWsJ8sHgZbPnO6RPGXoqq9ef064wxuB9L6h -----END PRIVATE KEY----- diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem index 69849c55a52d..1ad1fa7d5dc6 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/mcuboot_private_fast_pair.pem @@ -1,28 +1,3 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDcfrLhn9i+3T7+ -e30YQNSgfon86dSjVBFpShryxgRACr0P1QH9AznM04P1PQi+O37S2cfKZCXquHT0 -WipCmyywCQAo2Y2cLb0WJXNizRbgl3mEzRz8K1RjNvRFCYRgdbEKmA2w5x1/4nxQ -8T+BjIQOvZeSCjf75imowzyCLgOr9mLHI9I6QVhriIAYc7og3WeFs5w+NoTACeqq -hTsL0Uqe6aqITw1jrshSXPFrARYZhyK35UpCiMbjYxf2VsBSD26Q0GYdP9aGcfxp -tK/lceyqlybHrThqEHDaKR6F+ByO8YV6JCkuq8JylFzKpmF4oyBmuXMn1NAHBSst -nVDK9ZsJAgMBAAECggEAA8s3yXdKP813fSIzjrBl4C2RMv10e8txYcAFSu5SiiYN -Jvm1pyxwKQiuJXDzhq9oIRlfbUlwGBPsqjwnbD42hIBhJPLKU5i7X0dNbxKjjUF5 -9Smg0StvMCZUyV/Oq+i2fz3KxYOSf73uQOfHvZNE/epv8lKz8CT/jEBwuPYw+LtU -PP8koMV75R5l0XjpEt5Ko/xbDnxiBvBg2ZFQKpNFeLKLrN8wCPqo+uRW29p8dv7g -vn+ERz6JC5vNU2qKVuBplE4ZTc1zQVp5aa65/dZPmtXH3a3jMy8iTBLPvYZtoSVP -4HgNZI8dqrE5SMfbdWLsOYGTQgBXMhuEX2njP8/qgQKBgQD2vdOP9yqEwAt3hzWx -MMBuZIb6mqrUNuiZegSZsL4lvYhcfPNTpweTY8MWmDOblnIwemfhQijnERdlLLUY -2URnjR0wQ9WydhQg9rqh1rPkVAl2MxBlIHPBfwNzrKtDL+2DvY42y4IbbMn6A9gt -u2SalkRdc8pmX/hzGkUzbkriiQKBgQDkxMARsqzhqlf1Gdwl4JBp7UV7KmJldXxJ -9xzw9CH5qtyUlUA4RBYlgsa/vDhrrKKHDi5QZSGTOW2umEihY63kmVrQ2F0aJdNB -F7zNta30jb8qBSGpsnqbYy6QS6eRTVInwac0K9K8Q8PdOkXRm9d0xm20CVLCxZ8Z -M5ueLqDUgQKBgF7xmHDzSNcgFsl9q7ls6v8Pi6juzwEtx78W5qJFEkXvcoM0SWVN -Bms+nhkZo/Igp/vjfgl9rcOMHhZ+Z4kSQXIfKLYjxB0Rtpkgl5wiw8H+XE2xRIPF -QwWX3DosnRITZS+mRwzqrjvjVqzvwcWHMCUT4WacYauXDkEsQKiTrhkRAoGBAK7h -JP6ievxLjs+kRCGEaIFBS5Ma1HtA85FLYYlk5zAHiHXhHmWkztVAApUB2pOdNeVO -VuNIXAFCrnEAos0U+RK+lKkALTPW5IZnEgKjNuazEQabQ5+I+6cbi7Xsz50I4ZvY -suvz8DXRC8JrUIIqwurW4Xf2hJi2H6hRRk4G0RWBAoGBAOf7BEFMSH8QxPEiRmh4 -VcHLb3Otm7goH2tvqgzYu2Pzh42SwaT9JmTZkLX5IZI+MfUSuBmfxSFLfF2yfJqQ -uYa7hpU4w0wAgOq26HTiY2Ge3y8FTiasl4xuJ2VDBqZbvL8Zk0MW2MDtUwVMlm0A -ISrmLsUtfP8DvhZ0hIUPt+xl +MC4CAQAwBQYDK2VwBCIEIO0APC5gA+HO8JhqUJ0AK+fgF4MbbXhrfPmXlqU+LPhD -----END PRIVATE KEY----- diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj.conf index 31ab8a6c747d..69e989f8bb05 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj.conf @@ -8,8 +8,6 @@ CONFIG_SIZE_OPTIMIZATIONS=y CONFIG_HW_STACK_PROTECTION=y CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" - CONFIG_BOOT_MAX_IMG_SECTORS=256 CONFIG_BOOT_BOOTSTRAP=n diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf index 31ab8a6c747d..68e256a10990 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_fast_pair.conf @@ -8,7 +8,6 @@ CONFIG_SIZE_OPTIMIZATIONS=y CONFIG_HW_STACK_PROTECTION=y CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" CONFIG_BOOT_MAX_IMG_SECTORS=256 CONFIG_BOOT_BOOTSTRAP=n diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_keyboard.conf index 31ab8a6c747d..68e256a10990 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_keyboard.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_keyboard.conf @@ -8,7 +8,6 @@ CONFIG_SIZE_OPTIMIZATIONS=y CONFIG_HW_STACK_PROTECTION=y CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" CONFIG_BOOT_MAX_IMG_SECTORS=256 CONFIG_BOOT_BOOTSTRAP=n diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_release.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_release.conf index 8cc7dc72a4f3..7cffdfc3d9f3 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_release.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/images/mcuboot/prj_release.conf @@ -8,7 +8,6 @@ CONFIG_SIZE_OPTIMIZATIONS=y CONFIG_HW_STACK_PROTECTION=y CONFIG_MAIN_STACK_SIZE=10240 -CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h" CONFIG_BOOT_MAX_IMG_SECTORS=256 CONFIG_BOOT_BOOTSTRAP=n diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild.conf index f777fb91fbb5..cd1800f15052 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild.conf @@ -7,5 +7,7 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y +SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private.pem" diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_fast_pair.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_fast_pair.conf index e2d9e7ec083e..013b7467becc 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_fast_pair.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_fast_pair.conf @@ -8,5 +8,7 @@ SB_CONFIG_BT_FAST_PAIR=y SB_CONFIG_BOOTLOADER_MCUBOOT=y SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y +SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private_fast_pair.pem" diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_keyboard.conf index f777fb91fbb5..cd1800f15052 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_keyboard.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_keyboard.conf @@ -7,5 +7,7 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y +SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private.pem" diff --git a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_release.conf b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_release.conf index f777fb91fbb5..cd1800f15052 100644 --- a/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_release.conf +++ b/applications/nrf_desktop/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild_release.conf @@ -7,5 +7,7 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y -SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y +SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${APPLICATION_CONFIG_DIR}/images/mcuboot/mcuboot_private.pem" From 24055a142007f88283676d503ca0914fd972dcad Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Tue, 3 Dec 2024 16:59:25 +0100 Subject: [PATCH 26/46] samples: cellular: nrf_cloud_rest_fota: Increase SMP timeout This patch increases the SMP timeout to avoid a crash that is caused by a late reply from the nRF52. Signed-off-by: Maximilian Deubel --- samples/cellular/nrf_cloud_rest_fota/overlay_smp_fota.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/cellular/nrf_cloud_rest_fota/overlay_smp_fota.conf b/samples/cellular/nrf_cloud_rest_fota/overlay_smp_fota.conf index 9e385ee7e05d..f1cbc926fb3a 100644 --- a/samples/cellular/nrf_cloud_rest_fota/overlay_smp_fota.conf +++ b/samples/cellular/nrf_cloud_rest_fota/overlay_smp_fota.conf @@ -10,3 +10,4 @@ CONFIG_MCUMGR_GRP_OS=y CONFIG_MCUMGR_TRANSPORT_UART=y CONFIG_UART_MCUMGR_RX_BUF_COUNT=4 CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y +CONFIG_SMP_CMD_RETRY_TIME=1000 From a232a4962889447aa76832991f286bb450e67858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag=20Erik=20Gj=C3=B8rvad?= Date: Tue, 3 Dec 2024 10:46:47 +0100 Subject: [PATCH 27/46] nrf_security: add zephyr includes in debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added zephyr include directories to mbedtls debug Signed-off-by: Dag Erik Gjørvad --- subsys/nrf_security/src/zephyr/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/nrf_security/src/zephyr/CMakeLists.txt b/subsys/nrf_security/src/zephyr/CMakeLists.txt index 146eae3622c5..3bcc88738639 100644 --- a/subsys/nrf_security/src/zephyr/CMakeLists.txt +++ b/subsys/nrf_security/src/zephyr/CMakeLists.txt @@ -6,7 +6,7 @@ # Additional build logic for Zephyr builds -# Add the PSA interface to the zephyr_interface for use by the +# Add the PSA interface to the zephyr_interface for use by the # main app. Note that this doesn't include psa_crypto_library_config # to ensure that MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER is not set. target_link_libraries(zephyr_interface @@ -18,6 +18,7 @@ target_link_libraries(zephyr_interface if (CONFIG_MBEDTLS_DEBUG) zephyr_library_sources(${ZEPHYR_BASE}/modules/mbedtls/debug.c) zephyr_library_sources(debug_init.c) + zephyr_include_directories(${ZEPHYR_BASE}/modules/mbedtls/include) endif() # Add mbed TLS heap library - Not for TF-M build From 138a660291cb44f6de9bb9aa78c8e08d9677943b Mon Sep 17 00:00:00 2001 From: Grzegorz Ferenc Date: Wed, 4 Dec 2024 16:42:54 +0100 Subject: [PATCH 28/46] doc: edit nrfjprog/CLT deprecation note Updated wording from "deprecation" to the more correct "archiviation". NCSDK-30819. Signed-off-by: Grzegorz Ferenc --- doc/nrf/shortcuts.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/nrf/shortcuts.txt b/doc/nrf/shortcuts.txt index c07ed8755762..57f789d10710 100644 --- a/doc/nrf/shortcuts.txt +++ b/doc/nrf/shortcuts.txt @@ -90,11 +90,11 @@ You can continue to use it until the transition is complete in the |NCS| and the feature is removed in one of the upcoming |NCS| releases. For more information, see :ref:`zephyr:sysbuild`, :ref:`sysbuild_images`, :ref:`zephyr_samples_sysbuild`, and :ref:`sysbuild_forced_options`. -.. |nrfjprog_deprecation_note| replace:: Starting with the |NCS| v2.8.0, nrfjprog is officially deprecated and will be removed in an upcoming release. - Transition to using `nRF Util (device command) `_ for all related tasks going forward. +.. |nrfjprog_deprecation_note| replace:: Starting with the |NCS| v2.8.0, nrfjprog is in the process of being archived. + It will remain available for download, but `nRF Util (device command) `_ will gradually replace it. -.. |nrf_CLT_deprecation_note| replace:: Starting with the |NCS| v2.8.0, the nRF Command Line Tools are officially deprecated and will be removed in an upcoming release. - Transition to using `nRF Util`_ for all related tasks going forward. +.. |nrf_CLT_deprecation_note| replace:: Starting with the |NCS| v2.8.0, the nRF Command Line Tools are in the process of being archived. + They will remain available for download, but `nRF Util`_ will gradually replace them. .. ### Thread usage shortcuts From 21fed0703eb3748b554b591963c8e4510e75e2dc Mon Sep 17 00:00:00 2001 From: Nordic Builder Date: Wed, 4 Dec 2024 17:56:24 +0000 Subject: [PATCH 29/46] manifest: Update sdk-nrfxlib revision (auto-manifest PR) Automatically created by Github Action Signed-off-by: Nordic Builder --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index 04a975e70af1..dc8145a23f8b 100644 --- a/west.yml +++ b/west.yml @@ -147,7 +147,7 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: c4a3e93743d4025c509a931d58fa744292d0f121 + revision: 1ab292d04974dc97523c00dfa82eb461fd27bdb1 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m @@ -191,7 +191,7 @@ manifest: # Only for internal Nordic development repo-path: dragoon.git remote: dragoon - revision: 93c4537c2712c49dfcfb766faa19da5c77bed391 + revision: 5e894059db09d7b704e6678dc1e38ccc0ce19cd3 submodules: true groups: - dragoon From 97093b547ccbb1efe4f04bc5a2a4376d1f49f49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20Hirsim=C3=A4ki?= Date: Thu, 5 Dec 2024 13:51:38 +0200 Subject: [PATCH 30/46] samples: dect_phy: dect_shell: beacon_scan: fix: add missing option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing -D option to delete neigbor list before starting a scan. Signed-off-by: Jani Hirsimäki --- .../dect/dect_phy/dect_shell/src/dect/mac/dect_phy_mac_ctrl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/dect/dect_phy/dect_shell/src/dect/mac/dect_phy_mac_ctrl.c b/samples/dect/dect_phy/dect_shell/src/dect/mac/dect_phy_mac_ctrl.c index ef5200fcf765..3aa47d92d26d 100644 --- a/samples/dect/dect_phy/dect_shell/src/dect/mac/dect_phy_mac_ctrl.c +++ b/samples/dect/dect_phy/dect_shell/src/dect/mac/dect_phy_mac_ctrl.c @@ -217,6 +217,10 @@ int dect_phy_mac_ctrl_beacon_scan_start(struct dect_phy_mac_beacon_scan_params * .ch_acc_use_all_channels = false, }; + if (params->clear_nbr_cache_before_scan) { + dect_phy_mac_nbr_info_clear_all(); + } + /* Set filter. Broadcast Beacons (with type 1) are always passing filter. */ rx_params.filter.is_short_network_id_used = true; rx_params.filter.short_network_id = (uint8_t)(current_settings->common.network_id & 0xFF); From 7eb5555b755ab78d3d42f1fbfeffee19820bf2ec Mon Sep 17 00:00:00 2001 From: Henrik Lander Date: Thu, 5 Dec 2024 09:08:27 +0100 Subject: [PATCH 31/46] samples: Bluetooth: update scanning_while_connecting Move flag that protects application from establishing a new connection when there is already a connection establishment process pending. This is moved to after the if to check that we have established all connections. Otherwise, we get in the scan_recv call back an attempt to establish a connection when we have used all connection objects before we stop scanning in main. Signed-off-by: Henrik Lander --- samples/bluetooth/scanning_while_connecting/src/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/samples/bluetooth/scanning_while_connecting/src/main.c b/samples/bluetooth/scanning_while_connecting/src/main.c index 84561387f607..dc597414dde3 100644 --- a/samples/bluetooth/scanning_while_connecting/src/main.c +++ b/samples/bluetooth/scanning_while_connecting/src/main.c @@ -161,7 +161,6 @@ static void disconnected(struct bt_conn *conn, uint8_t reason) static void connected(struct bt_conn *conn, uint8_t err) { - connection_establishment_ongoing = false; char addr_str[BT_ADDR_LE_STR_LEN]; bt_addr_le_to_str(bt_conn_get_dst(conn), addr_str, sizeof(addr_str)); @@ -182,6 +181,8 @@ static void connected(struct bt_conn *conn, uint8_t err) } } + connection_establishment_ongoing = false; + struct bt_le_conn_param conn_param = { .interval_min = 500, /* Minimum Connection Interval (interval_min * 1.25 ms) */ .interval_max = 500, /* Maximum Connection Interval (interval_max * 1.25 ms) */ @@ -201,6 +202,7 @@ static void connected(struct bt_conn *conn, uint8_t err) if (active_conn_establishment_mode == SEQUENTIAL_SCAN_AND_CONNECT) { scan_start(); } + } static void try_connect(void) @@ -434,6 +436,7 @@ int main(void) active_conn_establishment_mode = conn_establishment_modes[i]; num_connections = 0; + connection_establishment_ongoing = false; ring_buf_reset(&connectable_peers_ring_buf); print_conn_establishment_mode(active_conn_establishment_mode); From 0a53d05c0a3c8ab8b51a84ec9cdac37bc95c9384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Mon, 7 Oct 2024 12:28:20 +0200 Subject: [PATCH 32/46] lib: modem_key_mgmt: Handle generic CME errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle generic CME errors from all AT%CMNG commands. For reference, see 3GPP 27.007 Ch. 9.1. Signed-off-by: Stig Bjørlykke --- include/modem/modem_key_mgmt.h | 1 + lib/modem_key_mgmt/modem_key_mgmt.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/modem/modem_key_mgmt.h b/include/modem/modem_key_mgmt.h index 3f79df015d6f..7f55ccf1ecb4 100644 --- a/include/modem/modem_key_mgmt.h +++ b/include/modem/modem_key_mgmt.h @@ -111,6 +111,7 @@ int modem_key_mgmt_clear(nrf_sec_tag_t sec_tag); * @retval -ENOENT No credential associated with the given * @p sec_tag and @p cred_type. * @retval -EACCES Access to credential not allowed. + * @retval -E2BIG Memory failure. */ int modem_key_mgmt_read(nrf_sec_tag_t sec_tag, enum modem_key_mgmt_cred_type cred_type, diff --git a/lib/modem_key_mgmt/modem_key_mgmt.c b/lib/modem_key_mgmt/modem_key_mgmt.c index 28af79e12ccc..e7f604dd683a 100644 --- a/lib/modem_key_mgmt/modem_key_mgmt.c +++ b/lib/modem_key_mgmt/modem_key_mgmt.c @@ -66,6 +66,18 @@ static int translate_error(int err) /* In case of CME error translate to an errno value */ switch (nrf_modem_at_err(err)) { + case 0: /* phone failure. invalid command, parameter, or other unexpected error */ + LOG_WRN("Phone failure"); + return -EIO; + case 23: /* memory failure. unexpected error in memory handling */ + LOG_WRN("Memory failure"); + return -E2BIG; + case 50: /* incorrect parameters in a command */ + LOG_WRN("Incorrect parameters in command"); + return -EINVAL; + case 60: /* system error */ + LOG_WRN("System error"); + return -ENOEXEC; case 513: /* not found */ LOG_WRN("Key not found"); return -ENOENT; From d55fb031b218abc95f9bf8a6e5a4d3f3f10550ef Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 5 Dec 2024 12:54:52 +0200 Subject: [PATCH 33/46] manifest: Set snapshot tags before rebasing OSS repositories Update Zephyr and mcuboot revisions with snapshot tags. Signed-off-by: Jukka Rissanen --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index dc8145a23f8b..f6637cfc9520 100644 --- a/west.yml +++ b/west.yml @@ -69,7 +69,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 15ffa301b3294a769752ad0a1d382bce9803f265 + revision: v3.7.99-ncs1-snapshot2 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -130,7 +130,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: ed0fc24030f3765cfb04a8fdd8771bd5078107a7 + revision: v2.1.0-ncs2-snapshot2 path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR From 85063588ab072304552f36328c92a86dd475f1cc Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 5 Dec 2024 12:56:51 +0200 Subject: [PATCH 34/46] manifest: Pull rebased OSS repositories Pull rebased histories for Zephyr and mcuboot. Signed-off-by: Jukka Rissanen --- west.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/west.yml b/west.yml index f6637cfc9520..46255a9bda49 100644 --- a/west.yml +++ b/west.yml @@ -69,7 +69,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: v3.7.99-ncs1-snapshot2 + revision: 0a2e205750dc7eff8767afa543b2fd23a1fbb332 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -130,7 +130,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: v2.1.0-ncs2-snapshot2 + revision: 12e5ee106034972b0f1074d6f2261b2b39d1501b path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR From a71e058b2a0f5ea8c66a751438cd43ecc46f483e Mon Sep 17 00:00:00 2001 From: Nordic Builder Date: Thu, 5 Dec 2024 10:35:55 +0000 Subject: [PATCH 35/46] manifest: Update sdk-connectedhomeip revision (auto-manifest PR) Automatically created by Github Action Signed-off-by: Nordic Builder --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 46255a9bda49..34e8bf330656 100644 --- a/west.yml +++ b/west.yml @@ -159,7 +159,7 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: 9a6edcf725a9766e513fe789745da92e0f640cb1 + revision: a81c857ededd7a1343ec5d7971e174536dcb3f4d west-commands: scripts/west/west-commands.yml submodules: - name: nlio From 24706db44f2bd9f2afc87d3c305c4c76d892cf0f Mon Sep 17 00:00:00 2001 From: Jui-Chou Chung Date: Thu, 5 Dec 2024 14:29:00 +0800 Subject: [PATCH 36/46] applications: nrf5340_audio: Add BASS service data Added BASS service data for fixing the IOP issue from phone. OCT-3207 Signed-off-by: Jui-Chou Chung --- .../bluetooth/bt_stream/broadcast/broadcast_sink.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c index fea75f999ec1..ff1a05f5ba7d 100644 --- a/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c +++ b/applications/nrf5340_audio/src/bluetooth/bt_stream/broadcast/broadcast_sink.c @@ -83,6 +83,7 @@ static bool paused; static struct bt_csip_set_member_svc_inst *csip; static uint8_t flags_adv_data; +static uint8_t bass_service_uuid[BT_UUID_SIZE_16]; static uint8_t gap_appear_adv_data[BT_UUID_SIZE_16]; static uint8_t csip_rsi_adv_data[BT_CSIP_RSI_SIZE]; @@ -144,6 +145,19 @@ int broadcast_sink_adv_populate(struct bt_data *adv_buf, uint8_t adv_buf_vacant) } } + /* + * AD format required for broadcast sink with scan delegator. + * Details can be found in Basic Audio Profile Section 3.9.2. + */ + sys_put_le16(BT_UUID_BASS_VAL, &bass_service_uuid[0]); + + ret = bt_mgmt_adv_buffer_put(adv_buf, &adv_buf_cnt, adv_buf_vacant, + sizeof(bass_service_uuid), BT_DATA_SVC_DATA16, + (void *)bass_service_uuid); + if (ret) { + return ret; + } + sys_put_le16(CONFIG_BT_DEVICE_APPEARANCE, &gap_appear_adv_data[0]); ret = bt_mgmt_adv_buffer_put(adv_buf, &adv_buf_cnt, adv_buf_vacant, From 34c08bc3813b686087c8bc2fed8b0d73f9b79248 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 5 Dec 2024 16:18:20 +0200 Subject: [PATCH 37/46] version: Update VERSION file for 2.9.0-rc1 Set the version to 2.9.0-rc1. Signed-off-by: Jukka Rissanen --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 8bcb125234b4..4bf4e2b8f634 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.8.99 +2.9.0-rc1 From 2dee59af02a114e7fc7856bee2e35fc9f37d7ddd Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 5 Dec 2024 16:28:52 +0200 Subject: [PATCH 38/46] manifest: Update tags for NCS v2.9.0-rc1 Update revisions of tagged repositories. Signed-off-by: Jukka Rissanen --- west.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/west.yml b/west.yml index 34e8bf330656..988e43d394e7 100644 --- a/west.yml +++ b/west.yml @@ -69,7 +69,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 0a2e205750dc7eff8767afa543b2fd23a1fbb332 + revision: v3.7.99-ncs2-rc1 import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above @@ -130,7 +130,7 @@ manifest: compare-by-default: true - name: mcuboot repo-path: sdk-mcuboot - revision: 12e5ee106034972b0f1074d6f2261b2b39d1501b + revision: v2.1.0-ncs3-rc1 path: bootloader/mcuboot - name: qcbor url: https://github.com/laurencelundblade/QCBOR @@ -139,7 +139,7 @@ manifest: - name: mbedtls path: modules/crypto/mbedtls repo-path: sdk-mbedtls - revision: v3.6.2-ncs1-rc1 + revision: v3.6.2-ncs2-rc1 - name: oberon-psa-crypto path: modules/crypto/oberon-psa-crypto repo-path: sdk-oberon-psa-crypto @@ -147,11 +147,11 @@ manifest: - name: nrfxlib repo-path: sdk-nrfxlib path: nrfxlib - revision: 1ab292d04974dc97523c00dfa82eb461fd27bdb1 + revision: v2.9.0-rc1 - name: trusted-firmware-m repo-path: sdk-trusted-firmware-m path: modules/tee/tf-m/trusted-firmware-m - revision: f2bf78452629355e4180dc36756f6c1becc819fa + revision: v2.1.1-ncs2-rc1 - name: psa-arch-tests repo-path: sdk-psa-arch-tests path: modules/tee/tf-m/psa-arch-tests @@ -159,7 +159,7 @@ manifest: - name: matter repo-path: sdk-connectedhomeip path: modules/lib/matter - revision: a81c857ededd7a1343ec5d7971e174536dcb3f4d + revision: v2.9.0-rc1 west-commands: scripts/west/west-commands.yml submodules: - name: nlio @@ -178,7 +178,7 @@ manifest: - name: nrf-802154 repo-path: sdk-nrf-802154 path: nrf-802154 - revision: b5764deaf3c05fc4343a17ed2ac86e07589af4bb + revision: v2.9.0-rc1 groups: - nrf-802154 - name: soc-hwmv1 @@ -206,12 +206,12 @@ manifest: compare-by-default: false - name: sidewalk repo-path: sdk-sidewalk - revision: a2433e06b653e0f9a47f17af0fef6bd4c5e90a4e + revision: v2.9.0-rc1 groups: - sidewalk - name: find-my repo-path: sdk-find-my - revision: 616004ea718636d90a4feb3b470b48f2616532f3 + revision: v2.9.0-rc1 groups: - find-my - name: azure-sdk-for-c @@ -242,10 +242,10 @@ manifest: upstream-sha: c6eaeda5a1c1c5dbb24dce7e027340cb8893a77b compare-by-default: false - name: suit-generator - revision: 8f9ce9039e6fb8584dc915944b2bc275856757c0 + revision: v2.9.0-rc1 path: modules/lib/suit-generator - name: suit-processor - revision: 6802f3008cba16a74a8c65814af00808327a7ee7 + revision: v2.9.0-rc1 path: modules/lib/suit-processor - name: doc-internal repo-path: doc-internal From 93ac7b0d838775b1c16cc0b98b6affcddd0a5cb8 Mon Sep 17 00:00:00 2001 From: Pekka Niskanen Date: Wed, 4 Dec 2024 11:24:48 +0200 Subject: [PATCH 39/46] doc: changelog for 2.9.99 Cleaned up changelog for NCS 2.9.99 Signed-off-by: Pekka Niskanen --- .../releases/release-notes-changelog.rst | 253 ++---------------- 1 file changed, 28 insertions(+), 225 deletions(-) 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 066b5caefb66..c7787ff74e55 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -23,7 +23,7 @@ Known issues ************ Known issues are only tracked for the latest official release. -See `known issues for nRF Connect SDK v2.8.0`_ for the list of issues valid for the latest release. +See :ref:`known_issues` for the list of issues valid for the latest release. Changelog ********* @@ -38,10 +38,7 @@ IDE, OS, and tool support Board support ============= -* Updated various tests and samples to use Zephyr's :ref:`native_sim` instead of Zephyr's :ref:`native_posix` for :ref:`running_unit_tests`. - This mirrors the deprecation of ``native_posix`` in Zephyr. - Support for ``native_posix`` will be removed in Zephyr with the v4.2 release. - In the |NCS|, it will be removed once Zephyr v4.2 is upmerged to sdk-nrf. +|no_changes_yet_note| Build and configuration system ============================== @@ -51,8 +48,7 @@ Build and configuration system Bootloaders and DFU =================== -* Updated the allowed offset for :ref:`doc_fw_info` in the :ref:`bootloader`. - It can now be placed at offset ``0x600``, however, it cannot be used for any applications with |NSIB| compiled before this change. +|no_changes_yet_note| Developing with nRF91 Series ============================ @@ -87,8 +83,7 @@ Developing with nRF52 Series Developing with Front-End Modules ================================= -* Deprecated the explicit use of ``-DSHIELD=nrf21540ek_fwd`` for boards with ``nrf5340/cpuapp`` qualifiers when the nRF21540 EK shield is used. - The build system uses an appropriate overlay file for each core, relying only on the ``-DSHIELD=nrf21540ek`` parameter. +|no_changes_yet_note| Developing with PMICs ===================== @@ -138,48 +133,12 @@ Gazell Matter ------ -* Added: - - * Implementation of the :cpp:class:`Spake2pVerifier` class for the PSA crypto backend. - You can use this class to generate the Spake2+ verifier at runtime. - To use this class, enable the :kconfig:option:`CONFIG_PSA_WANT_ALG_PBKDF2_HMAC` and :kconfig:option:`CONFIG_PSA_WANT_KEY_TYPE_SPAKE2P_KEY_PAIR_DERIVE` Kconfig options. - * The Matter watchdog pause mode to the :ref:`ug_matter_device_watchdog` feature. - +|no_changes_yet_note| Matter fork +++++++++++ -The Matter fork in the |NCS| (``sdk-connectedhomeip``) contains all commits from the upstream Matter repository up to, and including, the ``v1.4.0.0`` tag. - -The following list summarizes the most important changes inherited from the upstream Matter: - -* Added: - - * Enhanced Network Infrastructure with Home Routers and Access Points (HRAP). - This provides requirements for devices such as home routers, modems or access points to create a necessary infrastructure for Matter products. - * Enhanced Multi-Admin that aims to simplify the smart home management from the user perspective. - This term includes several different features and in this release only Fabric Synchronization was fully delivered. - The Fabric Synchronization enables commissioning of devices from one fabric to another without requiring manual user actions, only user consent. - * Dynamic SIT LIT switching support that allows the application to switch between these modes, as long as the requirements for these modes are met. - This can be enabled using the :kconfig:option:`CONFIG_CHIP_ICD_DSLS_SUPPORT` Kconfig option. - * The Kconfig option :kconfig:option:`CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT` to limit the slow polling interval value for the device while it is in the SIT mode. - This can be used to limit the slow poll interval for the ICD LIT device while it is temporarily working in the SIT mode. - * New device types: - - * Water heater - * Solar power - * Battery storage - * Heat pump - * Mounted on/off control - * Mounted dimmable load control - -* Updated: - - * Thermostat cluster with support for scheduling and preset modes, like vacation, and home or away settings. - * Electric Vehicle Supply Equipment (EVSE) with support for user-defined charging preferences, like specifying the time when the car will be charged. - * Occupancy sensing cluster with features like radar, vision, and ambient sensing. - * Intermittently Connected Devices feature with enhancements for the Long Idle Time (LIT) and Check-In Protocol. - With this enhancements, the state of this feature is changed from provisional to certifiable. +|no_changes_yet_note| nRF IEEE 802.15.4 radio driver ------------------------------ @@ -189,7 +148,7 @@ nRF IEEE 802.15.4 radio driver Thread ------ -* Added Kconfig options for configuring the MLE child update timeout, child supervision interval, and child supervision check timeout. +|no_changes_yet_note| Zigbee ------ @@ -199,7 +158,7 @@ Zigbee Wi-Fi ----- -* Updated the :ref:`wifi_regulatory_channel_rules` for some countries in the :ref:`ug_nrf70_developing_regulatory_support` documentation. +|no_changes_yet_note| Applications ============ @@ -214,13 +173,12 @@ Machine learning Asset Tracker v2 ---------------- -* Updated the Wi-Fi configurations to reduce the RAM usage by about 25 kB for the nRF91 Series DK and 12 kB for the Thingy:91 X. +|no_changes_yet_note| Connectivity Bridge ------------------- -* Updated the handling of USB CDC ACM baud rate requests to make sure the baud rate is set correctly when the host requests a change. - This fixes an issue when using GNU screen with the Thingy:91 X. +|no_changes_yet_note| IPC radio firmware ------------------ @@ -230,48 +188,17 @@ IPC radio firmware Matter Bridge ------------- -* Added: - - * Support for the ``UniqueID`` attribute in the Bridged Device Basic Information cluster. - * Version 2 of bridged device data scheme containing ``UniqueID``. - * Kconfig options :ref:`CONFIG_BRIDGE_MIGRATE_PRE_2_7_0 ` and :ref:`CONFIG_BRIDGE_MIGRATE_VERSION_1 ` to enable migration from older data schemes. - |no_changes_yet_note| nRF5340 Audio ------------- -* Updated the documentation for :ref:`nrf53_audio_app_building` with cross-links and additional information, based on user feedback. +|no_changes_yet_note| nRF Desktop ----------- -* Updated: - - * The :ref:`nrf_desktop_settings_loader` to make the :ref:`Zephyr Memory Storage (ZMS) ` the default settings backend for all board targets that use the MRAM technology. - As a result, all :ref:`zephyr:nrf54h20dk_nrf54h20` configurations were migrated from the NVS settings backend to the ZMS settings backend. - * The :ref:`zephyr:nrf54h20dk_nrf54h20` release configuration to enable the :ref:`nrf_desktop_watchdog`. - * The configuration files of the :ref:`nrf_desktop_click_detector` (:file:`click_detector_def.h`) to allow using them also when Bluetooth LE peer control using a dedicated button (:ref:`CONFIG_DESKTOP_BLE_PEER_CONTROL `) is disabled. - * The DTS description for board targets with a different DTS overlay file for each build type to isolate the common configuration that is now defined in the :file:`app_common.dtsi` file. - The following board configurations have been updated: - - * :ref:`zephyr:nrf52840dk_nrf52840` - * :ref:`zephyr:nrf52840dongle_nrf52840` - * :ref:`zephyr:nrf54l15dk_nrf54l15` - * :ref:`zephyr:nrf54h20dk_nrf54h20` - - * MCUboot bootloader configurations to enable the following Kconfig options: - - * :kconfig:option:`CONFIG_FPROTECT` - Used to protect the bootloader partition against memory corruption. - * :kconfig:option:`CONFIG_HW_STACK_PROTECTION` - Used to protect against stack overflows. - - The :kconfig:option:`CONFIG_HW_STACK_PROTECTION` Kconfig option and its dependency (the :kconfig:option:`CONFIG_ARM_MPU` Kconfig option) might be disabled in case of targets with limited memory. - - * MCUboot bootloader configuration for the MCUboot SMP build type and the nRF52840 Gaming Mouse target to enable the :kconfig:option:`CONFIG_ARM_MPU` Kconfig option that is required to enable hardware stack protection (:kconfig:option:`CONFIG_HW_STACK_PROTECTION`). - -* Removed imply for partial erase feature of the nRF SoC flash driver (:kconfig:option:`CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE`) for the USB next stack (:ref:`CONFIG_DESKTOP_USB_STACK_NEXT `). - The partial erase feature was used as a workaround for device errors that might be reported by the Windows USB host in Device Manager if a USB cable is connected while erasing a secondary image slot in the background. - The workaround is no longer needed after the nRF UDC driver was improved. +|no_changes_yet_note| nRF Machine Learning (Edge Impulse) ----------------------------------- @@ -301,57 +228,13 @@ Amazon Sidewalk samples Bluetooth samples ----------------- -* Added: - - * The :ref:`channel_sounding_ras_reflector` sample demonstrating how to implement a Channel Sounding Reflector that exposes the Ranging Responder GATT Service. - * The :ref:`channel_sounding_ras_initiator` sample demonstrating basic distance estimation with Channel Sounding by setting up a Channel Sounding Initiator that acts as a Ranging Requestor GATT Client. - * The :ref:`bt_peripheral_with_multiple_identities` sample demonstrating how to use a single physical device to create and manage multiple advertisers, making it appear as multiple distinct devices by assigning each a unique identity. - * Support for the ``nrf54l15dk/nrf54l05/cpuapp`` and ``nrf54l15dk/nrf54l10/cpuapp`` board targets in the following samples: - - * :ref:`direct_test_mode` - * :ref:`peripheral_hids_mouse` - * :ref:`peripheral_lbs` - * :ref:`power_profiling` - * :ref:`peripheral_uart` - - * :ref:`power_profiling` sample: - * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board target. - - * The :ref:`bt_scanning_while_connecting` sample demonstrating how to establish multiple connections faster using the :kconfig:option:`CONFIG_BT_SCAN_AND_INITIATE_IN_PARALLEL` Kconfig option. - -* Updated: - - * Configurations of the following Bluetooth samples to make the :ref:`Zephyr Memory Storage (ZMS) ` the default settings backend for all board targets that use the MRAM technology: - - * :ref:`bluetooth_central_hids` - * :ref:`peripheral_hids_keyboard` - * :ref:`peripheral_hids_mouse` - * :ref:`central_and_peripheral_hrs` - * :ref:`central_bas` - * :ref:`central_nfc_pairing` - * :ref:`central_uart` - * :ref:`peripheral_bms` - * :ref:`peripheral_cgms` - * :ref:`peripheral_cts_client` - * :ref:`peripheral_lbs` - * :ref:`peripheral_mds` - * :ref:`peripheral_nfc_pairing` - * :ref:`power_profiling` - * :ref:`peripheral_rscs` - * :ref:`peripheral_status` - * :ref:`peripheral_uart` - * :ref:`ble_rpc_host` - - As a result, all :ref:`zephyr:nrf54h20dk_nrf54h20` configurations of the affected samples were migrated from the NVS settings backend to the ZMS settings backend. - * Testing steps in the :ref:`peripheral_hids_mouse` to provide the build configuration that is compatible with the `Bluetooth Low Energy app`_ testing tool. +|no_changes_yet_note| Bluetooth Fast Pair samples --------------------------- -* :ref:`fast_pair_locator_tag` sample: - - * Updated the MCUboot bootloader configuration for the :ref:`zephyr:nrf54l15dk_nrf54l15` board target to enable the :kconfig:option:`CONFIG_FPROTECT` Kconfig option that is used to protect the bootloader partition against memory corruption. +|no_changes_yet_note| Bluetooth Mesh samples ---------------------- @@ -361,26 +244,7 @@ Bluetooth Mesh samples Cellular samples ---------------- -* Updated the :kconfig:option:`CONFIG_NRF_CLOUD_CHECK_CREDENTIALS` Kconfig option to be optional and enabled by default for the following samples: - - * :ref:`nrf_cloud_rest_cell_location` - * :ref:`nrf_cloud_rest_device_message` - * :ref:`nrf_cloud_rest_fota` - -* :ref:`location_sample` sample: - - * Updated: - - * The Thingy:91 X build to support Wi-Fi by default without overlays. - * The Wi-Fi configurations to reduce the RAM usage by about 25 kB. - -* :ref:`modem_shell_application` sample: - - * Updated the Wi-Fi configurations to reduce the RAM usage by about 25 kB. - -* :ref:`nrf_cloud_multi_service` sample: - - * Updated the Wi-Fi configurations to reduce the RAM usage by about 12 kB for the nRF91 Series DK and 25 kB for the Thingy:91 X. +|no_changes_yet_note| Cryptography samples -------------------- @@ -395,32 +259,12 @@ Debug samples DECT NR+ samples ---------------- -* :ref:`dect_shell_application` sample: - - * Added: - - * The ``dect mac`` command. - A brief MAC-level sample on top of DECT PHY interface with new commands to create a periodic cluster beacon, scan for it, associate or disassociate a PT/client, and send data to a FT/beacon random access window. - This is not a full MAC implementation and not fully compliant with DECT NR+ MAC specification (`ETSI TS 103 636-4`_). - * The ``startup_cmd`` command. - This command is used to store shell commands to be run sequentially after bootup. - * Band 4 support for nRF9151 with modem firmware v1.0.2. - - * Updated: - - * The ``dect rssi_scan`` command with busy/possible/free subslot count-based RSSI scan. - * The ``dect rx`` command to provide the possibility to iterate all channels and to enable RX filter. +|no_changes_yet_note| Edge Impulse samples -------------------- -* :ref:`ei_data_forwarder_sample` sample: - - * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. - -* :ref:`ei_wrapper_sample` sample: - - * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board. +|no_changes_yet_note| Enhanced ShockBurst samples --------------------------- @@ -440,24 +284,7 @@ Keys samples Matter samples -------------- -* Added the :ref:`matter_samples_config` page that documents Kconfig options and snippets used by Matter samples and applications. - -* Updated: - - * All Matter samples that support low-power mode to enable the :ref:`lib_ram_pwrdn` feature. - It is enabled by default for the release configuration of the :ref:`matter_lock_sample`, :ref:`matter_light_switch_sample`, :ref:`matter_smoke_co_alarm_sample`, and :ref:`matter_window_covering_sample` samples. - * All Matter samples to enable the ZMS file subsystem in all devices that contain MRAM, such as the nRF54H Series devices. - -* Disabled pausing Matter watchdog while CPU is in idle state in all Matter samples. - To enable it set the :ref:`CONFIG_NCS_SAMPLE_MATTER_WATCHDOG_PAUSE_IN_SLEEP` Kconfig option to ``y``. - -* :ref:`matter_template_sample` sample: - - * Updated the internal configuration for the :ref:`zephyr:nrf54l15dk_nrf54l15` target to use the DFU image compression and provide more memory space for the application. - -* :ref:`matter_smoke_co_alarm_sample` sample: - - * Added support for ICD dynamic SIT LIT switching (DSLS). +|no_changes_yet_note| Networking samples ------------------ @@ -477,7 +304,7 @@ nRF5340 samples Peripheral samples ------------------ -* Added support for the ``nrf54l15dk/nrf54l05/cpuapp`` and ``nrf54l15dk/nrf54l10/cpuapp`` board targets in the :ref:`radio_test` sample. +|no_changes_yet_note| PMIC samples ------------ @@ -487,8 +314,7 @@ PMIC samples Protocol serialization samples ------------------------------ -* Updated GPIO pins on nRF54L15 DK used for communication between the client and server over UART. - One of the previously selected pins was also used to drive an LED, which may have disrupted the UART communication. +|no_changes_yet_note| SDFW samples ------------ @@ -514,7 +340,7 @@ Trusted Firmware-M (TF-M) samples Thread samples -------------- -* Removed support for the ``nrf5340dk/nrf5340/cpuapp/ns`` build target for all samples. +|no_changes_yet_note| Zigbee samples -------------- @@ -529,19 +355,7 @@ Wi-Fi samples Other samples ------------- -* :ref:`coremark_sample` sample: - - * Updated: - - * Configuration for the :ref:`zephyr:nrf54h20dk_nrf54h20` board to support multi-domain logging using the ARM Coresight STM. - * The logging format in the standard logging mode to align it with the format used in the multi-domain logging mode. - * Support for alternative configurations to use the :ref:`file suffix feature from Zephyr `. - The following file suffixes are supported as alternative configurations: - - * ``flash_and_run`` - * ``heap_memory`` - * ``static_memory`` - * ``multiple_threads`` +|no_changes_yet_note| Drivers ======= @@ -553,7 +367,7 @@ This section provides detailed lists of changes by :ref:`driver `. Wi-Fi drivers ------------- -* Added the :ref:`nrf70_wifi_tx_power_calculation` section to the :ref:`nrf70_wifi` page. +|no_changes_yet_note| Libraries ========= @@ -563,18 +377,12 @@ This section provides detailed lists of changes by :ref:`library `. Binary libraries ---------------- -* :ref:`liblwm2m_carrier_readme` library: - - * Updated the :ref:`req_appln_limitations` page to clarify carrier-specific requirements. - Added overlay files and documentation to :ref:`serial_lte_modem` application and :ref:`lwm2m_carrier` sample to guide in the correct usage of LwM2M carrier library for SoftBank and LG U+. +|no_changes_yet_note| Bluetooth libraries and services -------------------------------- -* :ref:`hogp_readme` library: - - * Updated the :c:func:`bt_hogp_rep_read` function to forward the GATT read error code through the registered user callback. - This ensures that API user is aware of the error. +|no_changes_yet_note| Common Application Framework ---------------------------- @@ -624,7 +432,7 @@ Libraries for NFC nRF RPC libraries ----------------- -* Added the :ref:`nrf_rpc_dev_info` library for obtaining information about a device connected through the :ref:`nrfxlib:nrf_rpc`. +|no_changes_yet_note| Other libraries --------------- @@ -656,7 +464,7 @@ Scripts This section provides detailed lists of changes by :ref:`script `. -* Added semantic version support to :ref:`nrf_desktop_config_channel_script` Python script for devices that use the SUIT DFU. +|no_changes_yet_note| Integrations ============ @@ -756,9 +564,4 @@ cJSON Documentation ============= -* Added: - - * Nordic Thingy:91 X to the list of devices supported by the `Quick Start app`_ on the :ref:`gsg_guides` page. - * The :ref:`matter_samples_config` page that documents Kconfig options and snippets shared by Matter samples and applications. - -* Fixed an issue on the :ref:`install_ncs` page where an incorrect directory path was provided for Linux and macOS at the end of the :ref:`cloning_the_repositories_win` section. +|no_changes_yet_note| From cca916add9e6428c8ded5f46f49c40504c6e6e61 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Thu, 5 Dec 2024 18:29:12 +0200 Subject: [PATCH 40/46] version: Update to 2.9.99 Update VERSION file for the next development version. Signed-off-by: Jukka Rissanen --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 4bf4e2b8f634..e7d47299cdb1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.9.0-rc1 +2.9.99 From 5f8a96959eadd39c1bfef6b44307864568740bdb Mon Sep 17 00:00:00 2001 From: Sylwester Konczyk Date: Thu, 5 Dec 2024 07:58:27 +0100 Subject: [PATCH 41/46] suit: manifest-controlled variables Now manifests may declare MFST_VAR components Ref: NCSDK-30530 Signed-off-by: Sylwester Konczyk --- subsys/suit/Kconfig | 1 + .../platform/include/suit_platform_internal.h | 5 ++++ subsys/suit/platform/sdfw/CMakeLists.txt | 2 +- .../src/suit_plat_component_compatibility.c | 28 +++++++++++++++++++ subsys/suit/utils/src/suit_plat_decode_util.c | 3 ++ 5 files changed, 38 insertions(+), 1 deletion(-) diff --git a/subsys/suit/Kconfig b/subsys/suit/Kconfig index 47dbb8ab4b80..ccc059cff390 100644 --- a/subsys/suit/Kconfig +++ b/subsys/suit/Kconfig @@ -83,6 +83,7 @@ config SUIT_DFU_CANDIDATE_PROCESSING_FULL imply SUIT_MEMPTR_STORAGE imply SUIT_PLATFORM imply SUIT_PROCESSOR + imply SUIT_MANIFEST_VARIABLES imply SUIT_MPI_GENERATE imply SUIT_SINK_SELECTOR diff --git a/subsys/suit/platform/include/suit_platform_internal.h b/subsys/suit/platform/include/suit_platform_internal.h index 03d95f5e2abc..60d4dad853ad 100644 --- a/subsys/suit/platform/include/suit_platform_internal.h +++ b/subsys/suit/platform/include/suit_platform_internal.h @@ -50,6 +50,11 @@ typedef enum { * be stored, ready for installation. */ SUIT_COMPONENT_TYPE_CACHE_POOL, + + /** Manifest-accessible variables. + */ + SUIT_COMPONENT_TYPE_MFST_VAR, + } suit_component_type_t; /** Set the pointer to the implementation-specific data. */ diff --git a/subsys/suit/platform/sdfw/CMakeLists.txt b/subsys/suit/platform/sdfw/CMakeLists.txt index 843e1f58848f..8b16706c27e4 100644 --- a/subsys/suit/platform/sdfw/CMakeLists.txt +++ b/subsys/suit/platform/sdfw/CMakeLists.txt @@ -45,7 +45,7 @@ zephyr_library_link_libraries_ifdef(CONFIG_SUIT_AUTHENTICATE suit_mci) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_PLAT_CHECK_COMPONENT_COMPATIBILITY suit_mci) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_STREAM_FILTER_DECRYPT suit_stream_filters_interface) zephyr_library_link_libraries_ifdef(CONFIG_SUIT_EVENTS suit_events) - +zephyr_library_link_libraries_ifdef(CONFIG_SUIT_MANIFEST_VARIABLES suit_manifest_variables) zephyr_library_link_libraries(suit_sdfw_platform) zephyr_library_link_libraries(suit_utils) diff --git a/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c b/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c index 2129c0820ba4..57c2a917f276 100644 --- a/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c +++ b/subsys/suit/platform/sdfw/src/suit_plat_component_compatibility.c @@ -8,10 +8,17 @@ #include #include #include +#include + +#ifdef CONFIG_SUIT_MANIFEST_VARIABLES +#include +#endif /* CONFIG_SUIT_MANIFEST_VARIABLES */ /* -1 indicates no boot capability for given cpu id */ #define NO_BOOT_CAPABILITY_CPU_ID 255 +LOG_MODULE_REGISTER(suit_plat_component_compat, CONFIG_SUIT_LOG_LEVEL); + int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *class_id, struct zcbor_string *component_id) { @@ -36,6 +43,7 @@ int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *clas } if (suit_plat_decode_component_type(component_id, &type) != SUIT_PLAT_SUCCESS) { + LOG_ERR("Unrecognized component type"); return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; } @@ -123,6 +131,26 @@ int suit_plat_component_compatibility_check(const suit_manifest_class_id_t *clas break; +#ifdef CONFIG_SUIT_MANIFEST_VARIABLES + + case SUIT_COMPONENT_TYPE_MFST_VAR: + + uint32_t val; + + if (suit_plat_decode_component_number(component_id, &number) != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + /* Let's check if given component is supported by reading out its content + */ + if (suit_mfst_var_get(number, &val) != SUIT_PLAT_SUCCESS) { + return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; + } + + break; + +#endif /* CONFIG_SUIT_MANIFEST_VARIABLES */ + default: return SUIT_ERR_UNSUPPORTED_COMPONENT_ID; } diff --git a/subsys/suit/utils/src/suit_plat_decode_util.c b/subsys/suit/utils/src/suit_plat_decode_util.c index edc1aec191b6..44ca74a550c1 100644 --- a/subsys/suit/utils/src/suit_plat_decode_util.c +++ b/subsys/suit/utils/src/suit_plat_decode_util.c @@ -84,6 +84,9 @@ suit_plat_err_t suit_plat_decode_component_type(struct zcbor_string *component_i } else if ((tmp.len == strlen("CACHE_POOL")) && (memcmp(tmp.value, "CACHE_POOL", tmp.len) == 0)) { *type = SUIT_COMPONENT_TYPE_CACHE_POOL; + } else if ((tmp.len == strlen("MFST_VAR")) && + (memcmp(tmp.value, "MFST_VAR", tmp.len) == 0)) { + *type = SUIT_COMPONENT_TYPE_MFST_VAR; } else { *type = SUIT_COMPONENT_TYPE_UNSUPPORTED; return SUIT_PLAT_ERR_CBOR_DECODING; From 2a8fa323ebfa3f7a107716a57019d77e641f24ed Mon Sep 17 00:00:00 2001 From: Aleksander Strzebonski Date: Wed, 4 Dec 2024 16:04:30 +0100 Subject: [PATCH 42/46] samples: bluetooth: fast_pair: Align Tx power for nRF54H20DK Just edits the comment as default configuration is already aligned with nRF54H20DK. Jira: NCSDK-30345 Signed-off-by: Aleksander Strzebonski --- samples/bluetooth/fast_pair/input_device/prj.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/bluetooth/fast_pair/input_device/prj.conf b/samples/bluetooth/fast_pair/input_device/prj.conf index be962f800f07..60c0ac32e5e9 100644 --- a/samples/bluetooth/fast_pair/input_device/prj.conf +++ b/samples/bluetooth/fast_pair/input_device/prj.conf @@ -42,6 +42,7 @@ CONFIG_BT_ADV_PROV_GAP_APPEARANCE_SD=y # * nrf52833dk/nrf52833 # * nrf52840dk/nrf52840 # * nrf5340dk/nrf5340/cpuapp(/ns) +# * nrf54h20dk/nrf54h20/cpuapp CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-15 # Use a separate workqueue for connection TX notify processing. This is done to work From f38b454ff5be606423fafde6f7b4db8c26b0cc86 Mon Sep 17 00:00:00 2001 From: Marcin Jelinski Date: Tue, 3 Dec 2024 12:47:06 +0100 Subject: [PATCH 43/46] applications: ipc_radio: Enable ZMS for nRF54H20 platform Enabled the ZMS file system for the nRF54H20 DK in the IPC Radio. Ref: NCSDK-30670 Signed-off-by: Marcin Jelinski --- applications/ipc_radio/Kconfig | 4 ++++ applications/ipc_radio/overlay-bt_rpc.conf | 1 - .../releases/release-notes-changelog.rst | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/applications/ipc_radio/Kconfig b/applications/ipc_radio/Kconfig index 82550a967d9c..8abe682d2e45 100644 --- a/applications/ipc_radio/Kconfig +++ b/applications/ipc_radio/Kconfig @@ -40,6 +40,10 @@ config IPC_RADIO_BT_RPC endchoice # IPC_RADIO_BT_SER +config SETTINGS + imply ZMS if SOC_FLASH_NRF_MRAM + imply NVS if !SOC_FLASH_NRF_MRAM + config BT_MAX_CONN default 4 if IPC_RADIO_802154 default 16 if !IPC_RADIO_802154 diff --git a/applications/ipc_radio/overlay-bt_rpc.conf b/applications/ipc_radio/overlay-bt_rpc.conf index 6be2cd48f1fd..983e191933ab 100644 --- a/applications/ipc_radio/overlay-bt_rpc.conf +++ b/applications/ipc_radio/overlay-bt_rpc.conf @@ -21,7 +21,6 @@ CONFIG_BT_SETTINGS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y -CONFIG_NVS=y CONFIG_SETTINGS=y CONFIG_IPC_RADIO_BT=y 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 c7787ff74e55..2c33987731c3 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -183,7 +183,7 @@ Connectivity Bridge IPC radio firmware ------------------ -|no_changes_yet_note| +* Updated the application to enable the :ref:`Zephyr Memory Storage (ZMS) ` file system in all devices that contain MRAM, such as the nRF54H Series devices. Matter Bridge ------------- From e411ad5bcc89a0db838062ff1032c2414ca50229 Mon Sep 17 00:00:00 2001 From: Anna Wojdylo Date: Fri, 29 Nov 2024 11:00:09 +0100 Subject: [PATCH 44/46] doc: mcuboot signing app with flpr payload added a new article. reordered the index page. Signed-off-by: Anna Wojdylo --- .../app_dev/device_guides/nrf54l/index.rst | 15 +- .../nrf54l/nrf54l_signing_with_payload.rst | 243 ++++++++++++++++++ .../app_dev/device_guides/nrf54l/vpr_flpr.rst | 6 + 3 files changed, 257 insertions(+), 7 deletions(-) create mode 100644 doc/nrf/app_dev/device_guides/nrf54l/nrf54l_signing_with_payload.rst diff --git a/doc/nrf/app_dev/device_guides/nrf54l/index.rst b/doc/nrf/app_dev/device_guides/nrf54l/index.rst index 0b0c741505b8..00a42fa11442 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/index.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/index.rst @@ -26,16 +26,16 @@ Zephyr and the |NCS| provide support and contain board definitions for developin | `User Guide `_ - | `nRF54L15 DK product page `_ | `nRF54L15 System-on-Chip (SoC) `_ - * - nRF54L05 emulation on the nRF54L15 DK - - PCA10156 - - ``nrf54l15dk/nrf54l05/cpuapp`` - - | `Datasheet `_ - - | `nRF54L05 System-on-Chip (SoC) `_ * - nRF54L10 emulation on the nRF54L15 DK - PCA10156 - ``nrf54l15dk/nrf54l10/cpuapp`` - | `Datasheet `_ - | `nRF54L10 System-on-Chip (SoC) `_ + * - nRF54L05 emulation on the nRF54L15 DK + - PCA10156 + - ``nrf54l15dk/nrf54l05/cpuapp`` + - | `Datasheet `_ + - | `nRF54L05 System-on-Chip (SoC) `_ .. _ug_nrf54L15_revision: @@ -64,8 +64,9 @@ Ensure to check the revision of your nRF54L15 device to see if it is supported: features zms cryptography - fota_update - kmu_provision testing_dfu vpr_flpr building_nrf54l + nrf54l_signing_with_payload + fota_update + kmu_provision diff --git a/doc/nrf/app_dev/device_guides/nrf54l/nrf54l_signing_with_payload.rst b/doc/nrf/app_dev/device_guides/nrf54l/nrf54l_signing_with_payload.rst new file mode 100644 index 000000000000..262c6457f7dd --- /dev/null +++ b/doc/nrf/app_dev/device_guides/nrf54l/nrf54l_signing_with_payload.rst @@ -0,0 +1,243 @@ +.. _nRF54l_signing_app_with_flpr_payload: + +Signing applications with integrated FLPR payload +################################################# + +.. contents:: + :local: + :depth: 2 + +The nRF54L SoCs include a FLPR CPU designed to handle fast communication with external devices independently, enhancing flexibility in protocol implementation. +For details, see :ref:`vpr_flpr_nrf54l`. + +You can dynamically load and modify the FLPR code during runtime. +This guide describes how to build the application and FLPR cores, creating a single file, signed and managed by MCUboot, with FLPR integrated and executable from the application slot. + +Requirements and limitations +**************************** + +MCUboot requires the application and the FLPR application to be concatenated and signed together to treat them as a single image. +To do this, you have to build the main application (CPUAPP application) and the FLPR application separately, manually merge them, and sign them for MCUboot. + +In addition to these requirements, there are also limitations caused by sysbuild. +The FLPR application cannot be built as part of the main sysbuild process. +Instead, the CPUAPP application can be built with MCUboot integration, while the FLPR must be built separately and then merged. +For details, see :ref:`building_nrf54l`. +Note that the DTS file for the CPUAPP application must reserve a required area for the FLPR binary. + +Using Partition Manager +======================= + +For :ref:`partition_manager`, applications can only use static definitions. +In the current version of the |NCS|, the CPUAPP application and the FLPR application use different partitioning definitions. +The CPUAPP application follows the Partition Manager's scheme, while FLPR relies on DTS partitioning and disregards the Partition Manager scheme. +For this reason, partitions defined for FLPR in DTS must also be reserved in the Partition Manager to ensure consistency. +In addition, FLPR partition parameters such as size and offset must be aligned in the DTS definition, the FLPR application project, and the Partition Manager scheme of the CPUAPP project. + +Placement of the FLPR binary on storage devices is flexible, however, the loading mechanism must be aware of its starting point, which is specified in the DTS file. +You must ensure that the FLPR partition in both the DTS and Partition Manager leaves sufficient space at the end for MCUboot swap information, which is necessary to update the application image. +The build system will not check if the compiled application satisfies the size requirements (see the NCSDK-20567 issue on the :ref:`known_issues` page). + +Creating a project with FLPR core +********************************* + +Each project (CPUAPP application and the FLPR application) can independently enable sysbuild. +The CPUAPP application, operating on the application core, requires the integration of MCUboot as the bootloader to ensure proper boot management and security. +The FLPR application operates independently from the main project structure, allowing it to be built separately. + +Configuring memory partitions +***************************** + +When the FLPR application is built, partitioning must be done through DTS. +This is necessary because the Partition Manager does not currently support or recognize the FLPR application. + +When building the main application that incorporates FLPR, ensure that the Partition Manager is enabled. +Your setup must reserve a partition for the FLPR that reflects the layout defined by the FLPR application. +For details on configuring partitions, see the following sections. + +DTS memory definitions for FLPR application +=========================================== + +Define FLPR partitions for the FLPR application as follows, using example addresses: + +.. code-block:: dts + + &cpuflpr_rram { + reg = <0x98000 0x20000>; + }; + +This configuration sets up a partition starting at address ``0x98000`` with a size of ``0x20000``. + +DTS memory definitions for CPUAPP application +============================================= + +To ensure the CPUAPP application functions correctly with the FLPR payload, you must apply specific configurations. + +Memory partition configuration +------------------------------ + +See an example of memory partition configuration: + +.. code-block:: dts + + /{ + soc { + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + cpuflpr_code_partition: image@98000 { + /* FLPR core code partition */ + reg = <0x98000 0x20000>; + }; + }; + cpuflpr_sram_code_data: memory@20028000 { + compatible = "mmio-sram"; + reg = <0x20028000 DT_SIZE_K(96)>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x20028000 0x18000>; + }; + }; + }; + &cpuapp_sram { + reg = <0x20000000 DT_SIZE_K(160)>; + ranges = <0x0 0x20000000 0x28000>; + }; + +1. Adjust the following partitions: + + * ``cpuflpr_code_partition`` - This partition defines where the FLPR code is placed on the storage device. + The code is later loaded by the CPUAPP application. + + * Location: 0x98000 + * Size: 0x20000 + + Ensure the ``cpuflpr_code_partition`` does not extend to the end of the image slot. + You must leave space for the MCUboot swap information. + + .. note:: + + When using the Partition Manager, ensure this partition is reserved for FLPR. + The Partition Manager will ignore this setting while allocating space for the application running on CPUAPP, but the :ref:`FLPR minimal sample ` will still utilize it. + + * ``cpuflpr_sram_code_data`` - This configuration defines the RAM space reserved only for the FLPR. + It is not available for the application core and should be excluded from its memory allocation. + + * Compatible with ``mmio-sram``. + * Location: 0x20028000 + * Size: 96KB + + * ``cpuapp_sram`` - This configuration defines the RAM limit for the CPUAPP application. + + * Location: 0x20000000 + * Size: 160KB + +#. Configure the CPUAPP application as follows for it to recognize the placement of the FLPR code: + + .. code-block:: dts + + &cpuflpr_vpr { + execution-memory = <&cpuflpr_sram_code_data>; + source-memory = <&cpuflpr_code_partition>; + }; + + where + + * The ``execution-memory`` links SRAM definitions to FLPR (``cpuflpr_sram_code_data``). + * The ``source-memory`` links RRAM definitions to FLPR (``cpuflpr_code_partition``). + + These links inform the main application about the memory usage by the FLPR core. + +Partition Manager configuration +------------------------------- + +Adjust the static definitions in the Partition Manager as follows: + +* For the FLPR partition (``flpr0``): + + .. code-block:: dts + + flpr0: + address: 0x98000 + end_address: 0xb8000 + region: flash_primary + size: 0x20000 + + The ``address`` and ``size`` must match the DTS definitions. + The ``end_address`` is the sum of the address and size. + +* For the ``mcuboot_primary_app`` configuration: + + .. code-block:: dts + + mcuboot_primary_app: + address: 0xc800 + end_address: 0xb8000 + orig_span: &id002 + - app + - flpr0 + region: flash_primary + size: 0xab800 + span: *id002 + + This configuration indicates that ``flpr0`` is now set within ``mcuboot_primary_app``, meaning it is part of the image. + +Building project +**************** + +For detailed instructions on how to build your project, see :ref:`building_nrf54l`. + +Creating a single image +*********************** + +After the build is complete, you must manually collect the artifacts into a single image for MCUboot to work correctly. + +Merging binaries +================ + +Once you have successfully built the CPUAPP and FLPR applications separately and using sysbuild, you can merge the files. + +1. Locate the :file:`zephyr.hex` files for both applications: + + * For CPUAPP, find the :file:`build//zephyr/zephyr.hex` file. + * For FLPR, find the :file:`/zephyr/zephyr.hex` file. + +#. If you do not have your environment set up, first source the :file:`zephyr_env.sh` script or ensure you have set the ``ZEPHYR_BASE`` environmental variable to the Zephyr directory used for building. + +#. Execute the merge command: + + .. code-block:: console + + python3 ${ZEPHYR_BASE}/scripts/build/mergehex.py /zephyr/zephyr.hex build//zephyr/zephyr.hex -o app_and_flpr_merged.hex + + It results in creating the :file:`app_and_flpr_merged.hex` file that contains both the FLPR and CPUAPP application. + + .. note:: + + Merging errors, where memory locations overlap in both HEX files, indicate misalignment between DTS and Partition Manager definitions for FLPR and CPUAPP. This suggests that FLPR is built in an area already allocated to the application. + To resolve this issue, you must check and adjust the settings in either the Partition Manager, the DTS, or both, to ensure that the FLPR-designated area does not overlap with the application-designated area. + +Signing binaries +================ + +For MCUboot, the merged HEX file (:file:`app_and_flpr_merged.hex`) is a single application that must be signed. + +1. Calculate the slot size by using the ``mcuboot_primary_app`` configuration. + The ``0xac000`` comes from the following calculation: ``0xab800 + 0x800 = 0xac000``, where ``0xab800`` represents the total size of the primary application area, and ``0x800`` is added to accommodate the metadata required by MCUboot, resulting in a total ``slot_size`` of ``0xac000``. + +#. Using the :doc:`imgtool`, sign the merged application. + + .. code-block:: console + + python3 ${ZEPHYR_BASE}/bootloader/mcuboot/scripts/imgtool.py sign --version --align 16 --slot-size 0xac000 --pad-header --header-size 0x800 -k app_and_flpr_merged.hex app_and_flpr_merged.signed.hex + python3 ${ZEPHYR_BASE}/bootloader/mcuboot/scripts/imgtool.py sign --version --align 16 --slot-size 0xac000 --pad-header --header-size 0x800 -k app_and_flpr_merged.hex app_and_flpr_merged.signed.bin + + Adjust the following values in the script: + + * Replace ``0xac000`` in the command line with the calculated value. + * Replace ```` with the application version and ```` with the :ref:`signature key `. + + At the end of this process, you will have two files: + + * The :file:`app_and_flpr_merged.signed.hex` file, that is an application you can :ref:`program directly to the device`. + * The :file:`app_and_flpr_merged.signed.bin` file, that is an application that can be :ref:`uploaded as an update`. diff --git a/doc/nrf/app_dev/device_guides/nrf54l/vpr_flpr.rst b/doc/nrf/app_dev/device_guides/nrf54l/vpr_flpr.rst index c5c7dd991263..4358733d9921 100644 --- a/doc/nrf/app_dev/device_guides/nrf54l/vpr_flpr.rst +++ b/doc/nrf/app_dev/device_guides/nrf54l/vpr_flpr.rst @@ -38,6 +38,12 @@ Snippet's primary function is to enable the code that transfers the FLPR code to When building for the ``nrf54l15dk/nrf54l15/cpuflpr`` target, a minimal sample is automatically loaded onto the application core. See more information on :ref:`building_nrf54l_app_flpr_core`. +Using MCUboot with FLPR +*********************** + +To ensure that MCUboot functions correctly with a FLPR-integrated application, several manual configurations are necessary. +For details, see :ref:`nRF54l_signing_app_with_flpr_payload`. + Memory allocation ***************** From 438cbeaa2c242f2ba2198cb1459f7d36e92e54d3 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 26 Nov 2024 09:18:31 +0000 Subject: [PATCH 45/46] samples: bluetooth: direct_test_mode: Move nRF52840 Kconfig to SoC Moves this from being a board Kconfig fragment file, one for each board, to a single SoC Kconfig fragment file Signed-off-by: Jamie McCrae --- .../direct_test_mode/boards/nrf52840dk_nrf52840.conf | 8 -------- .../nrf21540dk_nrf52840.conf => socs/nrf52840.conf} | 0 2 files changed, 8 deletions(-) delete mode 100644 samples/bluetooth/direct_test_mode/boards/nrf52840dk_nrf52840.conf rename samples/bluetooth/direct_test_mode/{boards/nrf21540dk_nrf52840.conf => socs/nrf52840.conf} (100%) diff --git a/samples/bluetooth/direct_test_mode/boards/nrf52840dk_nrf52840.conf b/samples/bluetooth/direct_test_mode/boards/nrf52840dk_nrf52840.conf deleted file mode 100644 index 6917a91860d6..000000000000 --- a/samples/bluetooth/direct_test_mode/boards/nrf52840dk_nrf52840.conf +++ /dev/null @@ -1,8 +0,0 @@ -# -# Copyright (c) 2021 Nordic Semiconductor -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -# Use an additional timer for Anomaly 172 -CONFIG_NRFX_TIMER3=y diff --git a/samples/bluetooth/direct_test_mode/boards/nrf21540dk_nrf52840.conf b/samples/bluetooth/direct_test_mode/socs/nrf52840.conf similarity index 100% rename from samples/bluetooth/direct_test_mode/boards/nrf21540dk_nrf52840.conf rename to samples/bluetooth/direct_test_mode/socs/nrf52840.conf From 8528b926b2dd8a3f4f73d098cde8f7bae47c2308 Mon Sep 17 00:00:00 2001 From: Artur Hadasz Date: Wed, 4 Dec 2024 14:49:50 +0100 Subject: [PATCH 46/46] suit: Move recovery button to app tools Created a SUIT app_tools directory and moved the recovery button subsys into this directory Signed-off-by: Artur Hadasz --- .../v1/app_recovery_local_envelope.yaml.jinja2 | 2 +- .../v1/root_with_binary_nordic_top.yaml.jinja2 | 2 +- subsys/suit/CMakeLists.txt | 2 +- subsys/suit/Kconfig | 2 +- subsys/suit/app_tools/CMakeLists.txt | 7 +++++++ subsys/suit/app_tools/Kconfig | 16 ++++++++++++++++ .../recovery_button/CMakeLists.txt | 0 .../suit/{ => app_tools}/recovery_button/Kconfig | 2 ++ .../recovery_button/src/suit_recovery_button.c | 0 9 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 subsys/suit/app_tools/CMakeLists.txt create mode 100644 subsys/suit/app_tools/Kconfig rename subsys/suit/{ => app_tools}/recovery_button/CMakeLists.txt (100%) rename subsys/suit/{ => app_tools}/recovery_button/Kconfig (91%) rename subsys/suit/{ => app_tools}/recovery_button/src/suit_recovery_button.c (100%) diff --git a/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 index 0a6f03f11861..6198ff8a3b19 100644 --- a/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/app_recovery_local_envelope.yaml.jinja2 @@ -65,7 +65,7 @@ SUIT_Envelope_Tagged: - suit-send-sysinfo-failure suit-invoke: - suit-directive-set-component-index: 0 -{%- if 'CONFIG_SUIT_RECOVERY_BUTTON' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_RECOVERY_BUTTON] != '' %} +{%- if 'CONFIG_SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP] != '' %} - suit-directive-override-parameters: suit-parameter-invoke-args: suit-synchronous-invoke: True diff --git a/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 b/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 index b9af88070eaf..c7205e671aa0 100644 --- a/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 +++ b/config/suit/templates/nrf54h20/default/v1/root_with_binary_nordic_top.yaml.jinja2 @@ -20,7 +20,7 @@ {%- set mpi_app_recovery_local_vendor_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_VENDOR_NAME']|default('nordicsemi.com') %} {%- set mpi_app_recovery_local_class_name = main_config['config']['CONFIG_SUIT_MPI_APP_LOCAL_3_CLASS_NAME']|default('nRF54H20_sample_app_3') %} {%- endif %} -{%- if app_recovery_img is defined and 'CONFIG_SUIT_RECOVERY_BUTTON' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_RECOVERY_BUTTON] != '' %} +{%- if app_recovery_img is defined and 'CONFIG_SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP' in app_recovery_img['config'] and app_recovery_img['config'][CONFIG_SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP] != '' %} {%- set recovery_button_check_on_invoke = True %} {%- else %} {%- set recovery_button_check_on_invoke = False %} diff --git a/subsys/suit/CMakeLists.txt b/subsys/suit/CMakeLists.txt index 9141c2a1c850..8f4c3aba6d95 100644 --- a/subsys/suit/CMakeLists.txt +++ b/subsys/suit/CMakeLists.txt @@ -5,6 +5,7 @@ # add_subdirectory(provisioning) +add_subdirectory(app_tools) add_subdirectory_ifdef(CONFIG_SUIT plat_err) add_subdirectory_ifdef(CONFIG_SUIT memory_layout) add_subdirectory_ifdef(CONFIG_SUIT_ORCHESTRATOR orchestrator) @@ -21,5 +22,4 @@ add_subdirectory_ifdef(CONFIG_SUIT_ENVELOPE_INFO envelope_info) add_subdirectory_ifdef(CONFIG_SUIT_EXECUTION_MODE execution_mode) add_subdirectory_ifdef(CONFIG_SUIT_VALIDATOR validator) add_subdirectory_ifdef(CONFIG_SUIT_EVENTS events) -add_subdirectory_ifdef(CONFIG_SUIT_RECOVERY_BUTTON recovery_button) add_subdirectory_ifdef(CONFIG_SUIT_MANIFEST_VARIABLES manifest_variables) diff --git a/subsys/suit/Kconfig b/subsys/suit/Kconfig index ccc059cff390..e1f23ba342e4 100644 --- a/subsys/suit/Kconfig +++ b/subsys/suit/Kconfig @@ -200,7 +200,7 @@ rsource "execution_mode/Kconfig" rsource "memory_layout/Kconfig" rsource "validator/Kconfig" rsource "events/Kconfig" -rsource "recovery_button/Kconfig" +rsource "app_tools/Kconfig" rsource "manifest_variables/Kconfig" # Configure SUIT_LOG_LEVEL diff --git a/subsys/suit/app_tools/CMakeLists.txt b/subsys/suit/app_tools/CMakeLists.txt new file mode 100644 index 000000000000..9083e6ca0718 --- /dev/null +++ b/subsys/suit/app_tools/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +add_subdirectory_ifdef(CONFIG_SUIT_RECOVERY_BUTTON recovery_button) diff --git a/subsys/suit/app_tools/Kconfig b/subsys/suit/app_tools/Kconfig new file mode 100644 index 000000000000..c215407d2c70 --- /dev/null +++ b/subsys/suit/app_tools/Kconfig @@ -0,0 +1,16 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +config SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP + bool "Run recovery before main application on startup" + help + This Kconfig option should be set if the app_local_3 manifest application should be invoked + on startup before the main application. + This is useful if a companion image (most commonly the same iamge as the recovery application + core image) is to be used for checking conditions (such as checking + if a button is pressed) and optionally entering the recovery mode. + +rsource "recovery_button/Kconfig" diff --git a/subsys/suit/recovery_button/CMakeLists.txt b/subsys/suit/app_tools/recovery_button/CMakeLists.txt similarity index 100% rename from subsys/suit/recovery_button/CMakeLists.txt rename to subsys/suit/app_tools/recovery_button/CMakeLists.txt diff --git a/subsys/suit/recovery_button/Kconfig b/subsys/suit/app_tools/recovery_button/Kconfig similarity index 91% rename from subsys/suit/recovery_button/Kconfig rename to subsys/suit/app_tools/recovery_button/Kconfig index c575d1e0a027..cc4ecd8f2563 100644 --- a/subsys/suit/recovery_button/Kconfig +++ b/subsys/suit/app_tools/recovery_button/Kconfig @@ -9,7 +9,9 @@ DT_CHOSEN_NCS_RECOVERY_BUTTON := ncs,recovery-button config SUIT_RECOVERY_BUTTON bool "Enable SUIT enter recovery button checking on startup" depends on $(dt_chosen_enabled,$(DT_CHOSEN_NCS_RECOVERY_BUTTON)) + default y select SSF_SUIT_SERVICE_ENABLED + select SUIT_INVOKE_APP_LOCAL_3_BEFORE_MAIN_APP help This will make the firmware check if the recovery button specified in the device tree is pressed on startup. If it is, the firmware will enter diff --git a/subsys/suit/recovery_button/src/suit_recovery_button.c b/subsys/suit/app_tools/recovery_button/src/suit_recovery_button.c similarity index 100% rename from subsys/suit/recovery_button/src/suit_recovery_button.c rename to subsys/suit/app_tools/recovery_button/src/suit_recovery_button.c