Skip to content

Conversation

@zycz
Copy link
Contributor

@zycz zycz commented Jul 29, 2025

Updated the configurations of the nRF Desktop application 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.

@zycz zycz requested review from a team as code owners July 29, 2025 09:56
@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label Jul 29, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jul 29, 2025

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 12

Inputs:

Sources:

sdk-nrf: PR head: d6143a58ee58b5a0b1a013e0999723f208c51d1e

more details

sdk-nrf:

PR head: d6143a58ee58b5a0b1a013e0999723f208c51d1e
merge base: 2eaf262a3dafbcf9cfe417e608e878d65be34883
target head (main): 2eaf262a3dafbcf9cfe417e608e878d65be34883
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (18)
applications
│  ├── nrf_desktop
│  │  ├── bootloader_dfu.rst
│  │  ├── configuration
│  │  │  ├── nrf54l15dk_nrf54l05_cpuapp
│  │  │  │  ├── sysbuild_release.conf
│  │  │  │  ├── sysbuild_release_fast_pair.conf
│  │  │  │  │ sysbuild_release_keyboard.conf
│  │  │  ├── nrf54l15dk_nrf54l10_cpuapp
│  │  │  │  ├── sysbuild.conf
│  │  │  │  ├── sysbuild_fast_pair.conf
│  │  │  │  ├── sysbuild_keyboard.conf
│  │  │  │  │ sysbuild_release.conf
│  │  │  ├── nrf54l15dk_nrf54l15_cpuapp
│  │  │  │  ├── sysbuild.conf
│  │  │  │  ├── sysbuild_fast_pair.conf
│  │  │  │  ├── sysbuild_keyboard.conf
│  │  │  │  │ sysbuild_release.conf
│  │  ├── description.rst
│  │  ├── pytest
│  │  │  │ test_mcuboot_kmu.py
│  │  ├── sample.yaml
│  │  ├── sysbuild
│  │  │  │ CMakeLists.txt
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
scripts
│  │ quarantine_llvm.yaml

Outputs:

Toolchain

Version: 8ea1732c3a
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:8ea1732c3a_bba2ea5f2e

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 49
  • ✅ Integration tests
    • ✅ desktop52_verification
Disabled integration tests
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread-main
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For this purpose a set of private and public keys is needed.
For this purpose, a set of private and public keys is needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In this application, the application image is automatically signed with private key by the |NCS| build system.
In this application, the application image is automatically signed with a private key by the |NCS| build system.

Copy link
Contributor

Choose a reason for hiding this comment

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

you already mentioned in L1024 that the private key is used to sign the image so you can drop the "with a private key" i think

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To store public key in KMU public key must first be provisioned.
To store the public key in the KMU, it must first be provisioned.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This ensures that both the firmware and the MCUboot public key are correctly programmed onto the target device using KMU-based key storage.
This ensures that both the firmware and the MCUboot public key are correctly programmed onto the target device using the KMU-based key storage.

Copy link
Contributor

Choose a reason for hiding this comment

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

you already mentioned in L1024 that the private key is used to sign the image so you can drop the "with a private key" i think

Copy link
Contributor

Choose a reason for hiding this comment

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

it is already in the applications.nrf_desktop.zdebug, is it needed also here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove L05 from here.

It will fail during tests due to the missing log:

"dfu: Secondary image slot is clean"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

applications.nrf_desktop.zdebug is build only - here we run tests with harness, so I intended it. However if we you think we should forfeit those tests we can talk it over.

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove L05 from here.

It will fail during tests due to the missing log:

"dfu: Secondary image slot is clean"

@zycz
Copy link
Contributor Author

zycz commented Jul 29, 2025

Couldn't respond to your comment directly :(
@mkapala-nordic

you already mentioned in L1024 that the private key is used to sign the image so you can drop the "with a private key" i think

I wanted in first place show what keys there are so user won't confuse them.
Second sentence tells that action of signing is conducted automatically.

If you strongly disagree with it please propose alternative :)

@zycz zycz force-pushed the issue34240_autoprovisioning branch from 320b6f1 to d4a9db6 Compare July 29, 2025 12:03
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
See the :ref:`ug_nrf54l_developing_provision_kmu` documenta`tion for details.
See the :ref:`ug_nrf54l_developing_provision_kmu` documentation for details.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To use automatic provisioning, enable the ``SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE``
To use automatic provisioning, enable the ``SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE`` Kconfig option.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The automatic provisioning is only performed if the west flash command is executed with the --erase or --recover flag.
The automatic provisioning is only performed if the west flash command is executed with the ``--erase`` or ``--recover`` flag.

Comment on lines 1041 to 1044
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.. parsed-literal::
:class: highlight
west flash --recover
.. parsed-literal::
:class: highlight
west flash --recover

@zycz zycz force-pushed the issue34240_autoprovisioning branch from d4a9db6 to ab2763b Compare July 29, 2025 12:17
@zycz zycz requested a review from peknis July 29, 2025 12:17
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To use automatic provisioning, enable the ``SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE`` Kconfig option.
To use automatic provisioning, enable the :kconfig:option:`SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE` sysbuild Kconfig option.

Copy link
Contributor

Choose a reason for hiding this comment

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

The rendered docs still do not allow me to click on the option label and navigate to the Kconfig search page. @nordicjm, are you sure that it works?

See.

https://ncsdoc.z6.web.core.windows.net/PR-23509/nrf/applications/nrf_desktop/bootloader_dfu.html

and the SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KMU_KEYFILE label in the incorrectly rendered ..note::

Copy link
Contributor

Choose a reason for hiding this comment

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

it won't be searchable because only non-sysbuild Kconfigs are shown in the search, that's a different issue, however it highlights that it is a Kconfig option

Copy link
Contributor

Choose a reason for hiding this comment

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

@nordicjm : All the sysbuild configurations are represented in double backticks, unlike the other normal Kconfig options, because these options are not in the Kconfig search and hence don't link. Please see some examples here:

The earlier representation was correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@divipillai divipillai Jul 30, 2025

Choose a reason for hiding this comment

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

Do we plan to implement the same for the Kconfig search in NCS as well in the future - https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you @nordicjm. This was quick. The sysbuild Kconfig options now link as well. Tested a few doc pages and works fine. We will fix the syntax to ":kconfig:option:`SB" for other sysbuild config options in a separate PR. We already have a Jira open by Jan for nRF desktop.

Copy link
Contributor

Choose a reason for hiding this comment

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

fix here too

Comment on lines 1034 to 1035
Copy link
Contributor

Choose a reason for hiding this comment

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

fix as above

Copy link
Contributor

Choose a reason for hiding this comment

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

fix as above

@zycz zycz force-pushed the issue34240_autoprovisioning branch from ab2763b to 8496243 Compare July 29, 2025 13:05
@zycz zycz requested a review from nordicjm July 29, 2025 13:05
@kapi-no
Copy link
Contributor

kapi-no commented Jul 29, 2025

@nordicjm, can we convert documentation mentions of sysbuild Kconfig options in a dedicated PR using the scheme you requested?

Currently, @zycz changed a few sysbuild Kconfigs in the nRF Desktop documentation. However, docs still contain hundreds sysbuild Kconfig mentions formatted with the old syntax. It would be good to align this in one go. @zycz, could you create a ticket for that?

@nordicjm
Copy link
Contributor

We shouldn't be adding new wrong usage of options, the old ones exist because previously :kconfig:option: could only reference non-sysbuild Kconfigs and would error out, but that has been fixed

@zycz
Copy link
Contributor Author

zycz commented Jul 29, 2025

@nordicjm, can we convert documentation mentions of sysbuild Kconfig options in a dedicated PR using the scheme you requested?

Currently, @zycz changed a few sysbuild Kconfigs in the nRF Desktop documentation. However, docs still contain hundreds sysbuild Kconfig mentions formatted with the old syntax. It would be good to align this in one go. @zycz, could you create a ticket for that?

ticket: https://nordicsemi.atlassian.net/browse/NCSDK-34617

@zycz zycz force-pushed the issue34240_autoprovisioning branch from 8496243 to 6261716 Compare July 29, 2025 15:03
@zycz zycz force-pushed the issue34240_autoprovisioning branch from 6261716 to cea2e2b Compare July 29, 2025 15:06
@zycz zycz requested a review from kapi-no July 29, 2025 15:06
@zycz zycz force-pushed the issue34240_autoprovisioning branch 3 times, most recently from d6e92e5 to da2ae4b Compare July 30, 2025 09:11
Copy link
Contributor

Choose a reason for hiding this comment

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

fix this reference in a separate pr

@kapi-no kapi-no added this to the 3.1.0 milestone Jul 31, 2025
@zycz zycz force-pushed the issue34240_autoprovisioning branch from da2ae4b to ced0ca8 Compare July 31, 2025 13:53
@zycz zycz requested a review from a team as a code owner July 31, 2025 13:53
@github-actions
Copy link

Since quarantine was modified, please make sure you are following the process described in Quarantine Process.

zycz added 2 commits July 31, 2025 17:48
Updated the configurations of the nRF Desktop application 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.

JIRA: NCSDK-34240

Signed-off-by: Jan Zyczkowski <[email protected]>
Remove obsolete test_mcuboot_kmu.py used for KMU key
provisioning. The pytest file `test_mcuboot_kmu.py`,
previously used to provision KMU keys, has been removed.
KMU key provisioning is now handled automatically when
running the `west flash --recover` command.

Additionally, the `sample.yaml` file was updated to reflect this change.

JIRA: NCSDK-34240

Signed-off-by: Jan Zyczkowski <[email protected]>
@zycz zycz force-pushed the issue34240_autoprovisioning branch from ced0ca8 to d6143a5 Compare July 31, 2025 15:49
The public key that MCUboot uses to validate the application image is securely stored in the hardware Key Management Unit (KMU).
In this use case, the application image is automatically signed by the |NCS| build system.
However, the public key is not automatically provisioned to the device when programming the bootloader and the application images using the ``west flash`` command.
For this purpose, a set of private and public keys is needed.
Copy link
Contributor

@kapi-no kapi-no Aug 1, 2025

Choose a reason for hiding this comment

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

Enabling hardware crypto does not require the bootloader to use a private/public key. The bootloader uses it regardless of whether HW crypto is used or not.

It may be improved in a follow-up PR. Merging this one at @zycz request

@kapi-no kapi-no merged commit 9b5a8c2 into nrfconnect:main Aug 1, 2025
20 checks passed
@zycz zycz deleted the issue34240_autoprovisioning branch August 1, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-required PR must not be merged without tech writer approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants