Skip to content

Commit 9527201

Browse files
committed
samples/dfu/single_slot: add nrf54lm20dongle support
Extend sample's configuration to support nRF54LM20dongle with usb fw_loader and buttonles DFU enter via mcumgr (via USB serial) in the application. This 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 e2785b7 commit 9527201

9 files changed

Lines changed: 248 additions & 0 deletions
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,uart-mcumgr = &mcumgr_cdc_acm_uart0;
10+
};
11+
};
12+
13+
&zephyr_udc0 {
14+
mcumgr_cdc_acm_uart0: mcumgr_cdc_acm_uart0 {
15+
compatible = "zephyr,cdc-acm-uart";
16+
label = "nRF54LM20 Dongle MCUmgr";
17+
};
18+
};
19+
20+
&board_cdc_acm_uart {
21+
label = "console";
22+
};

samples/dfu/single_slot/prj_usb_enter.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ 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).
80+
CONFIG_CDC_ACM_SERIAL_MULTIPLE_INSTANCES=y
7981
# USB backend is serial device
8082
CONFIG_MCUMGR_TRANSPORT_UART=y
8183

@@ -92,3 +94,6 @@ CONFIG_PSA_USE_CRACEN_ASYMMETRIC_SIGNATURE_DRIVER=n
9294
CONFIG_PSA_USE_CRACEN_HASH_DRIVER=n
9395

9496
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
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#
2+
# Copyright (c) 2026 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_CRACEN_IKG=n
9+
CONFIG_FPROTECT=y
10+
11+
# Disable run-time CRACEN provisioning of TRNG data.
12+
# KMU slots 248, 249 shall be pre-provisioned while programming with secret TRNG values instead.
13+
CONFIG_CRACEN_PROVISION_PROT_RAM_INV_SLOTS_ON_INIT=n
14+
15+
CONFIG_BOOT_MAX_IMG_SECTORS=256
16+
CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/*#include "../../../boards/nrf54lm20dk_nrf54lm20a_cpuapp.overlay"*/
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &boot_partition;
12+
};
13+
};
14+
15+
/* ensure same RRAM layout im firmware_loader as in MCUboot */
16+
#include "../../nrf54lm20dongle_dfu_partitions.dtsi"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
/* Matches board layout */
29+
boot_partition: partition@0 {
30+
label = "mcuboot";
31+
reg = <0x0 DT_SIZE_K(24)>;
32+
};
33+
34+
/* Matches board layout */
35+
slot1_partition: partition@6000 {
36+
label = "image-1";
37+
reg = <0x6000 DT_SIZE_K(116)>;
38+
};
39+
40+
/* Start matches board layout */
41+
slot0_partition: partition@23000 {
42+
label = "image-0";
43+
reg = <0x23000 DT_SIZE_K(1896)>;
44+
};
45+
};
46+
};
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)