From f3ac9cfb784d163f4c1af11209976fcd5c403d5a Mon Sep 17 00:00:00 2001 From: Kamil Piszczek Date: Wed, 11 Dec 2024 10:16:51 +0100 Subject: [PATCH] samples: bluetooth: fast_pair: locator_tag: add nRF54H20 DK support Added support for the nRF54H20 DK build target in the Fast Pair Locator Tag sample. Ref: NCSDK-30339 Signed-off-by: Kamil Piszczek --- .../releases/release-notes-changelog.rst | 4 +- .../fast_pair/locator_tag/Kconfig.sysbuild | 7 +- .../fast_pair/locator_tag/README.rst | 82 ++++++++++++++----- .../boards/nrf54h20dk_nrf54h20_cpuapp.conf | 7 ++ .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 44 ++++++++++ .../locator_tag/configuration/prj.conf | 1 + .../configuration/prj_release.conf | 1 + .../fast_pair/locator_tag/sample.yaml | 4 + .../fast_pair/locator_tag/src/Kconfig.dfu | 2 +- .../nrf54h20dk_nrf54h20_cpuapp/sysbuild.conf | 7 ++ 10 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.conf create mode 100644 samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.overlay create mode 100644 samples/bluetooth/fast_pair/locator_tag/sysbuild/configuration/nrf54h20dk_nrf54h20_cpuapp/sysbuild.conf 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 4e1804ca74f0..e8417f9579be 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -238,7 +238,9 @@ Bluetooth samples Bluetooth Fast Pair samples --------------------------- -|no_changes_yet_note| +* :ref:`fast_pair_locator_tag` sample: + + * Added support for the :ref:`zephyr:nrf54h20dk_nrf54h20` board target. Bluetooth Mesh samples ---------------------- diff --git a/samples/bluetooth/fast_pair/locator_tag/Kconfig.sysbuild b/samples/bluetooth/fast_pair/locator_tag/Kconfig.sysbuild index aba610665805..00405d3652bd 100644 --- a/samples/bluetooth/fast_pair/locator_tag/Kconfig.sysbuild +++ b/samples/bluetooth/fast_pair/locator_tag/Kconfig.sysbuild @@ -10,6 +10,11 @@ config BT_FAST_PAIR config APP_DFU bool "Enable MCUmgr OTA DFU over Bluetooth" default y - depends on BOOTLOADER_MCUBOOT + depends on BOOTLOADER_MCUBOOT || SOC_SERIES_NRF54HX + help + This option enables the DFU functionality in this application. + The DFU solution is supported for the MCUboot-based targets + (BOOTLOADER_MCUBOOT Kconfig) and for the SUIT-based targets + (SOC_SERIES_NRF54HX Kconfig). source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" diff --git a/samples/bluetooth/fast_pair/locator_tag/README.rst b/samples/bluetooth/fast_pair/locator_tag/README.rst index 5eb9bf809b16..df9f8050dc7d 100644 --- a/samples/bluetooth/fast_pair/locator_tag/README.rst +++ b/samples/bluetooth/fast_pair/locator_tag/README.rst @@ -135,11 +135,17 @@ To start Fast Pair discoverable advertising after the FMDN unprovisioning and fa Device Firmware Update (DFU) ============================ -The locator tag sample uses the :ref:`MCUboot ` bootloader firmware image, enabling application firmware image upgrades through the :ref:`app_dfu` procedure. -Over-the-air updates are supported using MCUmgr's Simple Management Protocol (SMP) over Bluetooth. +The locator tag sample supports over-the-air updates using MCUmgr's Simple Management Protocol (SMP) over Bluetooth. +The application configures the appropriate DFU solution in relation to the selected board target (see the following table for more details). +The following DFU solutions are supported in this sample: + +* The :ref:`MCUboot ` bootloader solution. + See the :ref:`app_dfu` user guide for more information. +* The Software Update for Internet of Things (SUIT) solution. + See the :ref:`SUIT ` user guide for more information. To enable the DFU functionality use the ``SB_CONFIG_APP_DFU`` sysbuild Kconfig option. -It is enabled by default if the MCUboot bootloader image is used. +This option is enabled by default if a supported DFU solution is configured (see the following table to learn about supported configurations). To select a specific version of the application, change the :file:`VERSION` file in the sample root directory. See the :ref:`zephyr:app-version-details` for details. @@ -151,21 +157,23 @@ See the :ref:`zephyr:app-version-details` for details. * :kconfig:option:`CONFIG_BT_FAST_PAIR_FMDN_DULT_FIRMWARE_VERSION_MINOR` * :kconfig:option:`CONFIG_BT_FAST_PAIR_FMDN_DULT_FIRMWARE_VERSION_REVISION` -The bootloader configuration varies depending on the board target: - -+-----------------------------------------+------------------------------------------------------------+ -| Bootloader configuration | Board targets | -+=========================================+============================================================+ -| MCUboot, direct-xip mode without revert | * ``nrf52dk/nrf52832`` (only ``release`` configuration) | -| | * ``nrf52833dk/nrf52833`` (only ``release`` configuration) | -| | * ``nrf52840dk/nrf52840`` | -| | * ``nrf54l15dk/nrf54l15/cpuapp`` | -+-----------------------------------------+------------------------------------------------------------+ -| MCUboot, overwrite only mode | * ``nrf5340dk/nrf5340/cpuapp`` | -| | * ``nrf5340dk/nrf5340/cpuapp/ns`` | -| | * ``thingy53/nrf5340/cpuapp`` | -| | * ``thingy53/nrf5340/cpuapp/ns`` | -+-----------------------------------------+------------------------------------------------------------+ +The configuration of the DFU solution varies depending on the board target: + ++--------------+--------------------------------+------------------------------------------------------------+ +| DFU solution | Mode of operation | Board targets | ++==============+================================+============================================================+ +| MCUboot | direct-xip mode without revert | * ``nrf52dk/nrf52832`` (only ``release`` configuration) | +| | | * ``nrf52833dk/nrf52833`` (only ``release`` configuration) | +| | | * ``nrf52840dk/nrf52840`` | +| | | * ``nrf54l15dk/nrf54l15/cpuapp`` | ++--------------+--------------------------------+------------------------------------------------------------+ +| MCUboot | overwrite only mode | * ``nrf5340dk/nrf5340/cpuapp`` | +| | | * ``nrf5340dk/nrf5340/cpuapp/ns`` | +| | | * ``thingy53/nrf5340/cpuapp`` | +| | | * ``thingy53/nrf5340/cpuapp/ns`` | ++--------------+--------------------------------+------------------------------------------------------------+ +| SUIT | overwrite only mode | * ``nrf54h20dk/nrf54h20/cpuapp`` | ++--------------+--------------------------------+------------------------------------------------------------+ DFU mode -------- @@ -457,7 +465,7 @@ SB_CONFIG_APP_DFU The sample sysbuild configuration option enables the Device Firmware Update (DFU) functionality. The value of this option is propagated to the application configuration option :ref:`CONFIG_APP_DFU `. On multi-core devices, it adds the Kconfig fragment to the network core image configuration which speeds up the DFU process. - By default, this option is enabled if the MCUboot bootloader image is used. + This option is enabled by default if the MCUboot bootloader image is used (``SB_CONFIG_BOOTLOADER_MCUBOOT``) or if the chosen board target is based on an nRF54H Series SoC (``SB_CONFIG_SOC_SERIES_NRF54HX``). .. _CONFIG_APP_DFU: @@ -924,7 +932,7 @@ To perform the DFU procedure, complete the following steps: :start-after: fota_upgrades_over_ble_nrfcdm_common_dfu_steps_start :end-before: fota_upgrades_over_ble_nrfcdm_common_dfu_steps_end - .. group-tab:: nRF54 DKs + .. group-tab:: nRF54L DKs 1. Observe that **LED 0** is blinking at a 1 second interval, which indicates that the DFU mode is disabled. #. Press the **Button 3** for 7 seconds or more to enter the DFU mode. @@ -936,6 +944,37 @@ To perform the DFU procedure, complete the following steps: :start-after: fota_upgrades_over_ble_nrfcdm_common_dfu_steps_start :end-before: fota_upgrades_over_ble_nrfcdm_common_dfu_steps_end + .. group-tab:: nRF54H DKs + + 1. Observe that **LED 0** is blinking at a 1 second interval, which indicates that the DFU mode is disabled. + #. Press the **Button 3** for 7 seconds or more to enter the DFU mode. + #. Observe that **LED 0** is blinking at a 0.25 second interval, which indicates that the DFU mode is enabled. + #. Observe that **LED 2** is blinking, which indicates that the Fast Pair advertising is enabled. + #. Perform DFU using the `nRF Connect Device Manager`_ mobile app: + + 1. Generate the SUIT envelope by building your application with the FOTA support over Bluetooth Low Energy. + You can find the generated :file:`root.suit` envelope in the :file:`/DFU` directory. + Alternatively, you can use the generated :file:`dfu_suit.zip` package in the :file:`/zephyr` directory. + #. Download the :file:`root.suit` envelope or the :file:`dfu_suit.zip` package to your device. + + .. note:: + `nRF Connect for Desktop`_ does not currently support the FOTA process. + + #. Use the `nRF Connect Device Manager`_ mobile app to update your device with the new firmware. + + a. Ensure that you can access the :file:`root.suit` envelope or the :file:`dfu_suit.zip` package from your phone or tablet. + #. In the mobile app, scan and select the device to update. + #. Switch to the :guilabel:`Image` tab. + #. In the **Firmware Upgrade** section, tap the :guilabel:`SELECT FILE` button and select the :file:`root.suit` envelope or the :file:`dfu_suit.zip` package. + #. Tap the :guilabel:`START` button. + #. Wait for the DFU to finish and verify that the application works properly. + + .. note:: + Support for SUIT updates is available starting from the following versions of the `nRF Connect Device Manager`_ mobile app: + + * Version ``2.0`` on Android. + * Version ``1.7`` on iOS. + Disabling the locator tag ------------------------- @@ -1081,6 +1120,7 @@ Device Firmware Update (DFU) This sample uses following components for the DFU functionality: -* :ref:`MCUboot bootloader ` +* :ref:`MCUboot bootloader ` (for supported board targets) +* :ref:`SUIT ` (for supported board targets) * :ref:`zephyr:app-version-details` * :ref:`zephyr:mcu_mgr` diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..ee09ca1431fa --- /dev/null +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SUIT=y diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..e20e38641864 --- /dev/null +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Decrease the storage partition size by 0x1000 bytes and move it 0x1000 bytes forward + * in the address space to create a place for the Fast Pair partition. Define the Fast + * Pair partition in the provided memory gap. + */ +&mram1x { + /delete-node/ cpuapp-rw-partitions; + + cpuapp_rw_partitions: cpuapp-rw-partitions { + compatible = "nordic,owned-partitions", "fixed-partitions"; + status = "okay"; + nordic,access = ; + #address-cells = <1>; + #size-cells = <1>; + + dfu_partition: partition@100000 { + reg = <0x100000 DT_SIZE_K(908)>; + }; + + /* Align the partition size to 4096 B to avoid gaps. */ + bt_fast_pair_partition: partition@1e3000 { + reg = <0x1e3000 DT_SIZE_K(4)>; + }; + + storage_partition: partition@1e4000 { + reg = <0x1e4000 DT_SIZE_K(20)>; + }; + }; +}; + +/* Enable the IPC configuration with the Secure Domain to support SUIT DFU. */ +&cpusec_cpuapp_ipc { + status = "okay"; +}; + +/* Enable the Secure Domain signalling mechanism used by IPC to support SUIT DFU. */ +&cpusec_bellboard { + status = "okay"; +}; diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf b/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf index d94d7cefe817..4c2d231635cf 100644 --- a/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/prj.conf @@ -89,5 +89,6 @@ CONFIG_BT_FAST_PAIR_FMDN_DULT_FIRMWARE_VERSION_REVISION=99 # * nrf52833dk/nrf52833 # * nrf52840dk/nrf52840 # * nrf5340dk/nrf5340/cpuapp(/ns) +# * nrf54h20dk/nrf54h20/cpuapp CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-15 CONFIG_BT_FAST_PAIR_FMDN_TX_POWER_CORRECTION_VAL=-15 diff --git a/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf b/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf index 17a5b33e5418..d109a4d3e67c 100644 --- a/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf +++ b/samples/bluetooth/fast_pair/locator_tag/configuration/prj_release.conf @@ -98,5 +98,6 @@ CONFIG_BT_FAST_PAIR_FMDN_DULT_FIRMWARE_VERSION_REVISION=99 # * nrf52833dk/nrf52833 # * nrf52840dk/nrf52840 # * nrf5340dk/nrf5340/cpuapp(/ns) +# * nrf54h20dk/nrf54h20/cpuapp CONFIG_BT_ADV_PROV_TX_POWER_CORRECTION_VAL=-15 CONFIG_BT_FAST_PAIR_FMDN_TX_POWER_CORRECTION_VAL=-15 diff --git a/samples/bluetooth/fast_pair/locator_tag/sample.yaml b/samples/bluetooth/fast_pair/locator_tag/sample.yaml index c7b8908c3e44..b788214da8d1 100644 --- a/samples/bluetooth/fast_pair/locator_tag/sample.yaml +++ b/samples/bluetooth/fast_pair/locator_tag/sample.yaml @@ -12,6 +12,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - thingy53/nrf5340/cpuapp - thingy53/nrf5340/cpuapp/ns platform_allow: @@ -21,6 +22,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - thingy53/nrf5340/cpuapp - thingy53/nrf5340/cpuapp/ns tags: bluetooth ci_build sysbuild @@ -34,6 +36,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - thingy53/nrf5340/cpuapp - thingy53/nrf5340/cpuapp/ns platform_allow: @@ -43,6 +46,7 @@ tests: - nrf5340dk/nrf5340/cpuapp - nrf5340dk/nrf5340/cpuapp/ns - nrf54l15dk/nrf54l15/cpuapp + - nrf54h20dk/nrf54h20/cpuapp - thingy53/nrf5340/cpuapp - thingy53/nrf5340/cpuapp/ns tags: bluetooth ci_build sysbuild diff --git a/samples/bluetooth/fast_pair/locator_tag/src/Kconfig.dfu b/samples/bluetooth/fast_pair/locator_tag/src/Kconfig.dfu index a05cf4900cf1..5d7322df235c 100644 --- a/samples/bluetooth/fast_pair/locator_tag/src/Kconfig.dfu +++ b/samples/bluetooth/fast_pair/locator_tag/src/Kconfig.dfu @@ -7,7 +7,7 @@ config APP_DFU bool "Enable MCUmgr OTA DFU over Bluetooth" select NCS_SAMPLE_MCUMGR_BT_OTA_DFU - depends on BOOTLOADER_MCUBOOT + depends on BOOTLOADER_MCUBOOT || SUIT help Enable support for Device Firmware Update (DFU) over MCUmgr & SMP BT. diff --git a/samples/bluetooth/fast_pair/locator_tag/sysbuild/configuration/nrf54h20dk_nrf54h20_cpuapp/sysbuild.conf b/samples/bluetooth/fast_pair/locator_tag/sysbuild/configuration/nrf54h20dk_nrf54h20_cpuapp/sysbuild.conf new file mode 100644 index 000000000000..b2dc3dfb21ef --- /dev/null +++ b/samples/bluetooth/fast_pair/locator_tag/sysbuild/configuration/nrf54h20dk_nrf54h20_cpuapp/sysbuild.conf @@ -0,0 +1,7 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SB_CONFIG_NETCORE_IPC_RADIO=y