Skip to content

Commit 25a4b65

Browse files
maje-embrlubos
authored andcommitted
applications: nrf_desktop: Migrate B0 layout to DTS on nrf52840gmouse
Migrate the B0 bootloader memory layout for the nrf5284gmouse from the Partition Manager to DTS layout. Covering variants: default, release. Ref: NCSDK-37841 Signed-off-by: Marcin Jelinski <marcin.jelinski@nordicsemi.no>
1 parent 1fd186a commit 25a4b65

9 files changed

Lines changed: 86 additions & 2 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "memory_map_b0.dtsi"
18
#include "app_common.dtsi"
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 "../../memory_map_b0.dtsi"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &b0_partition;
12+
};
13+
};

applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/images/b0/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,6 @@ CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
4949

5050
# Improve debugging experience by disabling reset on fatal error
5151
CONFIG_RESET_ON_FATAL_ERROR=n
52+
53+
# Enable code partitioning with DTS
54+
CONFIG_USE_DT_CODE_PARTITION=y

applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/images/b0/prj_release.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
4848

4949
# Improve firmware reliability
5050
CONFIG_RESET_ON_FATAL_ERROR=y
51+
52+
# Enable code partitioning with DTS
53+
CONFIG_USE_DT_CODE_PARTITION=y
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
&flash0 {
8+
/delete-node/ partitions;
9+
10+
partitions {
11+
#address-cells = <1>;
12+
#size-cells = <1>;
13+
ranges;
14+
15+
b0_partition: partition@0 {
16+
compatible = "zephyr,mapped-partition";
17+
label = "b0";
18+
reg = <0x0 DT_SIZE_K(20)>;
19+
};
20+
21+
bl_storage: provision_partition: partition@5000 {
22+
compatible = "zephyr,mapped-partition";
23+
label = "b0-provision-data";
24+
reg = <0x5000 DT_SIZE_K(4)>;
25+
};
26+
27+
/* Define 'slot0_partition' and 'slot1_partition' as additional labels.
28+
* This keeps compatibility with the Partition Manager.
29+
*/
30+
slot0_partition: s0_partition: partition@6000 {
31+
compatible = "zephyr,mapped-partition";
32+
label = "b0-image-0";
33+
reg = <0x6000 DT_SIZE_K(496)>;
34+
};
35+
36+
slot1_partition: s1_partition: partition@82000 {
37+
compatible = "zephyr,mapped-partition";
38+
label = "b0-image-1";
39+
reg = <0x82000 DT_SIZE_K(496)>;
40+
};
41+
42+
storage_partition: partition@fe000 {
43+
compatible = "zephyr,mapped-partition";
44+
label = "storage";
45+
reg = <0xfe000 DT_SIZE_K(8)>;
46+
};
47+
};
48+
};

applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ CONFIG_PMW3360_ORIENTATION_90=y
143143
CONFIG_FW_INFO=y
144144
CONFIG_FW_INFO_FIRMWARE_VERSION=1
145145

146+
# Enable code partitioning with DTS
147+
CONFIG_USE_DT_CODE_PARTITION=y
148+
146149
################################################################################
147150

148151
CONFIG_ASSERT=y

applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/prj_release.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,6 @@ CONFIG_PMW3360_ORIENTATION_90=y
137137

138138
CONFIG_FW_INFO=y
139139
CONFIG_FW_INFO_FIRMWARE_VERSION=1
140+
141+
# Enable code partitioning with DTS
142+
CONFIG_USE_DT_CODE_PARTITION=y
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#
2-
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# Copyright (c) 2024-2026 Nordic Semiconductor ASA
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66
################################################################################
77

88
SB_CONFIG_SECURE_BOOT_APPCORE=y
99
SB_CONFIG_SECURE_BOOT_SIGNING_KEY_FILE="b0_private.pem"
10+
11+
SB_CONFIG_PARTITION_MANAGER=n
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#
2-
# Copyright (c) 2024 Nordic Semiconductor ASA
2+
# Copyright (c) 2024-2026 Nordic Semiconductor ASA
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66
################################################################################
77

88
SB_CONFIG_SECURE_BOOT_APPCORE=y
99
SB_CONFIG_SECURE_BOOT_SIGNING_KEY_FILE="b0_private.pem"
10+
11+
SB_CONFIG_PARTITION_MANAGER=n

0 commit comments

Comments
 (0)