From a2b1194d6ab2e3dffcf8963ee734abd866ac73c8 Mon Sep 17 00:00:00 2001 From: Lukasz Bielak Date: Wed, 5 Aug 2026 09:09:59 +0200 Subject: [PATCH] Add partition configurations --- l9/l9_e6/boards/nrf52833dk_nrf52833.overlay | 48 +++++++++++++++++++ .../nrf54ls05dk_nrf54ls05b_cpuapp.overlay | 32 +++++++++++++ l9/l9_e6/sysbuild.conf | 14 ------ l9/l9_e6/sysbuild/mcuboot/app.overlay | 5 ++ .../boards/nrf52833dk_nrf52833.overlay | 19 ++++++++ .../nrf54ls05dk_nrf54ls05b_cpuapp.overlay | 38 +++++++++++++++ l9/l9_e6/sysbuild/mcuboot/prj.conf | 24 ++++++++++ .../boards/nrf52833dk_nrf52833.overlay | 48 +++++++++++++++++++ l9/l9_e6_sol/boards/nrf52dk_nrf52832.overlay | 48 +++++++++++++++++++ .../boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf | 4 ++ .../nrf54ls05dk_nrf54ls05b_cpuapp.overlay | 32 +++++++++++++ l9/l9_e6_sol/sysbuild.conf | 15 ------ l9/l9_e6_sol/sysbuild/mcuboot/app.overlay | 5 ++ .../boards/nrf52833dk_nrf52833.overlay | 19 ++++++++ .../mcuboot/boards/nrf52dk_nrf52832.overlay | 19 ++++++++ .../nrf54ls05dk_nrf54ls05b_cpuapp.overlay | 7 +++ l9/l9_e6_sol/sysbuild/mcuboot/prj.conf | 24 ++++++++++ 17 files changed, 372 insertions(+), 29 deletions(-) create mode 100644 l9/l9_e6/boards/nrf52833dk_nrf52833.overlay create mode 100644 l9/l9_e6/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay create mode 100644 l9/l9_e6/sysbuild/mcuboot/app.overlay create mode 100644 l9/l9_e6/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay create mode 100644 l9/l9_e6/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay create mode 100644 l9/l9_e6/sysbuild/mcuboot/prj.conf create mode 100644 l9/l9_e6_sol/boards/nrf52833dk_nrf52833.overlay create mode 100644 l9/l9_e6_sol/boards/nrf52dk_nrf52832.overlay create mode 100644 l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf create mode 100644 l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay create mode 100644 l9/l9_e6_sol/sysbuild/mcuboot/app.overlay create mode 100644 l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay create mode 100644 l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52dk_nrf52832.overlay create mode 100644 l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay create mode 100644 l9/l9_e6_sol/sysbuild/mcuboot/prj.conf diff --git a/l9/l9_e6/boards/nrf52833dk_nrf52833.overlay b/l9/l9_e6/boards/nrf52833dk_nrf52833.overlay new file mode 100644 index 00000000..c7c6ba9f --- /dev/null +++ b/l9/l9_e6/boards/nrf52833dk_nrf52833.overlay @@ -0,0 +1,48 @@ +/* + * nRF52833DK flash re-partition (Partition Manager disabled, DTS authoritative). + * + * Change vs. the board default: mcuboot (boot_partition) is 8 KB smaller and the + * application slot (slot0_partition / image-0) is 8 KB bigger. slot0's end address + * is unchanged, so slot1 and storage keep their original addresses. + * + * MCUboot swap-based DFU requires slot0 and slot1 to be equal, so slot1 also grows + * to 228 KB; the extra 8 KB is reclaimed from storage (24 KB -> 16 KB). + * + * boot_partition 0x00000 40 KB (was 48 KB) + * slot0_partition 0x0a000 228 KB (was 220 KB) + * slot1_partition 0x43000 228 KB (was 220 KB) + * storage_partition 0x7c000 16 KB (was 24 KB) + */ + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &storage_partition; + +&flash0 { + partitions { + boot_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(40)>; + }; + + slot0_partition: partition@a000 { + compatible = "zephyr,mapped-partition"; + label = "image-0"; + reg = <0xa000 DT_SIZE_K(228)>; + }; + + slot1_partition: partition@43000 { + compatible = "zephyr,mapped-partition"; + label = "image-1"; + reg = <0x43000 DT_SIZE_K(228)>; + }; + + storage_partition: partition@7c000 { + compatible = "zephyr,mapped-partition"; + label = "storage"; + reg = <0x7c000 DT_SIZE_K(16)>; + }; + }; +}; diff --git a/l9/l9_e6/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/l9/l9_e6/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay new file mode 100644 index 00000000..bd3e21b9 --- /dev/null +++ b/l9/l9_e6/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -0,0 +1,32 @@ +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &storage_partition; + +&cpuapp_rram { + partitions { + boot_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(56)>; + }; + + slot0_partition: partition@e000 { + compatible = "zephyr,mapped-partition"; + label = "image-0"; + reg = <0xe000 DT_SIZE_K(220)>; + }; + + slot1_partition: partition@45000 { + compatible = "zephyr,mapped-partition"; + label = "image-1"; + reg = <0x45000 DT_SIZE_K(220)>; + }; + + storage_partition: partition@7c000 { + compatible = "zephyr,mapped-partition"; + label = "storage"; + reg = <0x7c000 DT_SIZE_K(12)>; + }; + }; +}; diff --git a/l9/l9_e6/sysbuild.conf b/l9/l9_e6/sysbuild.conf index c4d5b68e..535142fe 100644 --- a/l9/l9_e6/sysbuild.conf +++ b/l9/l9_e6/sysbuild.conf @@ -1,17 +1,3 @@ -# Step 2.1 Enable MCUboot SB_CONFIG_BOOTLOADER_MCUBOOT=y -# Step 6.3 - Configure project to use external flash for DFU - -# Step 7.2 - Add b0n image - -# Step 7.3 - Set up multiple partitions - -# Step 7.4 - Add support to netcore for DFU - -# Step 7.5 - Add support to mcuboot for updating -# two cores simultaneously - -# Step 7.6 - Simultaneous FOTA does not support rollback - diff --git a/l9/l9_e6/sysbuild/mcuboot/app.overlay b/l9/l9_e6/sysbuild/mcuboot/app.overlay new file mode 100644 index 00000000..74d3dfbf --- /dev/null +++ b/l9/l9_e6/sysbuild/mcuboot/app.overlay @@ -0,0 +1,5 @@ +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/l9/l9_e6/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay b/l9/l9_e6/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay new file mode 100644 index 00000000..dc12b587 --- /dev/null +++ b/l9/l9_e6/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay @@ -0,0 +1,19 @@ +/* + * MCUboot image copy of the nRF52833DK re-partition (Partition Manager disabled). + * + * MCUboot is a separate sysbuild image and reads the flash layout from its own + * devicetree, so it must see the SAME partitions as the application. This file is + * picked up as mcuboot_DTC_OVERLAY_FILE via the sysbuild ".overlay" naming. + * + * In addition to the partition table it selects boot_partition as the code + * partition, because MCUboot itself runs from the boot slot. + */ + +#include "../../../boards/nrf52833dk_nrf52833.overlay" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; + diff --git a/l9/l9_e6/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/l9/l9_e6/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay new file mode 100644 index 00000000..bf60884c --- /dev/null +++ b/l9/l9_e6/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -0,0 +1,38 @@ +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &storage_partition; + +&cpuapp_rram { + partitions { + boot_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(56)>; + }; + + slot0_partition: partition@e000 { + compatible = "zephyr,mapped-partition"; + label = "image-0"; + reg = <0xe000 DT_SIZE_K(220)>; + }; + + slot1_partition: partition@45000 { + compatible = "zephyr,mapped-partition"; + label = "image-1"; + reg = <0x45000 DT_SIZE_K(220)>; + }; + + storage_partition: partition@7c000 { + compatible = "zephyr,mapped-partition"; + label = "storage"; + reg = <0x7c000 DT_SIZE_K(12)>; + }; + }; +}; + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/l9/l9_e6/sysbuild/mcuboot/prj.conf b/l9/l9_e6/sysbuild/mcuboot/prj.conf new file mode 100644 index 00000000..f6b543fb --- /dev/null +++ b/l9/l9_e6/sysbuild/mcuboot/prj.conf @@ -0,0 +1,24 @@ +CONFIG_FPROTECT=n +# MCUboot requires a large stack size, otherwise an MPU fault will occur +CONFIG_MAIN_STACK_SIZE=16384 + +# Enable flash operations +CONFIG_FLASH=y + +CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=y +CONFIG_MULTITHREADING=y + +CONFIG_LOG=y +CONFIG_LOG_MODE_MINIMAL=y +CONFIG_LOG_DEFAULT_LEVEL=0 +CONFIG_MCUBOOT_LOG_LEVEL_INF=y +# Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y +CONFIG_CBPRINTF_NANO=y +# Use minimal C library instead of the Picolib +CONFIG_MINIMAL_LIBC=y + +CONFIG_FW_INFO_FIRMWARE_VERSION=2 + +# NCS boot banner +CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" +CONFIG_LOG=n \ No newline at end of file diff --git a/l9/l9_e6_sol/boards/nrf52833dk_nrf52833.overlay b/l9/l9_e6_sol/boards/nrf52833dk_nrf52833.overlay new file mode 100644 index 00000000..c7c6ba9f --- /dev/null +++ b/l9/l9_e6_sol/boards/nrf52833dk_nrf52833.overlay @@ -0,0 +1,48 @@ +/* + * nRF52833DK flash re-partition (Partition Manager disabled, DTS authoritative). + * + * Change vs. the board default: mcuboot (boot_partition) is 8 KB smaller and the + * application slot (slot0_partition / image-0) is 8 KB bigger. slot0's end address + * is unchanged, so slot1 and storage keep their original addresses. + * + * MCUboot swap-based DFU requires slot0 and slot1 to be equal, so slot1 also grows + * to 228 KB; the extra 8 KB is reclaimed from storage (24 KB -> 16 KB). + * + * boot_partition 0x00000 40 KB (was 48 KB) + * slot0_partition 0x0a000 228 KB (was 220 KB) + * slot1_partition 0x43000 228 KB (was 220 KB) + * storage_partition 0x7c000 16 KB (was 24 KB) + */ + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &storage_partition; + +&flash0 { + partitions { + boot_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(40)>; + }; + + slot0_partition: partition@a000 { + compatible = "zephyr,mapped-partition"; + label = "image-0"; + reg = <0xa000 DT_SIZE_K(228)>; + }; + + slot1_partition: partition@43000 { + compatible = "zephyr,mapped-partition"; + label = "image-1"; + reg = <0x43000 DT_SIZE_K(228)>; + }; + + storage_partition: partition@7c000 { + compatible = "zephyr,mapped-partition"; + label = "storage"; + reg = <0x7c000 DT_SIZE_K(16)>; + }; + }; +}; diff --git a/l9/l9_e6_sol/boards/nrf52dk_nrf52832.overlay b/l9/l9_e6_sol/boards/nrf52dk_nrf52832.overlay new file mode 100644 index 00000000..c7c6ba9f --- /dev/null +++ b/l9/l9_e6_sol/boards/nrf52dk_nrf52832.overlay @@ -0,0 +1,48 @@ +/* + * nRF52833DK flash re-partition (Partition Manager disabled, DTS authoritative). + * + * Change vs. the board default: mcuboot (boot_partition) is 8 KB smaller and the + * application slot (slot0_partition / image-0) is 8 KB bigger. slot0's end address + * is unchanged, so slot1 and storage keep their original addresses. + * + * MCUboot swap-based DFU requires slot0 and slot1 to be equal, so slot1 also grows + * to 228 KB; the extra 8 KB is reclaimed from storage (24 KB -> 16 KB). + * + * boot_partition 0x00000 40 KB (was 48 KB) + * slot0_partition 0x0a000 228 KB (was 220 KB) + * slot1_partition 0x43000 228 KB (was 220 KB) + * storage_partition 0x7c000 16 KB (was 24 KB) + */ + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &storage_partition; + +&flash0 { + partitions { + boot_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(40)>; + }; + + slot0_partition: partition@a000 { + compatible = "zephyr,mapped-partition"; + label = "image-0"; + reg = <0xa000 DT_SIZE_K(228)>; + }; + + slot1_partition: partition@43000 { + compatible = "zephyr,mapped-partition"; + label = "image-1"; + reg = <0x43000 DT_SIZE_K(228)>; + }; + + storage_partition: partition@7c000 { + compatible = "zephyr,mapped-partition"; + label = "storage"; + reg = <0x7c000 DT_SIZE_K(16)>; + }; + }; +}; diff --git a/l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf b/l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf new file mode 100644 index 00000000..abb5a1c1 --- /dev/null +++ b/l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.conf @@ -0,0 +1,4 @@ +CONFIG_CBPRINTF_NANO=y +CONFIG_LOG_MODE_MINIMAL=y +CONFIG_ASSERT=n +CONFIG_BOOT_BANNER=n \ No newline at end of file diff --git a/l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay new file mode 100644 index 00000000..bd3e21b9 --- /dev/null +++ b/l9/l9_e6_sol/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -0,0 +1,32 @@ +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &storage_partition; + +&cpuapp_rram { + partitions { + boot_partition: partition@0 { + compatible = "zephyr,mapped-partition"; + label = "mcuboot"; + reg = <0x0 DT_SIZE_K(56)>; + }; + + slot0_partition: partition@e000 { + compatible = "zephyr,mapped-partition"; + label = "image-0"; + reg = <0xe000 DT_SIZE_K(220)>; + }; + + slot1_partition: partition@45000 { + compatible = "zephyr,mapped-partition"; + label = "image-1"; + reg = <0x45000 DT_SIZE_K(220)>; + }; + + storage_partition: partition@7c000 { + compatible = "zephyr,mapped-partition"; + label = "storage"; + reg = <0x7c000 DT_SIZE_K(12)>; + }; + }; +}; diff --git a/l9/l9_e6_sol/sysbuild.conf b/l9/l9_e6_sol/sysbuild.conf index c4d5b68e..64815bc4 100644 --- a/l9/l9_e6_sol/sysbuild.conf +++ b/l9/l9_e6_sol/sysbuild.conf @@ -1,17 +1,2 @@ -# Step 2.1 Enable MCUboot SB_CONFIG_BOOTLOADER_MCUBOOT=y -# Step 6.3 - Configure project to use external flash for DFU - -# Step 7.2 - Add b0n image - -# Step 7.3 - Set up multiple partitions - -# Step 7.4 - Add support to netcore for DFU - -# Step 7.5 - Add support to mcuboot for updating -# two cores simultaneously - -# Step 7.6 - Simultaneous FOTA does not support rollback - - diff --git a/l9/l9_e6_sol/sysbuild/mcuboot/app.overlay b/l9/l9_e6_sol/sysbuild/mcuboot/app.overlay new file mode 100644 index 00000000..74d3dfbf --- /dev/null +++ b/l9/l9_e6_sol/sysbuild/mcuboot/app.overlay @@ -0,0 +1,5 @@ +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay b/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay new file mode 100644 index 00000000..dc12b587 --- /dev/null +++ b/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52833dk_nrf52833.overlay @@ -0,0 +1,19 @@ +/* + * MCUboot image copy of the nRF52833DK re-partition (Partition Manager disabled). + * + * MCUboot is a separate sysbuild image and reads the flash layout from its own + * devicetree, so it must see the SAME partitions as the application. This file is + * picked up as mcuboot_DTC_OVERLAY_FILE via the sysbuild ".overlay" naming. + * + * In addition to the partition table it selects boot_partition as the code + * partition, because MCUboot itself runs from the boot slot. + */ + +#include "../../../boards/nrf52833dk_nrf52833.overlay" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; + diff --git a/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52dk_nrf52832.overlay b/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52dk_nrf52832.overlay new file mode 100644 index 00000000..706e8b05 --- /dev/null +++ b/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf52dk_nrf52832.overlay @@ -0,0 +1,19 @@ +/* + * MCUboot image copy of the nRF52833DK re-partition (Partition Manager disabled). + * + * MCUboot is a separate sysbuild image and reads the flash layout from its own + * devicetree, so it must see the SAME partitions as the application. This file is + * picked up as mcuboot_DTC_OVERLAY_FILE via the sysbuild ".overlay" naming. + * + * In addition to the partition table it selects boot_partition as the code + * partition, because MCUboot itself runs from the boot slot. + */ + +#include "../../../boards/nrf52dk_nrf52832.overlay" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; + diff --git a/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay b/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay new file mode 100644 index 00000000..d52ec803 --- /dev/null +++ b/l9/l9_e6_sol/sysbuild/mcuboot/boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay @@ -0,0 +1,7 @@ +#include "../../../boards/nrf54ls05dk_nrf54ls05b_cpuapp.overlay" + +/ { + chosen { + zephyr,code-partition = &boot_partition; + }; +}; diff --git a/l9/l9_e6_sol/sysbuild/mcuboot/prj.conf b/l9/l9_e6_sol/sysbuild/mcuboot/prj.conf new file mode 100644 index 00000000..f6b543fb --- /dev/null +++ b/l9/l9_e6_sol/sysbuild/mcuboot/prj.conf @@ -0,0 +1,24 @@ +CONFIG_FPROTECT=n +# MCUboot requires a large stack size, otherwise an MPU fault will occur +CONFIG_MAIN_STACK_SIZE=16384 + +# Enable flash operations +CONFIG_FLASH=y + +CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=y +CONFIG_MULTITHREADING=y + +CONFIG_LOG=y +CONFIG_LOG_MODE_MINIMAL=y +CONFIG_LOG_DEFAULT_LEVEL=0 +CONFIG_MCUBOOT_LOG_LEVEL_INF=y +# Decrease footprint by ~4 KB in comparison to CBPRINTF_COMPLETE=y +CONFIG_CBPRINTF_NANO=y +# Use minimal C library instead of the Picolib +CONFIG_MINIMAL_LIBC=y + +CONFIG_FW_INFO_FIRMWARE_VERSION=2 + +# NCS boot banner +CONFIG_NCS_APPLICATION_BOOT_BANNER_STRING="MCUboot" +CONFIG_LOG=n \ No newline at end of file