Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Comment thread
Damian-Nordic marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -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.
*/
Comment on lines +7 to +13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is false? I don't follow this, the pre-programmed bootloader will not allow you to write this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not false according to @tomchy and @nvlsianpu. MCUBoot and firmware loader don't care whether the application uses all its region for the code or for data.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote the feature, neither of them did. Configuring hello_world for this board with MCUboot gives the following for MCUboot:

                                /* node '/soc/rram-controller@5004e000/rram@0/partitions' defined in nrf/boards/nordic/nrf54lm20dong>
                                partitions {
                                        compatible = "fixed-partitions"; /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_nrf>
                                        #address-cells = < 0x1 >;        /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_nrf>
                                        #size-cells = < 0x1 >;           /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_nrf>

                                        /* node '/soc/rram-controller@5004e000/rram@0/partitions/partition@0' defined in nrf/boards/>
                                        boot_partition: partition@0 {
                                                label = "mcuboot";    /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_nrf54l>
                                                reg = < 0x0 0x6000 >; /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_nrf54l>
                                        };

                                        /* node '/soc/rram-controller@5004e000/rram@0/partitions/partition@6000' defined in nrf/boar>
                                        slot1_partition: partition@6000 {
                                                label = "image-1";        /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_nr>
                                                reg = < 0x6000 0x1d000 >; /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_nr>
                                        };

                                        /* node '/soc/rram-controller@5004e000/rram@0/partitions/partition@23000' defined in nrf/boa>
                                        slot0_partition: partition@23000 {
                                                label = "image-0";          /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_>
                                                reg = < 0x23000 0x1ca000 >; /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_>
                                        };

                                        /* node '/soc/rram-controller@5004e000/rram@0/partitions/partition@1ed000' defined in nrf/bo>
                                        storage_partition: partition@1ed000 {
                                                label = "storage";          /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_>
                                                reg = < 0x1ed000 0x10000 >; /* in nrf/boards/nordic/nrf54lm20dongle/nrf54lm20dongle_>
                                        };
                                };

likewise the same for usb_mcumgr, and all that sample does is use MCUmgr's img mgmt which opens and writes to a partition, so unless the image build for the dongle is from an entirely different repo then their claim is false

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed f2f, the comment is not false per se, but the takeaway is that this layout should be configured by default in MCUboot and fw_loader for the dongle (not in the sample).


/delete-node/ &storage_partition;

&slot0_partition {
/* Start matches board layout */
reg = <0x23000 DT_SIZE_K(1896)>;
};
9 changes: 9 additions & 0 deletions samples/bluetooth/central_uart/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
47 changes: 47 additions & 0 deletions samples/bluetooth/central_uart/sysbuild/mcuboot/prj.conf
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 14 additions & 0 deletions samples/bluetooth/central_uart/sysbuild_bootloader.conf
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,12 @@
/delete-property/ zephyr,shell-uart;
/delete-property/ zephyr,bt-mon-uart;
/delete-property/ zephyr,bt-c2h-uart;
zephyr,uart-mcumgr = &mcumgr_cdc_acm_uart0;
};
};

&zephyr_udc0 {
/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"
Loading