From bee0f202eb306ad20b074994eb29b3edad3c52c9 Mon Sep 17 00:00:00 2001 From: Charles Hardin Date: Wed, 12 Mar 2025 20:47:47 -0700 Subject: [PATCH] dts: nucleo_f413zh: add partition support for bootloader Define the partition layout in nucleo_f413zh.dts to handle what can be built in the application directory following the same pattern used in the nucleo_f401re.dts but scaled for 2 sectors of 128KB for the slots. Signed-off-by: Charles Hardin --- boards/st/nucleo_f413zh/nucleo_f413zh.dts | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/boards/st/nucleo_f413zh/nucleo_f413zh.dts b/boards/st/nucleo_f413zh/nucleo_f413zh.dts index 28769998d86..11623e6d3b1 100644 --- a/boards/st/nucleo_f413zh/nucleo_f413zh.dts +++ b/boards/st/nucleo_f413zh/nucleo_f413zh.dts @@ -19,6 +19,7 @@ zephyr,shell-uart = &usart3; zephyr,sram = &sram0; zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; }; leds: leds { @@ -115,6 +116,40 @@ zephyr_udc0: &usbotg_fs { status = "okay"; }; +&flash0 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(64)>; + read-only; + }; + + /* + * The flash starting at offset 0x10000 and ending at + * offset 0x1ffff is reserved for use by the application. + */ + + slot0_partition: partition@20000 { + label = "image-0"; + reg = <0x00020000 DT_SIZE_K(256)>; + }; + + slot1_partition: partition@60000 { + label = "image-1"; + reg = <0x00060000 DT_SIZE_K(256)>; + }; + + scratch_partition: partition@a0000 { + label = "image-scratch"; + reg = <0x000a0000 DT_SIZE_K(128)>; + }; + }; +}; + &timers2 { status = "okay";