Skip to content

Commit 6250267

Browse files
committed
sysbuild: Remove offsets from merged slots
Adjust logic, so the merged slots do not include gaps between images. Ref: NCSDK-25612 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent c7a6512 commit 6250267

22 files changed

+284
-80
lines changed

applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/app_common.dtsi

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,6 @@
6565
};
6666
};
6767

68-
/* Define the necessary aliases for the MCUboot slots that will be used by the DFU transports.
69-
* Due to the build system limitation, the allowed size of the application image (configured by
70-
* the code partition DTS node) is incorrectly increased by the size allocated for the radio image.
71-
*/
72-
slot0_partition: &cpuapp_slot0_partition {
73-
label = "image-0";
74-
};
75-
76-
slot1_partition: &cpuapp_slot1_partition {
77-
label = "image-1";
78-
};
79-
8068
secondary_app_partition: &cpuapp_slot1_partition {};
8169

8270
/* Remove the undefined property value from the disabled VPR cores to prevent build errors. */

applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/images/mcuboot/app.overlay

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@
1515
};
1616
};
1717

18-
/* Define the necessary aliases for the DTS partition nodes that contain the application and
19-
* radio images.
20-
*/
21-
slot0_partition: &cpuapp_slot0_partition {
22-
label = "image-0";
23-
};
24-
25-
slot1_partition: &cpuapp_slot1_partition {
26-
label = "image-1";
27-
};
28-
2918
/* Remove the undefined property value from the disabled VPR cores to prevent build errors. */
3019
&cpuflpr_vpr {
3120
/delete-property/ source-memory;

applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpuapp/memory_map.dtsi

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,33 @@
2121
reg = <0x30000 DT_SIZE_K(24)>;
2222
};
2323

24-
/* Due to the build system limitation, the allowed size of the application image
25-
* (configured by the code partition DTS node) is incorrectly increased by the size
26-
* allocated for the radio image.
24+
/* When using merged slots, the definition of MCUboot slots is common for all
25+
* images and points to the "merged" partition.
2726
*/
28-
cpuapp_slot0_partition: partition@36000 {
27+
slot0_partition: partition@36000 {
2928
reg = <0x36000 DT_SIZE_K(808)>;
3029
};
3130

31+
cpuapp_slot0_partition: partition@36800 {
32+
reg = <0x36800 DT_SIZE_K(586)>;
33+
};
34+
3235
cpurad_slot0_partition: partition@c9000 {
33-
reg = <0xc9000 DT_SIZE_K(220)>;
36+
reg = <0xc9000 (DT_SIZE_K(220) - 224)>;
3437
};
3538

3639
/* Partitions belonging to the MRAM_11 memory block. */
3740

38-
/* Due to the build system limitation, the allowed size of the application image
39-
* (configured by the code partition DTS node) is incorrectly increased by the size
40-
* allocated for the radio image.
41-
*/
42-
cpuapp_slot1_partition: partition@100000 {
41+
slot1_partition: partition@100000 {
4342
reg = <0x100000 DT_SIZE_K(808)>;
4443
};
4544

45+
cpuapp_slot1_partition: partition@100800 {
46+
reg = <0x100800 DT_SIZE_K(586)>;
47+
};
48+
4649
cpurad_slot1_partition: partition@193000 {
47-
reg = <0x193000 DT_SIZE_K(220)>;
50+
reg = <0x193000 (DT_SIZE_K(220) - 224)>;
4851
};
4952

5053
storage_partition: partition@1ca000 {

applications/nrf_desktop/configuration/nrf54h20dk_nrf54h20_cpurad/images/ipc_radio/app.overlay

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,4 @@
66

77
#include "../../../nrf54h20dk_nrf54h20_cpuapp/memory_map.dtsi"
88

9-
slot0_partition: &cpurad_slot0_partition {
10-
label = "image-0";
11-
};
12-
13-
slot1_partition: &cpurad_slot1_partition {
14-
label = "image-1";
15-
};
16-
179
secondary_app_partition: &cpurad_slot1_partition {};

samples/dfu/ab/boards/nrf54h20dk_nrf54h20_cpuapp.overlay

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@
1111
zephyr,boot-mode = &boot_request;
1212
};
1313
};
14+
15+
secondary_app_partition: &cpuapp_slot1_partition {};
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7-
#include "../sysbuild/nrf54h20dk_nrf54h20_memory_map_merged_slot.dtsi"
7+
#include "nrf54h20dk_nrf54h20_memory_map.dtsi"
8+
9+
secondary_app_partition: &cpurad_slot1_partition {};

samples/dfu/ab/sysbuild/nrf54h20dk_nrf54h20_memory_map.dtsi

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,59 @@
55
*/
66

77
/* On nRF54H20 the Direct XIP mode is supported in the merged slot configuration
8-
* Merge application and radio slots by extending the application partition.
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.
915
*/
10-
&cpuapp_slot0_partition {
11-
reg = <0x40000 DT_SIZE_K(656)>;
12-
};
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+
&mram1x {
22+
partitions {
23+
/* Merged partition used by the MCUboot (variant 0). */
24+
slot0_partition: partition@40000 {
25+
reg = <0x40000 DT_SIZE_K(656)>;
26+
};
27+
28+
/* Application code partition (variant 0).
29+
* Offset by the MCUboot header size (2048 bytes).
30+
*/
31+
cpuapp_slot0_partition: partition@40800 {
32+
reg = <0x40800 DT_SIZE_K(326)>;
33+
};
34+
35+
/* Radio code partition (variant 0).
36+
* Reduced by the MCUboot trailer size (224 bytes).
37+
*/
38+
cpurad_slot0_partition: partition@92000 {
39+
reg = <0x92000 (DT_SIZE_K(328) - 224)>;
40+
};
1341

14-
&cpuapp_slot1_partition {
15-
reg = <0x100000 DT_SIZE_K(656)>;
42+
/* Merged partition used by the MCUboot (variant 1). */
43+
slot1_partition: partition@100000 {
44+
reg = <0x100000 DT_SIZE_K(656)>;
45+
};
46+
47+
/* Application code partition (variant 1).
48+
* Offset by the MCUboot header size (2048 bytes).
49+
*/
50+
cpuapp_slot1_partition: partition@100800 {
51+
reg = <0x100800 DT_SIZE_K(326)>;
52+
};
53+
54+
/* Radio code partition (variant 1).
55+
* Reduced by the MCUboot trailer size (224 bytes).
56+
*/
57+
cpurad_slot1_partition: partition@152000 {
58+
reg = <0x152000 (DT_SIZE_K(328) - 224)>;
59+
};
60+
};
1661
};
1762

1863
/ {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "../sysbuild/nrf54h20dk_nrf54h20_memory_map_direct_xip.dtsi"
8+
9+
secondary_app_partition: &cpuapp_slot1_partition {};

samples/zephyr/smp_svr_mini_boot/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ common:
1313
tests:
1414
sample.smp_svr_mini_boot:
1515
extra_args:
16+
- FILE_SUFFIX="direct_xip"
1617
- SB_CONFIG_MCUBOOT_MODE_DIRECT_XIP=y
1718
platform_allow:
1819
- nrf54l15dk/nrf54l15/cpuapp
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "nrf54h20dk_nrf54h20_memory_map_direct_xip.dtsi"
8+
9+
secondary_app_partition: &cpurad_slot1_partition {};

0 commit comments

Comments
 (0)