Skip to content

Commit 2ecfff8

Browse files
committed
samples: smp_svr: Add nRF53 sequential updates
Add a configuration, showcasing the nRF53 sequential update scheme. Ref: NSDIDB-1487 Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
1 parent bfca2b0 commit 2ecfff8

9 files changed

Lines changed: 110 additions & 17 deletions

samples/dfu/smp_svr/sysbuild/hci_ipc_nrf5340_bt.overlay renamed to samples/dfu/smp_svr/boards/nrf5340dk_nrf5340_cpuapp_nrf5340_shared_slot.overlay

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,30 @@
99
/delete-node/ &slot1_partition;
1010
/delete-node/ &storage_partition;
1111

12-
&flash1 {
12+
&flash0 {
1313
partitions {
14-
b0n_partition: partition@0 {
14+
boot_partition: partition@0 {
1515
compatible = "zephyr,mapped-partition";
16-
label = "b0n";
17-
reg = <0x0 0x8580>;
16+
label = "mcuboot";
17+
reg = <0x0 DT_SIZE_K(80)>;
1818
};
1919

20-
bl_storage: provision_partition: partition@8580 {
20+
slot0_partition: partition@14000 {
2121
compatible = "zephyr,mapped-partition";
22-
label = "b0-provision-data";
23-
reg = <0x8580 0x280>;
22+
label = "image-0";
23+
reg = <0x14000 DT_SIZE_K(440)>;
2424
};
2525

26-
s0_partition: partition@8800 {
26+
slot1_partition: partition@82000 {
2727
compatible = "zephyr,mapped-partition";
28-
label = "image-0";
29-
reg = <0x8800 DT_SIZE_K(222)>;
28+
label = "image-1";
29+
reg = <0x82000 DT_SIZE_K(440)>;
30+
};
31+
32+
storage_partition: partition@f0000 {
33+
compatible = "zephyr,mapped-partition";
34+
label = "storage";
35+
reg = <0xf0000 DT_SIZE_K(64)>;
3036
};
3137
};
3238
};

samples/dfu/smp_svr/sample.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,30 @@ tests:
323323
- "smp_sample: build time"
324324
- "smp_bt_sample: Advertising successfully started"
325325

326+
sample.dfu.smp_svr.bt.nrf5340dk.shared_slot:
327+
sysbuild: true
328+
extra_args:
329+
- OVERLAY_CONFIG="overlay-bt.conf"
330+
- FILE_SUFFIX=nrf5340_shared_slot
331+
- SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y
332+
platform_allow:
333+
- nrf5340dk/nrf5340/cpuapp
334+
integration_platforms:
335+
- nrf5340dk/nrf5340/cpuapp
336+
harness_config: *bt_harness_config
337+
338+
sample.dfu.smp_svr.bt.nrf5340dk.shared_slot.swap_move:
339+
sysbuild: true
340+
extra_args:
341+
- OVERLAY_CONFIG="overlay-bt.conf"
342+
- FILE_SUFFIX=nrf5340_shared_slot
343+
- SB_CONFIG_MCUBOOT_MODE_SWAP_USING_MOVE=y
344+
platform_allow:
345+
- nrf5340dk/nrf5340/cpuapp
346+
integration_platforms:
347+
- nrf5340dk/nrf5340/cpuapp
348+
harness_config: *bt_harness_config
349+
326350
sample.dfu.smp_svr.bt.nrf54l15:
327351
tags: bluetooth
328352
extra_args: EXTRA_CONF_FILE="overlay-bt.conf"

samples/dfu/smp_svr/sysbuild/b0n_nrf5340_bt.overlay renamed to samples/dfu/smp_svr/sysbuild/b0n.overlay

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7-
/ {
8-
chosen {
9-
zephyr,code-partition = &b0n_partition;
10-
};
11-
};
12-
137
/delete-node/ &boot_partition;
148
/delete-node/ &slot0_partition;
159
/delete-node/ &slot1_partition;
@@ -36,3 +30,9 @@
3630
};
3731
};
3832
};
33+
34+
/ {
35+
chosen {
36+
zephyr,code-partition = &b0n_partition;
37+
};
38+
};
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Enable reading network core application version through PCD.
2+
CONFIG_PCD_READ_NETCORE_APP_VERSION=y
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+
#include "b0n.overlay"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &s0_partition;
12+
};
13+
};
14+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# MCUboot requires a large stack size, otherwise an MPU fault will occur
2+
CONFIG_MAIN_STACK_SIZE=16384
3+
4+
# Enable flash operations
5+
CONFIG_FLASH=y
6+
7+
CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=y
8+
9+
CONFIG_MULTITHREADING=y
10+
11+
CONFIG_LOG=y
12+
CONFIG_LOG_MODE_MINIMAL=y
13+
CONFIG_LOG_DEFAULT_LEVEL=0
14+
CONFIG_MCUBOOT_LOG_LEVEL_INF=y
15+
# Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y
16+
CONFIG_CBPRINTF_NANO=y
17+
# Use minimal C library instead of the Picolib
18+
CONFIG_MINIMAL_LIBC=y
19+
20+
CONFIG_FW_INFO_FIRMWARE_VERSION=2
21+
22+
# NCS boot banner
23+
CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot"
24+
CONFIG_FLASH_SIMULATOR_STATS=n
25+
26+
# Enable SW-based downgrade prevention
27+
CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=y
28+
CONFIG_PCD_READ_NETCORE_APP_VERSION=y
29+
CONFIG_FW_INFO=y
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/nrf5340dk_nrf5340_cpuapp_nrf5340_shared_slot.overlay"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &boot_partition;
12+
};
13+
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Enable MCUboot bootloader support
2+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
3+
SB_CONFIG_NETCORE_HCI_IPC=y
4+
SB_CONFIG_SECURE_BOOT_NETCORE=y
5+
SB_CONFIG_NETCORE_APP_UPDATE=y

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ manifest:
129129
compare-by-default: true
130130
- name: mcuboot
131131
repo-path: sdk-mcuboot
132-
revision: 8414450633ac0b902256e58216fe4f3c6c3039d7
132+
revision: pull/712/head
133133
path: bootloader/mcuboot
134134
- name: qcbor
135135
repo-path: sdk-qcbor

0 commit comments

Comments
 (0)