Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@
/samples/nrf5340/empty_app_core/ @nrfconnect/ncs-si-muffin
/samples/nrf5340/extxip_smp_svr/ @nrfconnect/ncs-eris
/samples/nrf54h20/empty_app_core/ @nrfconnect/ncs-aurora
/samples/ironside_se/ @nrfconnect/ncs-aurora
/samples/nrf_compress/ @nordicjm
/samples/nrf_profiler/ @nrfconnect/ncs-si-bluebagel
/samples/nrf_rpc/protocols_serialization/ @nrfconnect/ncs-protocols-serialization
Expand Down Expand Up @@ -637,6 +638,7 @@
/samples/event_manager_proxy/*.rst @nrfconnect/ncs-si-muffin-doc
/samples/gazell/**/*.rst @nrfconnect/ncs-si-muffin-doc
/samples/hw_id/*.rst @nrfconnect/ncs-cia-doc
/samples/ironside_se/**/*.rst @nrfconnect/ncs-aurora-doc
/samples/ipc/ipc_service/*.rst @nrfconnect/ncs-si-muffin-doc
/samples/keys/**/*.rst @nrfconnect/ncs-aegir-doc
/samples/matter/**/*.rst @nrfconnect/ncs-matter-doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,8 @@ Wi-Fi samples
Other samples
-------------

* Added the :ref:`secondary_boot_sample` sample that demonstrates how to build and boot a secondary application image on the nRF54H20 DK.

* :ref:`nrf_profiler_sample` sample:

* Added a new testing step demonstrating how to calculate event propagation statistics.
Expand Down
1 change: 1 addition & 0 deletions doc/nrf/samples/other.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ This section lists single |NCS| samples for various uses that are not part of ot
../../../samples/mpsl/*/README
../../../samples/benchmarks/*/README
../../../samples/nrf_compress/*/README
../../../samples/ironside_se/*/README
../../../tests/benchmarks/multicore/*/README
../../../samples/zephyr/smp_svr_mini_boot/README
15 changes: 15 additions & 0 deletions samples/ironside_se/secondary_boot_gen_uicr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.13.1)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(secondary_boot_primary)

target_sources(app PRIVATE
src/main.c
)
73 changes: 73 additions & 0 deletions samples/ironside_se/secondary_boot_gen_uicr/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.. _secondary_boot_sample:

Secondary boot
##############

.. contents::
:local:
:depth: 2

This sample demonstrates how to boot a secondary application image on the nRF54H20 DK, where both the primary and secondary application images print ``Hello World`` messages.

Requirements
************

The sample supports the following development kit:

.. table-from-sample-yaml::

Overview
********

The sample consists of two applications:

* *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 after the primary image initiates the boot sequence and prints its own ``Hello World`` message.

Building and running
********************

.. |sample path| replace:: :file:`samples/ironside_se/secondary_boot_gen_uicr`

.. include:: /includes/build_and_run_ns.txt

To build the sample for the nRF54H20 DK, run the following command:

.. code-block:: console

west build -b nrf54h20dk/nrf54h20/cpuapp samples/secondary_boot

To program the sample on the device, run the following command:

.. code-block:: console

west flash

Testing
*******

After programming the test to your development kit, complete the following steps to test it:

1. |connect_terminal|
#. Reset the kit.
#. Observe the console output for both cores:


.. code-block:: console

[00:00:00.123,456] === Hello World from Primary Image ===
[00:00:00.456,789] === Hello World from Secondary Image ===

Dependencies
************

This sample uses the following |NCS| subsystems:

* IronSide SE bootmode service - Provides the interface to boot into secondary firmware mode
* Sysbuild - Enables building multiple images in a single build process
* UICR generation - Configures the User Information Configuration Registers for secondary boot mode

In addition, it uses the following Zephyr subsystems:

* :ref:`Kernel <kernel>` - Provides basic system functionality and threading
* :ref:`Console <console>` - Enables UART console output for debugging and user interaction
14 changes: 14 additions & 0 deletions samples/ironside_se/secondary_boot_gen_uicr/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable console and UART
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Enable printk
CONFIG_PRINTK=y

CONFIG_NRF_IRONSIDE_BOOTMODE_SERVICE=y
26 changes: 26 additions & 0 deletions samples/ironside_se/secondary_boot_gen_uicr/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
sample:
name: Secondary Boot Sample
description: |
Sample demonstrating secondary application image boot on nRF54H20DK.
The primary image prints hello world, calls stub functions for UICR
update and secure domain service to boot the secondary image. The
secondary image prints its own hello world message.

common:
sysbuild: true
harness: console
harness_config:
type: multi_line
regex:
- "=== Hello World from Primary Image ==="
- "=== Hello World from Secondary Image ==="

tests:
samples.secondary_boot.nrf54h20dk:
tags:
- sysbuild
- ci_samples_secondary_boot
platform_allow:
- nrf54h20dk/nrf54h20/cpuapp
integration_platforms:
- nrf54h20dk/nrf54h20/cpuapp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(secondary_boot_secondary)

target_sources(app PRIVATE src/main.c)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &secondary_partition;
};
};
12 changes: 12 additions & 0 deletions samples/ironside_se/secondary_boot_gen_uicr/secondary/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_IS_IRONSIDE_SE_SECONDARY_IMAGE=y

# Use the devicetree chosen code-partition to determine flash load offset
CONFIG_USE_DT_CODE_PARTITION=y

# NB: app.overlay sets zephyr,code-partition to secondary_partition
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA.
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>

int main(void)
{
printk("=== Hello World from Secondary Image ===\n");

printk("Secondary image initialization complete\n");

/* Keep the secondary image running */
while (1) {
k_msleep(3000);
printk("Secondary image heartbeat\n");
}

return 0;
}
31 changes: 31 additions & 0 deletions samples/ironside_se/secondary_boot_gen_uicr/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA.
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <nrf_ironside/bootmode.h>
#include <string.h>

int main(void)
{
int err;

printk("=== Hello World from Primary Image ===\n");

printk("Booting secondary image\n");
err = ironside_bootmode_secondary_reboot(NULL, 0);
if (err != 0) {
printk("Secondary image boot failed: %d\n", err);
return err;
}

while (1) {
printk("FAILURE: Primary should not be running - secondary boot failed\n");
k_msleep(1000);
}

return 0;
}
4 changes: 4 additions & 0 deletions samples/ironside_se/secondary_boot_gen_uicr/sysbuild.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ExternalZephyrProject_Add(
APPLICATION secondary
SOURCE_DIR ${APP_DIR}/secondary
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

# Configuration overlay for uicr image
# Enable UICR.SECONDARY.ENABLE
CONFIG_GEN_UICR_SECONDARY=y
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ manifest:
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
- name: zephyr
repo-path: sdk-zephyr
revision: 29aa21b8ac8e738fa6854e2127833c0e1613e101
revision: ccefb2a9e3a6bc5541d56eb34b822df184c8cb60
import:
# In addition to the zephyr repository itself, NCS also
# imports the contents of zephyr/west.yml at the above
Expand Down