Skip to content

Commit 4effee3

Browse files
committed
samples/dfu/fw_loader/usb_mcumgr: nRF54lm20dongle configuration
Added peculiar configuration for the nrf54lm20dongle/nrf54lm20b/cpuapp It has to be build with the FILE_SUFFIX="usb_enter_dongle". Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
1 parent 6387c9f commit 4effee3

9 files changed

Lines changed: 202 additions & 6 deletions

samples/dfu/single_slot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp_usb_enter.overlay renamed to samples/dfu/single_slot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp_usb_enter_dongle.overlay

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

7-
/*#include "./nrf54lm20dongle_nrf54lm20b_cpuapp.overlay"*/
8-
97
/ {
108
chosen {
11-
zephyr,uart-mcumgr = &cdc_acm_uart0;
9+
zephyr,uart-mcumgr = &mcumgr_cdc_acm_uart0;
1210
};
1311
};
1412

1513
&zephyr_udc0 {
16-
cdc_acm_uart0: cdc_acm_uart0 {
14+
mcumgr_cdc_acm_uart0: mcumgr_cdc_acm_uart0 {
1715
compatible = "zephyr,cdc-acm-uart";
16+
label = "nRF54LM20 Dongle MCUmgr";
1817
};
1918
};
19+
20+
&board_cdc_acm_uart {
21+
label = "console";
22+
};

samples/dfu/single_slot/prj_usb_enter.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ CONFIG_UART_LINE_CTRL=y
7676
CONFIG_CONSOLE=y
7777
CONFIG_USB_DEVICE_STACK_NEXT=y
7878
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=y
79+
# Two CDC ACM interfaces: board default (cdc_acm_serial.dtsi) + MCUmgr (overlay).
7980
CONFIG_CDC_ACM_SERIAL_MULTIPLE_INSTANCES=y
8081
# USB backend is serial device
8182
CONFIG_MCUMGR_TRANSPORT_UART=y
@@ -93,3 +94,6 @@ CONFIG_PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER=n
9394
CONFIG_PSA_USE_CRACEN_HASH_DRIVER=n
9495

9596
CONFIG_GPIO=y
97+
98+
CONFIG_CDC_ACM_SERIAL_VID=0x1915
99+
CONFIG_CDC_ACM_SERIAL_PID=0x541B
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Enable MCUmgr and dependencies.
2+
CONFIG_NET_BUF=y
3+
CONFIG_ZCBOR=y
4+
CONFIG_CRC=y
5+
CONFIG_MCUMGR=y
6+
CONFIG_STREAM_FLASH=y
7+
CONFIG_FLASH_MAP=y
8+
9+
# Some command handlers require a large stack.
10+
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2304
11+
CONFIG_MAIN_STACK_SIZE=2176
12+
13+
# Ensure an MCUboot-compatible binary is generated.
14+
CONFIG_BOOTLOADER_MCUBOOT=y
15+
16+
# Enable flash operations.
17+
CONFIG_FLASH=y
18+
19+
# Enable most core commands.
20+
CONFIG_MCUMGR_GRP_OS=y
21+
CONFIG_MCUMGR_GRP_OS_BOOTLOADER_INFO=y
22+
CONFIG_MCUMGR_GRP_OS_ECHO=y
23+
CONFIG_MCUMGR_GRP_OS_INFO=n
24+
CONFIG_MCUMGR_GRP_OS_RESET_BOOT_MODE=y
25+
26+
# Enable the Shell mcumgr transport.
27+
CONFIG_BASE64=y
28+
CONFIG_CRC=y
29+
30+
CONFIG_MCUMGR_TRANSPORT_NETBUF_SIZE=1220
31+
CONFIG_MCUMGR_GRP_OS_MCUMGR_PARAMS=y
32+
CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=4608
33+
34+
# Enable the storage erase command.
35+
CONFIG_MCUMGR_GRP_ZBASIC=y
36+
CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=y
37+
38+
# Disable shell commands that are not needed
39+
CONFIG_CLOCK_CONTROL_NRF_SHELL=n
40+
CONFIG_DEVICE_SHELL=n
41+
CONFIG_DEVMEM_SHELL=n
42+
CONFIG_FLASH_SHELL=n
43+
########
44+
45+
# Disable unneeded drivers, peripherals and features to optimize for size
46+
CONFIG_SIZE_OPTIMIZATIONS=y
47+
48+
# Enable LTO
49+
CONFIG_LTO=y
50+
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y
51+
52+
CONFIG_I2C=n
53+
CONFIG_WATCHDOG=n
54+
CONFIG_SPI_NOR=n
55+
CONFIG_GPIO=n
56+
57+
CONFIG_FPU=n
58+
59+
CONFIG_BOOT_BANNER=n
60+
CONFIG_NCS_BOOT_BANNER=n
61+
CONFIG_BOOT_DELAY=0
62+
CONFIG_PRINTK=n
63+
64+
CONFIG_ARM_MPU=n
65+
66+
CONFIG_TIMESLICING=n
67+
CONFIG_COMMON_LIBC_MALLOC=y
68+
CONFIG_LOG=n
69+
70+
CONFIG_UART_CONSOLE=n
71+
CONFIG_ASSERT=n
72+
73+
# Enable USB subsystem
74+
CONFIG_SERIAL=y
75+
CONFIG_UART_LINE_CTRL=y
76+
CONFIG_CONSOLE=y
77+
CONFIG_USB_DEVICE_STACK_NEXT=y
78+
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=y
79+
# Two CDC ACM interfaces: board default (cdc_acm_serial.dtsi) + MCUmgr (overlay).
80+
CONFIG_CDC_ACM_SERIAL_MULTIPLE_INSTANCES=y
81+
# USB backend is serial device
82+
CONFIG_MCUMGR_TRANSPORT_UART=y
83+
84+
85+
CONFIG_PSA_USE_CRACEN_CIPHER_DRIVER=n
86+
CONFIG_PSA_USE_CRACEN_AEAD_DRIVER=n
87+
CONFIG_PSA_USE_CRACEN_MAC_DRIVER=n
88+
CONFIG_PSA_USE_CRACEN_KEY_AGREEMENT_DRIVER=n
89+
CONFIG_PSA_USE_CRACEN_ASYMMETRIC_ENCRYPTION_DRIVER=n
90+
CONFIG_PSA_USE_CRACEN_KEY_MANAGEMENT_DRIVER=n
91+
CONFIG_PSA_USE_CRACEN_KEY_DERIVATION_DRIVER=n
92+
CONFIG_PSA_USE_CRACEN_PAKE_DRIVER=n
93+
CONFIG_PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER=n
94+
CONFIG_PSA_USE_CRACEN_HASH_DRIVER=n
95+
96+
CONFIG_GPIO=y
97+
98+
CONFIG_CDC_ACM_SERIAL_VID=0x1915
99+
CONFIG_CDC_ACM_SERIAL_PID=0x541B

samples/dfu/single_slot/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp_usb_enter.overlay renamed to samples/dfu/single_slot/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.overlay

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
zephyr,code-partition = &boot_partition;
1212
};
1313
};
14+
15+
/* ensure same RRAM layout im firmware_loader as in MCUboot */
16+
#include "../../nrf54lm20dongle_dfu_partitions.dtsi"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/delete-node/ &boot_partition;
8+
/delete-node/ &slot0_partition;
9+
/delete-node/ &slot1_partition;
10+
/delete-node/ &storage_partition;
11+
12+
/* This is nRF54lm20dongle_nrf54lm20b_cpuapp peculiar partitioning for MCUboot and firmware loader
13+
* slot0_partition spans RRAM with can be update by the firmware loader and booted by MCUboot.
14+
* beginning of the slot0_partition must match with the beginning of the slot0_partition of the user
15+
* application. Althought Application can be build for smaler partition and live some space for
16+
* other purposes like a storage partition.
17+
*/
18+
19+
&cpuapp_rram {
20+
reg = <0x0 DT_SIZE_K(2036)>;
21+
ranges = <0x0 0x0 DT_SIZE_K(2036)>;
22+
23+
partitions {
24+
compatible = "fixed-partitions";
25+
#address-cells = <1>;
26+
#size-cells = <1>;
27+
28+
/* Match nrf54lm20dongle_nrf54lm20b_cpuapp_partition.dtsi (RRAM layout). */
29+
30+
boot_partition: partition@0 {
31+
label = "mcuboot";
32+
reg = <0x0 DT_SIZE_K(24)>;
33+
};
34+
35+
slot1_partition: partition@6000 {
36+
label = "image-1";
37+
reg = <0x6000 DT_SIZE_K(116)>;
38+
};
39+
40+
slot0_partition: partition@23000 {
41+
label = "image-0";
42+
reg = <0x23000 DT_SIZE_K(1896)>;
43+
};
44+
};
45+
};
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
CONFIG_CDC_ACM_SERIAL_VID=0x1915
22
CONFIG_CDC_ACM_SERIAL_PID=0x541A
3-
4-
CONFIG_CDC_ACM_SERIAL_MULTIPLE_INSTANCES=y
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_CDC_ACM_SERIAL_VID=0x1915
2+
CONFIG_CDC_ACM_SERIAL_PID=0x541A
3+
CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=n
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
/delete-property/ zephyr,console;
10+
/delete-property/ zephyr,shell-uart;
11+
/delete-property/ zephyr,bt-mon-uart;
12+
/delete-property/ zephyr,bt-c2h-uart;
13+
zephyr,uart-mcumgr = &mcumgr_cdc_acm_uart0;
14+
};
15+
};
16+
17+
&zephyr_udc0 {
18+
/delete-node/ board_cdc_acm_uart;
19+
};
20+
21+
&zephyr_udc0 {
22+
mcumgr_cdc_acm_uart0: mcumgr_cdc_acm_uart0 {
23+
compatible = "zephyr,cdc-acm-uart";
24+
label = "nRF54LM20 Dongle MCUmgr";
25+
};
26+
};
27+
28+
/* ensure same RRAM layout im firmware_loader as in MCUboot */
29+
#include "nrf54lm20dongle_dfu_partitions.dtsi"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2026 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
8+
SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER=y
9+
SB_CONFIG_FIRMWARE_LOADER_IMAGE_USB_MCUMGR=y
10+
SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y
11+
12+
SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER_BOOT_MODE_ENTRANCE=y

0 commit comments

Comments
 (0)