Skip to content

samples: mcuboot: Add firmware loader entrance sample #23318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 18, 2025

Conversation

nordicjm
Copy link
Contributor

Adds a sample showing how to reboot into MCUboot's firmware loader
application for being able to load firmware updates

NCSDK-28480

@nordicjm nordicjm requested review from a team as code owners July 16, 2025 08:15
@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jul 16, 2025
@github-actions github-actions bot removed the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jul 16, 2025
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jul 16, 2025

CI Information

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

Inputs:

Sources:

sdk-nrf: PR head: 832a7e42065b24e20ae3e3631e8e3e26773fdb93
zephyr: PR head: 587776675ddc6fbfe97e36eb5177130e38c826a0

more details

sdk-nrf:

PR head: 832a7e42065b24e20ae3e3631e8e3e26773fdb93
merge base: 742086a5eda26527d427b1e3bd7a5dda6ed123c4
target head (main): 17d5cdb350e896318120fb48f97c174985b06829
Diff

zephyr:

PR head: 587776675ddc6fbfe97e36eb5177130e38c826a0
merge base: 237ef2e9225a5130047a24f368650c279b676f0b
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 (16)
CODEOWNERS
boards
│  ├── shields
│  │  ├── pca63565
│  │  │  ├── boards
│  │  │  │  │ nrf54l15dk_nrf54l15_cpuapp.overlay
cmake
│  ├── sysbuild
│  │  │ image_signing_firmware_loader.cmake
samples
│  ├── mcuboot
│  │  ├── firmware_loader_entrance
│  │  │  ├── CMakeLists.txt
│  │  │  ├── pm_static_nrf52840dk_nrf52840.yml
│  │  │  ├── pm_static_nrf54l15dk_nrf54l15_cpuapp.yml
│  │  │  ├── prj.conf
│  │  │  ├── sample.yaml
│  │  │  ├── src
│  │  │  │  │ main.c
│  │  │  ├── sysbuild.conf
│  │  │  ├── sysbuild
│  │  │  │  │ mcuboot.conf
sysbuild
│  ├── CMakeLists.txt
│  ├── Kconfig.firmware_loader
│  │ Kconfig.sysbuild
west.yml
zephyr
│  ├── boards
│  │  ├── nordic
│  │  │  ├── nrf54l15dk
│  │  │  │  │ nrf54l_05_10_15_cpuapp_common.dtsi

Outputs:

Toolchain

Version: 684b32e022
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:684b32e022_bba2ea5f2e

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister - Skipped: Skipping Build & Test as it succeeded in a previous run: 8
  • ✅ Integration tests
    • ✅ test-sdk-audio - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ desktop52_verification - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-apps - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test_ble_nrf_config - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-ble_mesh - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-ble_samples - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-chip - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nfc - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_cloud - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_libmodem-nrf - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_serial_lte_modem - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_zephyr_lwm2m - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_samples - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_lwm2m - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ doc-internal - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf-iot_thingy91 - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf_crypto - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-rpc - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-rs - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-fem - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-tfm - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-thread-main - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-find-my - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf_lrcs_mosh - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-nrf_lrcs_positioning - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-wifi - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-low-level - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-pmic-samples - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-sdk-mcuboot - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-fw-nrfconnect-ps-main - Skipped: Job was skipped as it succeeded in a previous run
    • ✅ test-secdom-samples-public - Skipped: Job was skipped as it succeeded in a previous run

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

Copy link

You can find the documentation preview for this PR here.

@nordicjm nordicjm requested a review from a team as a code owner July 16, 2025 09:28
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jul 16, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
zephyr nrfconnect/sdk-zephyr@237ef2e nrfconnect/sdk-zephyr@5877766 (main) nrfconnect/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@nordicjm nordicjm force-pushed the fwldrent7pence branch 2 times, most recently from 1560707 to c367787 Compare July 17, 2025 12:37
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jul 17, 2025

Memory footprint analysis revealed the following potential issues

applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 12430[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icbmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 9178[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High RAM usage: 9090[B] - link (cc: @nrfconnect/ncs-ll-ursus)
applications.hpf.gpio.icmsg[nrf54l15dk/nrf54l15/cpuflpr]: High ROM usage: 5846[B] - link (cc: @nrfconnect/ncs-ll-ursus)

Note: This message is automatically posted and updated by the CI (latest/sdk-nrf/PR-23318/8)

nordicjm added 3 commits July 18, 2025 09:24
Adds support for using SHA512 hashes when signing firmware loader
images

Signed-off-by: Jamie McCrae <[email protected]>
Includes a fix for missing aliases for nrf54l15dk

Signed-off-by: Jamie McCrae <[email protected]>
Fixes an issue with this shield

Signed-off-by: Jamie McCrae <[email protected]>
@nvlsianpu nvlsianpu requested review from nordic-mik7 and tomchy July 18, 2025 10:00
Copy link
Contributor

@hellesvik-nordic hellesvik-nordic left a comment

Choose a reason for hiding this comment

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

I did not review over the code itself.
Instead, I used what we can call "the lazy user test", where I just run the example soely based on my expectations, to see if it works out of the box.
This worked well, so I approve this PR.
Still, I added two comments for things I think can be improved.


k_work_init(&adv_work, adv_work_handler);
advertising_start();

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest that main prints out something along the lines of "Reset the device while holding Button 0/1 to enter DFU mode", so users understand how to enter firmware loader mode.

size: 0x60000
span: *id002
mcuboot_secondary:
address: 0x6a800
Copy link
Contributor

Choose a reason for hiding this comment

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

I might misunderstand the point of the Firmware Loader, but:
One of the main advantages of having two different images is that we can save space.
If this is the case, the example should showcase a smaller secondary slot than primary slot.

Copy link
Contributor

Choose a reason for hiding this comment

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

actually it's a very good point. Actually there is only primary and firmware loader partition used as bootable images.

nordicjm added 3 commits July 18, 2025 11:56
Adds support for picking this image as a firmware loader image

Signed-off-by: Jamie McCrae <[email protected]>
Adds a sample showing how to reboot into MCUboot's firmware loader
application for being able to load firmware updates

Signed-off-by: Jamie McCrae <[email protected]>
Assigns this to pluto

Signed-off-by: Jamie McCrae <[email protected]>
Copy link
Contributor

@bjarki-andreasen bjarki-andreasen left a comment

Choose a reason for hiding this comment

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

Looks good, but README is certainly missing :)

Copy link
Contributor

@nvlsianpu nvlsianpu left a comment

Choose a reason for hiding this comment

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

I think Sigurd have good point on pm_static* which should show that primary partition is "big one". Also I'm not sure, but maybe secondary partition can be removed.

Already clarified: README is planed to be added in the subsequent patch.

@rlubos rlubos merged commit 696621a into nrfconnect:main Jul 18, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants