Skip to content

Commit

Permalink
samples: bluetooth: fast_pair: locator_tag: add nRF54H20 DK support
Browse files Browse the repository at this point in the history
Added support for the nRF54H20 DK build target in the Fast Pair Locator
Tag sample.

Ref: NCSDK-30339

Signed-off-by: Kamil Piszczek <[email protected]>
  • Loading branch information
kapi-no authored and jukkar committed Dec 18, 2024
1 parent d677123 commit f3ac9cf
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------
Expand Down
7 changes: 6 additions & 1 deletion samples/bluetooth/fast_pair/locator_tag/Kconfig.sysbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"
82 changes: 61 additions & 21 deletions samples/bluetooth/fast_pair/locator_tag/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mcuboot:mcuboot_ncs>` 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 <mcuboot:mcuboot_ncs>` 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 <ug_nrf54h20_suit_dfu>` 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.
Expand All @@ -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
--------
Expand Down Expand Up @@ -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 <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:

Expand Down Expand Up @@ -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.
Expand All @@ -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:`<build_dir>/DFU` directory.
Alternatively, you can use the generated :file:`dfu_suit.zip` package in the :file:`<build_dir>/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
-------------------------

Expand Down Expand Up @@ -1081,6 +1120,7 @@ Device Firmware Update (DFU)

This sample uses following components for the DFU functionality:

* :ref:`MCUboot bootloader <mcuboot:mcuboot_ncs>`
* :ref:`MCUboot bootloader <mcuboot:mcuboot_ncs>` (for supported board targets)
* :ref:`SUIT <ug_nrf54h20_suit_dfu>` (for supported board targets)
* :ref:`zephyr:app-version-details`
* :ref:`zephyr:mcu_mgr`
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_SUIT=y
Original file line number Diff line number Diff line change
@@ -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 = <NRF_OWNER_ID_APPLICATION NRF_PERM_RWS>;
#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";
};
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions samples/bluetooth/fast_pair/locator_tag/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion samples/bluetooth/fast_pair/locator_tag/src/Kconfig.dfu
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

SB_CONFIG_NETCORE_IPC_RADIO=y

0 comments on commit f3ac9cf

Please sign in to comment.