Skip to content

Commit 23770c0

Browse files
committed
samples: bluetooth: fast_pair: locator_tag: auto provision KMU targets
Updated the configurations of the Fast Pair Locator Tag sample for board targets that store the MCUboot verification key in the KMU peripheral. These nRF54L-based targets now use the automatic provisioning feature that makes it possible to perform the KMU provisioning together with the west flash operation. The provisioning is only performed if the ``west flash`` command is executed with the ``--erase`` or ``--recover`` flag. Aligned the sample documentation with this change. Ref: NCSDK-34176 Signed-off-by: Kamil Piszczek <[email protected]>
1 parent d0f559c commit 23770c0

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,14 @@ Bluetooth Fast Pair samples
364364
* :ref:`fast_pair_locator_tag` sample:
365365

366366
* Added possibility to build and run the sample without the motion detector support (with the :kconfig:option:`CONFIG_BT_FAST_PAIR_FMDN_DULT_MOTION_DETECTOR` Kconfig option disabled).
367-
* Updated the :ref:`fast_pair_locator_tag_testing_fw_update_notifications` section to improve the test procedure.
368-
The application provides now an additional log message to indicate that the firmware version is being read.
367+
368+
* Updated:
369+
370+
* The :ref:`fast_pair_locator_tag_testing_fw_update_notifications` section to improve the test procedure.
371+
The application provides now an additional log message to indicate that the firmware version is being read.
372+
* The configurations for nRF54L-based board targets that store the MCUboot verification key in the KMU peripheral to automatically generate the :file:`keyfile.json` file in the build directory (the ``SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE`` Kconfig option) based on the input file provided by the ``SB_CONFIG_BOOT_SIGNATURE_KEY_FILE`` Kconfig option.
373+
This KMU provisioning step can now be performed automatically by the west runner, provided that a :file:`keyfile.json` file is present in the build directory.
374+
The provisioning is only performed if the ``west flash`` command is executed with the ``--erase`` or ``--recover`` flag.
369375

370376
Cellular samples
371377
----------------

samples/bluetooth/fast_pair/locator_tag/README.rst

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -627,31 +627,21 @@ The MCUboot-based targets that enable the ``SB_CONFIG_MCUBOOT_SIGNATURE_USING_KM
627627
The board targets based on the nRF54L SoC Series are currently the only targets that support the KMU-based key storage.
628628
See the :ref:`fast_pair_locator_tag_dfu` section of this sample documentation for the details regarding the supported signature algorithms, public key storage location and the signature key file.
629629

630-
Using KMU requires the provisioning operation of the public key to be performed manually.
631-
Before performing the provisioning operation, you need to ensure that your board target is fully erased:
630+
To use KMU, the public key must first be provisioned.
631+
This provisioning step can be performed automatically by the west runner, provided that a :file:`keyfile.json` file is present in the build directory.
632+
In this sample, the :file:`keyfile.json` file is automatically generated using the ``SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE`` Kconfig option.
633+
This option uses the input key specified by the ``SB_CONFIG_BOOT_SIGNATURE_KEY_FILE`` Kconfig option to generate the required file during the build process.
632634

633-
.. parsed-literal::
634-
:class: highlight
635-
636-
nrfutil device erase --all
637-
638-
Assuming that your current working directory points to this sample directory, you can perform the provisioning operation as follows:
639-
640-
.. parsed-literal::
641-
:class: highlight
642-
643-
west ncs-provision upload -k sysbuild/configuration/<board_target>/boot_signature_key_file_<algorithm>.pem --keyname UROT_PUBKEY
644-
645-
* The ``<board_target>`` placeholder is your board target name (for example, ``nrf54l15dk/nrf54l15/cpuapp``).
646-
* The ``<algorithm>`` placeholder is the algorithm used to generate the key pair for the application image signature generation and verification (for example, ``ed25519``).
647-
648-
The examplary command for the ``nrf54l15dk/nrf54l15/cpuapp`` board target and the demonstration key file is as follows:
635+
To trigger KMU provisioning during flashing, use the ``west flash`` command with either the ``--erase`` or ``--recover`` flag.
636+
This ensures that both the firmware and the MCUboot public key are correctly programmed onto the target device using KMU-based key storage.
637+
Use the following command to perform the operation:
649638

650639
.. parsed-literal::
651640
:class: highlight
652641
653-
west ncs-provision upload -k sysbuild/configuration/nrf54l15dk_nrf54l15_cpuapp/boot_signature_key_file_ed25519.pem --keyname UROT_PUBKEY
642+
west flash --recover
654643
644+
Alternatively, you can perform the provisioning operation manually with the ``west ncs-provision upload`` command and then flash the device with the ``west flash`` command.
655645
See :ref:`ug_nrf54l_developing_provision_kmu` for further details regarding the KMU provisioning process.
656646

657647
.. _fast_pair_locator_tag_motion_detector_test_build:

samples/bluetooth/fast_pair/locator_tag/sysbuild/CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ project(sysbuild LANGUAGES)
1515
if(SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU)
1616
message(WARNING "
1717
------------------------------------------------------------------------------
18-
--- WARNING: MCUboot uses KMU stored keys for signature verification. Make ---
19-
--- sure to use `west ncs-provision` to manually provision the bootloader. ---
20-
--- Application would fail to boot if MCUboot is not provisioned. For more ---
21-
--- details, see the `Building and running` section from the Fast Pair ---
22-
--- Locator Tag Readme documentation. ---
18+
--- WARNING: MCUboot signature verification uses KMU-stored keys. You must ---
19+
--- use the `west flash` command with either the `--erase` or `--recover` ---
20+
--- option to ensure the bootloader provisioning operation is included in ---
21+
--- the flashing procedure. The application will fail to boot if MCUboot ---
22+
--- is not properly provisioned. For detailed instructions, refer to the ---
23+
--- `Building and running` section in the Fast Pair Locator Tag Readme. ---
2324
------------------------------------------------------------------------------
2425
")
2526
endif()

samples/bluetooth/fast_pair/locator_tag/sysbuild/configuration/nrf54l15dk_nrf54l05_cpuapp/sysbuild_release.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y
88
SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y
99
SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y
1010
SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y
11-
SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y
1211
SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${SB_APPLICATION_CONFIG_DIR}/boot_signature_key_file_ed25519.pem"
12+
SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y
13+
SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE=y

samples/bluetooth/fast_pair/locator_tag/sysbuild/configuration/nrf54l15dk_nrf54l10_cpuapp/sysbuild.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y
88
SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y
99
SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y
1010
SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y
11-
SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y
1211
SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${SB_APPLICATION_CONFIG_DIR}/boot_signature_key_file_ed25519.pem"
12+
SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y
13+
SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE=y

samples/bluetooth/fast_pair/locator_tag/sysbuild/configuration/nrf54l15dk_nrf54l15_cpuapp/sysbuild.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ SB_CONFIG_BOOTLOADER_MCUBOOT=y
88
SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y
99
SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519=y
1010
SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y
11-
SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y
1211
SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="\${SB_APPLICATION_CONFIG_DIR}/boot_signature_key_file_ed25519.pem"
12+
SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y
13+
SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE=y

0 commit comments

Comments
 (0)