Skip to content

Conversation

SebastianBoe
Copy link
Contributor

Add a sample that uses the UICR PERIPHCONF infrastructure.

@SebastianBoe SebastianBoe requested review from a team as code owners October 8, 2025 11:37
@NordicBuilder NordicBuilder added the doc-required PR must not be merged without tech writer approval. label Oct 8, 2025
@SebastianBoe
Copy link
Contributor Author

This sample was already reviewed and approved in #24028.

But then it got force-pushed out of the PR for reasons I don't recall.

@SebastianBoe
Copy link
Contributor Author

@nordicjm , @FrancescoSer , @umapraseeda , @AyturkDuzen : You already reviewed this in #24028.

Please review again in this PR.

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Oct 8, 2025

CI Information

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

Inputs:

Sources:

sdk-nrf: PR head: 62617a44e2355dc096a8fe6f166d76c8e318993c
zephyr: PR head: ccefb2a9e3a6bc5541d56eb34b822df184c8cb60

more details

sdk-nrf:

PR head: 62617a44e2355dc096a8fe6f166d76c8e318993c
merge base: 75da438e78bf5cf1ba7419dea48f988797f90b9b
target head (main): 75da438e78bf5cf1ba7419dea48f988797f90b9b
Diff

zephyr:

PR head: ccefb2a9e3a6bc5541d56eb34b822df184c8cb60
merge base: 29aa21b8ac8e738fa6854e2127833c0e1613e101
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 (20)
CODEOWNERS
doc
│  ├── nrf
│  │  ├── releases_and_maturity
│  │  │  ├── releases
│  │  │  │  │ release-notes-changelog.rst
│  │  ├── samples
│  │  │  │ other.rst
samples
│  ├── ironside_se
│  │  ├── secondary_boot_gen_uicr
│  │  │  ├── CMakeLists.txt
│  │  │  ├── README.rst
│  │  │  ├── prj.conf
│  │  │  ├── sample.yaml
│  │  │  ├── secondary
│  │  │  │  ├── CMakeLists.txt
│  │  │  │  ├── app.overlay
│  │  │  │  ├── prj.conf
│  │  │  │  ├── src
│  │  │  │  │  │ main.c
│  │  │  ├── src
│  │  │  │  │ main.c
│  │  │  ├── sysbuild.cmake
│  │  │  ├── sysbuild
│  │  │  │  │ uicr.conf
west.yml
zephyr
│  ├── scripts
│  │  ├── ci
│  │  │  │ check_compliance.py
│  ├── soc
│  │  ├── nordic
│  │  │  ├── common
│  │  │  │  ├── uicr
│  │  │  │  │  ├── Kconfig
│  │  │  │  │  ├── gen_uicr.py
│  │  │  │  │  ├── gen_uicr
│  │  │  │  │  │  ├── CMakeLists.txt
│  │  │  │  │  │  │ Kconfig

Outputs:

Toolchain

Version: f66cf421f3
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:f66cf421f3_bba2ea5f2e

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

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ✅ Build twister
    • sdk-nrf test count: 23
    • sdk-zephyr test count: 475
  • ✅ Integration tests
    • ✅ test-sdk-audio
    • ✅ test-fw-nrfconnect-chip
    • ✅ test-fw-nrfconnect-nfc
    • ✅ test-fw-nrfconnect-nrf-iot_cloud
    • ✅ test-fw-nrfconnect-rs
    • ✅ test-fw-nrfconnect-fem
    • ✅ test-fw-nrfconnect-thread-main
    • ✅ test-sdk-find-my
Disabled integration tests
    • test-fw-nrfconnect-nrf_lrcs_mosh
    • test-fw-nrfconnect-nrf_lrcs_positioning
    • desktop52_verification
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-ble_samples
    • 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-proprietary_esb
    • test-fw-nrfconnect-ps-main
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-tfm
    • test-low-level
    • test-sdk-dfu
    • 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

github-actions bot commented Oct 8, 2025

Copy link
Contributor

@FrancescoSer FrancescoSer left a comment

Choose a reason for hiding this comment

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

Approved but please implement this small suggestion


.. code-block:: console

west build -b nrf54h20dk/nrf54h20/cpuapp samples/secondary_boot --sysbuild
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. sysbuild flag should not be needed because it is enabled globally (unless a user has changed their local configuration to disable it but that would break basically everything)

Comment on lines 8 to 9
# Create empty marker file at configure-time
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/is_secondary_firmware.txt "")
Copy link
Contributor

Choose a reason for hiding this comment

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

this should go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi,

this was discussed earlier in
#24524 (comment)

There I proposed introducing a Kconfig
IS_SECONDARY_IMAGE

Do you approve of this approach?

Copy link
Contributor

Choose a reason for hiding this comment

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

It should be doing the same as other things, they should not need to set a Kconfig, a function should be doing that for them (and in this case it's not hard because this is being done as a direct image, not as a variant, so you can get sysbuild to force the value of a Kconfig, so a new Kconfig can be added with a description saying informative only, see https://github.com/nrfconnect/sdk-nrf/blob/main/subsys/mcuboot_ids/Kconfig for an example), so you can do that in the cmake file in the sysbuild folder

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will look into if what you are proposing is possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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


config SECONDARY_IMAGE_NAME
string
default "secondary" if SECONDARY_BOOT_GEN_UICR
Copy link
Contributor

Choose a reason for hiding this comment

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

names should match i.e. boot_gen_uicr


config SECONDARY_IMAGE_PATH
string
default "${ZEPHYR_NRF_MODULE_DIR}/samples/ironside_se/secondary_boot_gen_uicr/secondary" if SECONDARY_BOOT_GEN_UICR
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm yeah this is a bit of a problem, the names should match so the final folder name should be the name of the image and should be the name in the Kconfig to use it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I don't understand what you are saying.

Also, I wonder if there has been a misunderstanding from the beginning.

Are you aware that the image in

~/ncs/nrf/samples/ironside_se/secondary_boot_gen_uicr/secondary

is not a reusable image, like mcuboot, NSIB, etc.

But just a demonstration of how a customer could create their own image that is booted in secondary mode?

It is specific to the sample in

~/ncs/nrf/samples/ironside_se/secondary_boot_gen_uicr

Copy link
Contributor

Choose a reason for hiding this comment

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

if that's the case then the list should be empty in sysbuild, then appended to by the application - see https://github.com/nrfconnect/sdk-nrf/tree/main/samples/bluetooth/direct_test_mode for an example, then it can be documented how users would extend the list themselves, https://ncsdoc.z6.web.core.windows.net/latest/nrf/app_dev/config_and_build/sysbuild/sysbuild_images.html#adding-custom-images can be used as a base thing to copy

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

Note that I don't need

~/ncs/nrf/samples/ironside_se/secondary_boot_gen_uicr/secondary

to be available to multiple projects.

I believe that if I use "Adding custom images" as a base, but remove the code related to "letting an image be available to multiple projects", then I will end up with a simple ExternalZephyrProject_Add call.

Would this approach be acceptable?

It is the approach that I believe the customer would prefer as reference/sample code for how he can create a
secondary image.

Copy link
Contributor

Choose a reason for hiding this comment

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

the point is to configure it for them though right, so they can pick an image (i.e. their own image) and the correct configuration will be applied, so that's not going to work without doing it like this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is not desired that they can pick via Kconfig their own image for the primary or for the secondary image.

The goal here is to demonstrate to the customer how they can create their own primary image and their own secondary image.

I have pushed a new revision now which I feel demonstrates this quite well.

@NordicBuilder NordicBuilder requested review from a team October 10, 2025 13:01
@SebastianBoe SebastianBoe force-pushed the uicr_sample branch 2 times, most recently from 9de05ec to 6446558 Compare October 10, 2025 14:08
@SebastianBoe SebastianBoe requested a review from a team as a code owner October 10, 2025 14:08
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Oct 10, 2025

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

Name Old Revision New Revision Diff
zephyr nrfconnect/sdk-zephyr@29aa21b nrfconnect/sdk-zephyr@ccefb2a (main) nrfconnect/[email protected]

All manifest checks OK

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

Comment on lines 24 to 26
* *Primary Image*: Runs initially on the application core (``cpuapp``), prints a ``Hello World`` message, and includes stub functions for the Secure Domain service calls to boot the secondary image.

* *Secondary Image*: Runs on the same application core (``cpuapp/secondary``) after the primary image initiates the boot sequence and prints its own ``Hello World`` message.
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
* *Primary Image*: Runs initially on the application core (``cpuapp``), prints a ``Hello World`` message, and includes stub functions for the Secure Domain service calls to boot the secondary image.
* *Secondary Image*: Runs on the same application core (``cpuapp/secondary``) after the primary image initiates the boot sequence and prints its own ``Hello World`` message.
* *Primary Image*: Runs initially on the application core (``cpuapp``), prints a ``Hello World`` message, and includes stub functions for the Secure Domain service calls to boot the secondary image.
* *Secondary Image*: Runs on the same application core (``cpuapp/secondary``) after the primary image initiates the boot sequence and prints its own ``Hello World`` message.

Automatically created by Github Action

Signed-off-by: Sebastian Bøe <[email protected]>
Add a sample that uses the UICR PERIPHCONF infrastructure.

Signed-off-by: Sebastian Bøe <[email protected]>
@nordicjm nordicjm merged commit 742c850 into nrfconnect:main Oct 14, 2025
16 checks passed
@SebastianBoe SebastianBoe deleted the uicr_sample branch October 15, 2025 13:14
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. manifest manifest-zephyr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants