Skip to content

Commit eb7b978

Browse files
jonathannilsenhakonfam
authored andcommitted
samples: boards: nordic: add sample for nrf_ironside update service
Add a sample demonstrating how to use the IRONside update service to update the IRONside SE firmware on the nrf54h20dk/nrf54h20/cpuapp/iron board. Co-authored-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no> Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
1 parent 51609f0 commit eb7b978

File tree

6 files changed

+141
-0
lines changed

6 files changed

+141
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
cmake_minimum_required(VERSION 3.20.0)
5+
6+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
7+
8+
project(ironside_se_update)
9+
10+
target_sources(app PRIVATE src/main.c)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config UPDATE_BLOB_ADDRESS
5+
hex "Address of the update blob"
6+
default 0xe100000
7+
help
8+
Address of the update blob. The default value matches the placement of the
9+
update blobs delivered with the IRONside SE firmware.
10+
11+
source "Kconfig.zephyr"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.. zephyr:code-sample:: nrf_ironside_update
2+
:name: Nordic IRONside SE firmware update
3+
4+
Update the Nordic IRONside SE firmware.
5+
6+
Overview
7+
********
8+
9+
The Nordic IRONside SE Update sample updates the IRONside SE firmware on a SoC that already has IRONside SE installed.
10+
It can update both the main image and the recovery image of IRONside SE using the IRONside SE firmware release ZIP file.
11+
12+
Update procedure
13+
****************
14+
15+
The update procedure works as follows:
16+
17+
1. The application invokes the IRONside SE update service and passes the parameters that correspond to the location of the HEX file of the IRONside SE firmware update.
18+
19+
#. The application prints the return value of the service call and outputs information from the update HEX file.
20+
21+
#. After the service call completes, the IRONside SE firmware updates the internal state of the device.
22+
23+
#. The firmware installs the update during the next device boot.
24+
This operation can take several seconds.
25+
26+
Once the operation has completed, you can read the boot report to verify that the update has taken place.
27+
28+
Building and running the application for nrf54h20dk/nrf54h20/cpuapp/iron
29+
************************************************************************
30+
31+
.. note::
32+
You can use this application only when there is already a version of IRONside SE installed on the device.
33+
34+
1. Unzip the IRONside SE release ZIP to get the update hex file:
35+
36+
.. code-block:: console
37+
38+
unzip nrf54h20_soc_binaries_v.*.zip
39+
40+
#. Program the appropriate update hex file from the release ZIP using one (not both) of the following commands:
41+
42+
a) To update IRONside SE firmware:
43+
44+
.. code-block:: console
45+
46+
nrfutil device program --traits jlink --firmware update/ironside_se_update.hex
47+
48+
b) To update IRONside SE recovery firmware:
49+
50+
.. code-block:: console
51+
52+
nrfutil device program --traits jlink --firmware update/ironside_se_recovery_update.hex
53+
54+
#. Build and program the application:
55+
56+
.. zephyr-app-commands::
57+
:zephyr-app: samples/boards/nordic/nrf_ironside/update
58+
:board: nrf54h20dk/nrf54h20/cpuapp/iron
59+
:goals: flash
60+
61+
#. Trigger a reset:
62+
63+
.. code-block:: console
64+
65+
nrfutil device reset --reset-kind RESET_PIN --traits jlink
66+
67+
#. Check that the new version is installed:
68+
69+
.. code-block:: console
70+
71+
# Read the version fields from the boot report
72+
nrfutil x-read --direct --address 0x2f88fd04 --bytes 16 --traits jlink
73+
# Read the update status in the boot report
74+
nrfutil x-read --direct --address 0x2f88fd24 --bytes 4 --traits jlink
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_LOG=y
2+
3+
CONFIG_NRF_IRONSIDE_UPDATE_SERVICE=y
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sample:
2+
name: Nordic IRONside SE update service
3+
description: Demonstrates how to update the Nordic IRONside SE firmware
4+
common:
5+
build_only: true
6+
tags: nrf_ironside
7+
integration_platforms:
8+
- nrf54h20dk/nrf54h20/cpuapp/iron
9+
10+
tests:
11+
sample.boards.nordic.nrf_ironside.update:
12+
platform_allow: nrf54h20dk/nrf54h20/cpuapp/iron
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/drivers/firmware/nrf_ironside/update.h>
8+
#include <zephyr/logging/log.h>
9+
10+
LOG_MODULE_REGISTER(app, LOG_LEVEL_INF);
11+
12+
int main(void)
13+
{
14+
int err;
15+
const struct ironside_update_blob *update = (void *)CONFIG_UPDATE_BLOB_ADDRESS;
16+
17+
err = ironside_update(update);
18+
LOG_INF("IRONside update retval: 0x%x", err);
19+
20+
if (err == 0) {
21+
LOG_HEXDUMP_INF(update->manifest, sizeof(update->manifest), "Update manifest:");
22+
LOG_HEXDUMP_INF(update->pubkey, sizeof(update->pubkey), "Public key:");
23+
LOG_HEXDUMP_INF(update->signature, sizeof(update->signature), "Signature:");
24+
LOG_HEXDUMP_INF(update->firmware, 8, "First 8 bytes of encrypted fw:");
25+
LOG_INF("Reboot the device to trigger the update");
26+
} else {
27+
LOG_ERR("The request to update failed");
28+
}
29+
30+
return 0;
31+
}

0 commit comments

Comments
 (0)