Skip to content

Commit 3bba72b

Browse files
committed
samples: dfu: single_slot sample fw_loader update configurations
This commit adds the needed overlays and entries in sample.yaml which allow to build the single slot sample with several configurations of the FW loader update. Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
1 parent ff92cd5 commit 3bba72b

9 files changed

Lines changed: 314 additions & 0 deletions
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/* On nRF54H20 the FW loader mode is supported in the merged slot configuration
8+
* Extend slot0_partition and slot1_partition to cover both application and
9+
* radio images, as well as MCUboot image metadata (header and trailer).
10+
* Those partitions will be used by MCUboot to verify the merged image to boot.
11+
* Apart from that, they will be used by the MCUmgr subsystem to correctly
12+
* handle flags, stored inside the MCUboot image trailer.
13+
* Use cpu<app|rad>_slot<0|1>_partition as zephyr,code-partition, so the
14+
* application and radio sizes are correctly reported.
15+
*/
16+
/delete-node/ &cpuapp_slot0_partition;
17+
/delete-node/ &cpuapp_slot1_partition;
18+
/delete-node/ &cpurad_slot0_partition;
19+
/delete-node/ &cpurad_slot1_partition;
20+
21+
/delete-node/ &cpuppr_code_partition;
22+
/delete-node/ &cpuflpr_code_partition;
23+
24+
/*
25+
* Secondary boot is not used by this sample, as it has a somewhat
26+
* similar functionality as firmware loader.
27+
* Hence, we remove the secondary boot partitions and push the
28+
* storage_partition and periphconf_partition further back to the freed
29+
* space.
30+
*/
31+
/delete-node/ &secondary_partition;
32+
/delete-node/ &secondary_periphconf_partition;
33+
/delete-node/ &storage_partition;
34+
/delete-node/ &periphconf_partition;
35+
36+
/* Remove the undefined property value from the disabled VPR cores to prevent build errors. */
37+
&cpuflpr_vpr {
38+
/delete-property/ source-memory;
39+
};
40+
41+
&cpuppr_vpr {
42+
/delete-property/ source-memory;
43+
};
44+
45+
&mram1x {
46+
partitions {
47+
boot_partition: partition@30000 {
48+
label = "mcuboot";
49+
reg = <0x30000 DT_SIZE_K(24)>;
50+
};
51+
52+
/* Main application with the MCUboot header. */
53+
slot0_partition: partition@36000 {
54+
compatible = "fixed-subpartitions";
55+
reg = <0x36000 DT_SIZE_K(1624)>;
56+
ranges = <0x0 0x36000 DT_SIZE_K(1624)>;
57+
#address-cells = <1>;
58+
#size-cells = <1>;
59+
60+
/* Main application without the MCUboot metadata.
61+
* Offset by the MCUboot header size (2048 bytes).
62+
*/
63+
cpuapp_slot0_partition: partition@800 {
64+
reg = <0x800 DT_SIZE_K(1622)>;
65+
};
66+
};
67+
68+
/* Merged partition used by the FW loader. */
69+
slot1_partition: partition@1cc000 {
70+
compatible = "fixed-subpartitions";
71+
reg = <0x1cc000 DT_SIZE_K(144)>;
72+
ranges = <0x0 0x1cc000 DT_SIZE_K(144)>;
73+
#address-cells = <1>;
74+
#size-cells = <1>;
75+
76+
/* Application code partition (part of the FW loader).
77+
* Offset by the MCUboot header size (2048 bytes).
78+
*/
79+
fw_loader_partition: cpuapp_slot1_partition: partition@800 {
80+
reg = <0x800 DT_SIZE_K(60)>;
81+
};
82+
83+
/* Radio code partition (part of the FW loader). */
84+
cpurad_slot0_partition: partition@f800 {
85+
reg = <0xf800 DT_SIZE_K(82)>;
86+
};
87+
};
88+
89+
boot_request: partition@1f0000 {
90+
reg = <0x1f0000 16>;
91+
};
92+
93+
boot_request_backup: partition@1f0010 {
94+
reg = <0x1f0010 16>;
95+
};
96+
97+
storage_partition: partition@1f1000 {
98+
reg = <0x1f1000 DT_SIZE_K(40)>;
99+
};
100+
101+
periphconf_partition: partition@1fb000 {
102+
reg = <0x1fb000 DT_SIZE_K(8)>;
103+
};
104+
};
105+
};
106+
107+
/ {
108+
chosen {
109+
nrf,bootloader-request = &boot_request;
110+
nrf,bootloader-request-backup = &boot_request_backup;
111+
zephyr,boot-mode = &boot_request;
112+
};
113+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "nrf54l15dk_nrf54l15_cpuapp.overlay"
8+
9+
/ {
10+
chosen {
11+
nrf,bootloader-request = &boot_request;
12+
};
13+
};
14+
15+
/ {
16+
cpuapp_sram@2003fff0 {
17+
compatible = "zephyr,memory-region", "mmio-sram";
18+
reg = <0x2003fff0 0x10>;
19+
zephyr,memory-region = "RetainedMem";
20+
status = "okay";
21+
22+
retainedmem {
23+
compatible = "zephyr,retained-ram";
24+
status = "okay";
25+
#address-cells = <1>;
26+
#size-cells = <1>;
27+
28+
boot_request: boot_request@0 {
29+
compatible = "zephyr,retention";
30+
status = "okay";
31+
reg = <0x0 0x10>;
32+
prefix = [0b 01];
33+
checksum = <4>;
34+
};
35+
};
36+
};
37+
};

samples/dfu/single_slot/sample.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,68 @@ tests:
2626
- nrf54l15dk/nrf54l15/cpuapp
2727
- nrf54h20dk/nrf54h20/cpuapp
2828
- nrf54lm20dk/nrf54lm20a/cpuapp
29+
sample.dfu.single_slot.fw_loader_update.nrf54l15:
30+
extra_args:
31+
- SB_CONFIG_FIRMWARE_LOADER_UPDATE_ENABLE=y
32+
- unboxer_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/samples/dfu/single_slot/boards/nrf54l15dk_nrf54l15_cpuapp.overlay"
33+
tags:
34+
- dfu_single_slot
35+
- ci_samples_dfu
36+
platform_allow:
37+
- nrf54l15dk/nrf54l15/cpuapp
38+
integration_platforms:
39+
- nrf54l15dk/nrf54l15/cpuapp
40+
sample.dfu.single_slot.fw_loader_update.nrf54h20:
41+
extra_args:
42+
- SB_CONFIG_FIRMWARE_LOADER_UPDATE_ENABLE=y
43+
- unboxer_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/samples/dfu/single_slot/boards/nrf54h20dk_nrf54h20_cpuapp.overlay"
44+
tags:
45+
- dfu_single_slot
46+
- ci_samples_dfu
47+
platform_allow:
48+
- nrf54h20dk/nrf54h20/cpuapp
49+
integration_platforms:
50+
- nrf54h20dk/nrf54h20/cpuapp
51+
sample.dfu.single_slot.fw_loader_update.fw_loader_entrance_boot_mode.nrf54l15:
52+
extra_args:
53+
- SB_CONFIG_FIRMWARE_LOADER_UPDATE_ENABLE=y
54+
- unboxer_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/samples/dfu/single_slot/boards/nrf54l15dk_nrf54l15_cpuapp.overlay"
55+
- unboxer_CONFIG_UNBOXER_FW_LOADER_ENTRANCE_BOOT_MODE=y
56+
- mcuboot_CONFIG_RETAINED_MEM=y
57+
- mcuboot_CONFIG_RETENTION=y
58+
- mcuboot_CONFIG_RETENTION_BOOT_MODE=y
59+
- mcuboot_CONFIG_BOOT_FIRMWARE_LOADER_BOOT_MODE=y
60+
tags:
61+
- dfu_single_slot
62+
- ci_samples_dfu
63+
platform_allow:
64+
- nrf54l15dk/nrf54l15/cpuapp
65+
integration_platforms:
66+
- nrf54l15dk/nrf54l15/cpuapp
67+
sample.dfu.single_slot.fw_loader_update.fw_loader_entrance_boot_req.nrf54l15:
68+
extra_args:
69+
- SB_CONFIG_FIRMWARE_LOADER_UPDATE_ENABLE=y
70+
- FILE_SUFFIX=boot_req
71+
- unboxer_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/samples/dfu/single_slot/boards/nrf54l15dk_nrf54l15_cpuapp_boot_req.overlay"
72+
- unboxer_CONFIG_UNBOXER_FW_LOADER_ENTRANCE_BOOT_REQ=y
73+
tags:
74+
- dfu_single_slot
75+
- ci_samples_dfu
76+
77+
platform_allow:
78+
- nrf54l15dk/nrf54l15/cpuapp
79+
integration_platforms:
80+
- nrf54l15dk/nrf54l15/cpuapp
81+
sample.dfu.single_slot.fw_loader_update.fw_loader_entrance_boot_req.nrf54h20:
82+
extra_args:
83+
- SB_CONFIG_FIRMWARE_LOADER_UPDATE_ENABLE=y
84+
- FILE_SUFFIX=boot_req
85+
- unboxer_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/samples/dfu/single_slot/boards/nrf54h20dk_nrf54h20_cpuapp_boot_req.overlay"
86+
- unboxer_CONFIG_UNBOXER_FW_LOADER_ENTRANCE_BOOT_REQ=y
87+
tags:
88+
- dfu_single_slot
89+
- ci_samples_dfu
90+
platform_allow:
91+
- nrf54l15dk/nrf54l15/cpuapp
92+
integration_platforms:
93+
- nrf54l15dk/nrf54l15/cpuapp
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "../../../boards/nrf54h20dk_nrf54h20_cpuapp_boot_req.overlay"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &fw_loader_partition;
12+
};
13+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "../boards/nrf54h20dk_nrf54h20_cpuapp_boot_req.overlay"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &cpurad_slot0_partition;
12+
};
13+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_POWER_DOMAIN=n
8+
9+
CONFIG_NRF_SECURITY=y
10+
CONFIG_MULTITHREADING=y
11+
12+
CONFIG_NRF_BOOT_FIRMWARE_LOADER_BOOT_REQ=y
13+
CONFIG_NRF_MCUBOOT_BOOT_REQUEST=y
14+
CONFIG_CRC=y
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "../../../boards/nrf54h20dk_nrf54h20_cpuapp_boot_req.overlay"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &boot_partition;
12+
};
13+
14+
aliases {
15+
mcuboot-button0 = &button0;
16+
};
17+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
CONFIG_SYS_CLOCK_EXISTS=n
7+
CONFIG_NRF_GRTC_TIMER=n
8+
CONFIG_PSA_CORE_LITE=y
9+
CONFIG_CRACEN_IKG=n
10+
CONFIG_FPROTECT=y
11+
12+
# Disable run-time CRACEN provisioning of TRNG data.
13+
# KMU slots 248, 249 shall be pre-provisioned while programming with secret TRNG values instead.
14+
CONFIG_CRACEN_PROVISION_PROT_RAM_INV_SLOTS_ON_INIT=n
15+
16+
CONFIG_BOOT_WATCHDOG_FEED=n
17+
18+
CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32
19+
20+
CONFIG_NRF_BOOT_FIRMWARE_LOADER_BOOT_REQ=y
21+
CONFIG_RETAINED_MEM=y
22+
CONFIG_RETENTION=y
23+
CONFIG_NRF_MCUBOOT_BOOT_REQUEST=y
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "../../../boards/nrf54l15dk_nrf54l15_cpuapp_boot_req.overlay"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &boot_partition;
12+
};
13+
};
14+
15+
/ {
16+
aliases {
17+
mcuboot-button0 = &button0;
18+
};
19+
};

0 commit comments

Comments
 (0)