From c0b080dcc17b5bbec279a5ede826fb94caca04d7 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Thu, 9 Apr 2026 07:59:33 +0200 Subject: [PATCH 1/2] samples: dfu: single_init: fix nRF54LM20 Dongle configuration nRF54LM20 Dongle board already defines MCUmgr CDC ACM instance in DTS, so no need to define it in the fw_loader. In fact, that broke MCUmgr because CDC ACM serial driver would initialize a wrong instance. Signed-off-by: Damian Krolik --- .../single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.conf | 2 ++ .../sysbuild/usb_mcumgr_usb_enter_dongle.overlay | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.conf b/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.conf index dbe0ef440fbd..17ba4735df2b 100644 --- a/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.conf +++ b/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.conf @@ -1,3 +1,5 @@ CONFIG_CDC_ACM_SERIAL_VID=0x1915 CONFIG_CDC_ACM_SERIAL_PID=0x541A +CONFIG_CDC_ACM_SERIAL_MANUFACTURER_STRING="Nordic Semiconductor ASA" +CONFIG_CDC_ACM_SERIAL_PRODUCT_STRING="nRF54LM20 Dongle Bootloader" CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=n diff --git a/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.overlay b/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.overlay index aa7f44625c85..61476989507d 100644 --- a/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.overlay +++ b/samples/dfu/single_slot/sysbuild/usb_mcumgr_usb_enter_dongle.overlay @@ -10,7 +10,6 @@ /delete-property/ zephyr,shell-uart; /delete-property/ zephyr,bt-mon-uart; /delete-property/ zephyr,bt-c2h-uart; - zephyr,uart-mcumgr = &mcumgr_cdc_acm_uart0; }; }; @@ -18,12 +17,5 @@ /delete-node/ board_cdc_acm_uart; }; -&zephyr_udc0 { - mcumgr_cdc_acm_uart0: mcumgr_cdc_acm_uart0 { - compatible = "zephyr,cdc-acm-uart"; - label = "nRF54LM20 Dongle MCUmgr"; - }; -}; - /* ensure same RRAM layout im firmware_loader as in MCUboot */ #include "../nrf54lm20dongle_dfu_partitions.dtsi" From b3a674235cc08ed688835e8f12107fca33f77542 Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 3 Apr 2026 16:00:52 +0200 Subject: [PATCH 2/2] samples: bluetooth: central_uart: sign nRF54LM20 Dongle image nRF54LM20 Dongle image needs to be signed to be programmable with nRF Util (that uses MCUBoot firmware loader mode). As for now, this implies that MCUBoot build must be enabled for the dongle. Signed-off-by: Andrzej Puzdrowski Signed-off-by: Damian Krolik --- .../nrf54lm20dongle_dfu_partitions.dtsi | 20 ++++++++ samples/bluetooth/central_uart/sample.yaml | 9 ++++ .../nrf54lm20dongle_nrf54lm20b_cpuapp.conf | 15 ++++++ .../nrf54lm20dongle_nrf54lm20b_cpuapp.overlay | 14 ++++++ .../central_uart/sysbuild/mcuboot/prj.conf | 47 +++++++++++++++++++ .../sysbuild/usb_mcumgr_bootloader.conf | 5 ++ .../sysbuild/usb_mcumgr_bootloader.overlay | 21 +++++++++ .../central_uart/sysbuild_bootloader.conf | 14 ++++++ 8 files changed, 145 insertions(+) create mode 100644 samples/bluetooth/central_uart/nrf54lm20dongle_dfu_partitions.dtsi create mode 100644 samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.conf create mode 100644 samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.overlay create mode 100644 samples/bluetooth/central_uart/sysbuild/mcuboot/prj.conf create mode 100644 samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.conf create mode 100644 samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.overlay create mode 100644 samples/bluetooth/central_uart/sysbuild_bootloader.conf diff --git a/samples/bluetooth/central_uart/nrf54lm20dongle_dfu_partitions.dtsi b/samples/bluetooth/central_uart/nrf54lm20dongle_dfu_partitions.dtsi new file mode 100644 index 000000000000..33ac413d2f29 --- /dev/null +++ b/samples/bluetooth/central_uart/nrf54lm20dongle_dfu_partitions.dtsi @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* This file modifies RRAM partitioning for MCUboot and firmware loader by + * extending slot0_partition (application image) to the end of RRAM. + * + * While the application may use extra partitions, such as storage_partition + * defined by default, this partitioning of application-dedicated region is + * irrelevant to the bootloader images. + */ + +/delete-node/ &storage_partition; + +&slot0_partition { + /* Start matches board layout */ + reg = <0x23000 DT_SIZE_K(1896)>; +}; diff --git a/samples/bluetooth/central_uart/sample.yaml b/samples/bluetooth/central_uart/sample.yaml index 1a63fc2c2634..f11ad7689913 100644 --- a/samples/bluetooth/central_uart/sample.yaml +++ b/samples/bluetooth/central_uart/sample.yaml @@ -48,6 +48,15 @@ tests: platform_allow: - nrf5340dk/nrf5340/cpuapp - nrf54h20dk/nrf54h20/cpuapp + sample.bluetooth.central_uart.bootloader: + sysbuild: true + build_only: true + extra_args: + - FILE_SUFFIX=bootloader + integration_platforms: + - nrf54lm20dongle/nrf54lm20b/cpuapp + platform_allow: + - nrf54lm20dongle/nrf54lm20b/cpuapp sample.bluetooth.central_uart.llvm: toolchain_allow: llvm sysbuild: true diff --git a/samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.conf b/samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.conf new file mode 100644 index 000000000000..9a44ff48a341 --- /dev/null +++ b/samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.conf @@ -0,0 +1,15 @@ +# +# Copyright (c) 2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +CONFIG_SYS_CLOCK_EXISTS=n +CONFIG_NRF_GRTC_TIMER=n +CONFIG_CRACEN_IKG=n +CONFIG_FPROTECT=y + +# Disable run-time CRACEN provisioning of TRNG data. +# KMU slots 248, 249 shall be pre-provisioned while programming with secret TRNG values instead. +CONFIG_CRACEN_PROVISION_PROT_RAM_INV_SLOTS_ON_INIT=n + +CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE=32 diff --git a/samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.overlay b/samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.overlay new file mode 100644 index 000000000000..19b6bab5a2e7 --- /dev/null +++ b/samples/bluetooth/central_uart/sysbuild/mcuboot/boards/nrf54lm20dongle_nrf54lm20b_cpuapp.overlay @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; + +/* ensure same RRAM layout in firmware_loader as in MCUboot */ +#include "../../../nrf54lm20dongle_dfu_partitions.dtsi" diff --git a/samples/bluetooth/central_uart/sysbuild/mcuboot/prj.conf b/samples/bluetooth/central_uart/sysbuild/mcuboot/prj.conf new file mode 100644 index 000000000000..83aa076bc490 --- /dev/null +++ b/samples/bluetooth/central_uart/sysbuild/mcuboot/prj.conf @@ -0,0 +1,47 @@ +# +# Copyright (c) 2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_BOOT_FIRMWARE_LOADER_ENTRANCE_GPIO=y +CONFIG_BOOT_FIRMWARE_LOADER_NO_APPLICATION=y + +CONFIG_PM=n + +CONFIG_MAIN_STACK_SIZE=10240 + +CONFIG_BOOT_SWAP_SAVE_ENCTLV=n +CONFIG_BOOT_ENCRYPT_IMAGE=n + +CONFIG_BOOT_UPGRADE_ONLY=n +CONFIG_BOOT_BOOTSTRAP=n + +CONFIG_FLASH=y +CONFIG_GPIO=y + +### Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y +CONFIG_CBPRINTF_NANO=y +### Use picolibc to reduce flash usage +CONFIG_PICOLIBC=y +### Disable malloc arena because we don't need it +CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0 + +# Reduce memory consumption +CONFIG_BOOT_BANNER=n +CONFIG_NCS_BOOT_BANNER=n +CONFIG_CLOCK_CONTROL=n +CONFIG_NRF_GRTC_START_SYSCOUNTER=n +CONFIG_SPI_NOR=n +CONFIG_SERIAL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_PRINTK=n +CONFIG_USE_SEGGER_RTT=n + +# Activate Link Time Optimization (LTO) +CONFIG_LTO=y +CONFIG_ISR_TABLES_LOCAL_DECLARATION=y + +# Improve debugging experience by disabling reset on fatal error +CONFIG_RESET_ON_FATAL_ERROR=n diff --git a/samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.conf b/samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.conf new file mode 100644 index 000000000000..17ba4735df2b --- /dev/null +++ b/samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.conf @@ -0,0 +1,5 @@ +CONFIG_CDC_ACM_SERIAL_VID=0x1915 +CONFIG_CDC_ACM_SERIAL_PID=0x541A +CONFIG_CDC_ACM_SERIAL_MANUFACTURER_STRING="Nordic Semiconductor ASA" +CONFIG_CDC_ACM_SERIAL_PRODUCT_STRING="nRF54LM20 Dongle Bootloader" +CONFIG_MCUMGR_GRP_ZBASIC_STORAGE_ERASE=n diff --git a/samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.overlay b/samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.overlay new file mode 100644 index 000000000000..4c43ceecf3a3 --- /dev/null +++ b/samples/bluetooth/central_uart/sysbuild/usb_mcumgr_bootloader.overlay @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2026 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/ { + chosen { + /delete-property/ zephyr,console; + /delete-property/ zephyr,shell-uart; + /delete-property/ zephyr,bt-mon-uart; + /delete-property/ zephyr,bt-c2h-uart; + }; +}; + +&zephyr_udc0 { + /delete-node/ board_cdc_acm_uart; +}; + +/* ensure same RRAM layout in firmware_loader as in MCUboot */ +#include "../nrf54lm20dongle_dfu_partitions.dtsi" diff --git a/samples/bluetooth/central_uart/sysbuild_bootloader.conf b/samples/bluetooth/central_uart/sysbuild_bootloader.conf new file mode 100644 index 000000000000..c267a8d9a911 --- /dev/null +++ b/samples/bluetooth/central_uart/sysbuild_bootloader.conf @@ -0,0 +1,14 @@ +# +# Copyright (c) 2026 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +SB_CONFIG_BOOTLOADER_MCUBOOT=y +SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER=y +SB_CONFIG_MCUBOOT_SIGNATURE_USING_KMU=y +SB_CONFIG_MCUBOOT_GENERATE_DEFAULT_KEY_FILE=y +SB_CONFIG_FIRMWARE_LOADER_IMAGE_USB_MCUMGR=y +SB_CONFIG_BOOT_SIGNATURE_TYPE_PURE=y + +SB_CONFIG_MCUBOOT_MODE_FIRMWARE_UPDATER_BOOT_MODE_ENTRANCE=y