diff --git a/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts b/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts index d0dd88ca5a16..679b1a8979df 100644 --- a/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts +++ b/boards/st/b_u585i_iot02a/b_u585i_iot02a.dts @@ -65,14 +65,10 @@ slot1_partition: partition@78000 { compatible = "zephyr,mapped-partition"; label = "image-1"; - reg = <0x00078000 DT_SIZE_K(416)>; + reg = <0x00078000 DT_SIZE_K(420)>; }; - scratch_partition: partition@e0000 { - compatible = "zephyr,mapped-partition"; - label = "image-scratch"; - reg = <0x000e0000 DT_SIZE_K(64)>; - }; + /* Unused range [0xe1000..0xeffff] */ storage_partition: partition@f0000 { compatible = "zephyr,mapped-partition"; diff --git a/boards/st/nucleo_f207zg/Kconfig.sysbuild b/boards/st/nucleo_f207zg/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_f207zg/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_f207zg/nucleo_f207zg.dts b/boards/st/nucleo_f207zg/nucleo_f207zg.dts index e267eaba7c04..b7c3dc1d4560 100644 --- a/boards/st/nucleo_f207zg/nucleo_f207zg.dts +++ b/boards/st/nucleo_f207zg/nucleo_f207zg.dts @@ -233,6 +233,7 @@ zephyr_udc0: &usbotg_fs { #size-cells = <1>; ranges; + /* Sectors 0 and 1 (2x16kByte) */ boot_partition: partition@0 { compatible = "zephyr,mapped-partition"; label = "mcuboot"; @@ -241,10 +242,14 @@ zephyr_udc0: &usbotg_fs { }; /* + * Sectors 2 and 3 (2x16kByte) + * * nvs subsystem requires 2 sectors with a max total of 32K * On F2 series, the only option is to use the following * partition, which is compatible with mcuboot usage. - * Keep it commented in order it is not used by CI. + * Keep it commented in order it is not used by CI + * since, when MCUBoot is not embedded, Zephyr image starts + * from flash0 beginning and overlaps storage_partition. * * storage_partition: partition@8000 { * compatible = "zephyr,mapped-partition"; @@ -253,22 +258,27 @@ zephyr_udc0: &usbotg_fs { * }; */ + /* Sector 4 (64kByte): spare/unused */ + + /* Sectors 5 to 7 (3x128kByte) */ slot0_partition: partition@20000 { compatible = "zephyr,mapped-partition"; label = "image-0"; reg = <0x20000 DT_SIZE_K(384)>; }; - slot1_partition: partition@60000 { + /* Sectors 8 to 10 (3x128kByte) */ + slot1_partition: partition@80000 { compatible = "zephyr,mapped-partition"; label = "image-1"; - reg = <0x60000 DT_SIZE_K(384)>; + reg = <0x80000 DT_SIZE_K(384)>; }; - scratch_partition: partiimagtion@c0000 { + /* Sector 11 (128kByte) */ + scratch_partition: partition@e0000 { compatible = "zephyr,mapped-partition"; label = "image-scratch"; - reg = <0xc0000 DT_SIZE_K(128)>; + reg = <0xe0000 DT_SIZE_K(128)>; }; }; }; diff --git a/boards/st/nucleo_f401re/Kconfig.sysbuild b/boards/st/nucleo_f401re/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_f401re/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_f410rb/Kconfig.sysbuild b/boards/st/nucleo_f410rb/Kconfig.sysbuild new file mode 100644 index 000000000000..d1f26f961da0 --- /dev/null +++ b/boards/st/nucleo_f410rb/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_OVERWRITE_ONLY if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_f410rb/nucleo_f410rb.dts b/boards/st/nucleo_f410rb/nucleo_f410rb.dts index 727b9c8a2746..9b2b706c6932 100644 --- a/boards/st/nucleo_f410rb/nucleo_f410rb.dts +++ b/boards/st/nucleo_f410rb/nucleo_f410rb.dts @@ -20,6 +20,7 @@ zephyr,shell-uart = &usart2; zephyr,sram = &sram0; zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; }; leds: leds { @@ -131,6 +132,7 @@ #size-cells = <1>; ranges; + /* Sectors 0 & 1 (2x16kB) */ boot_partition: partition@0 { compatible = "zephyr,mapped-partition"; label = "mcuboot"; @@ -138,30 +140,18 @@ read-only; }; - /* - * The flash sectors 2&3 at 0x00008000 and ending at - * 0x0000ffff - */ + /* Sectors 2 & 3 (2x16kB) */ slot0_partition: partition@8000 { compatible = "zephyr,mapped-partition"; label = "image-0"; reg = <0x00008000 DT_SIZE_K(32)>; }; - /* - * The flash sectors 4 at 0x00010000 and ending at - * 0x001ffff - */ + /* Sectors 4 (only the first 32kB) */ slot1_partition: partition@10000 { compatible = "zephyr,mapped-partition"; label = "image-1"; reg = <0x00010000 DT_SIZE_K(32)>; }; - - scratch_partition: partition@18000 { - compatible = "zephyr,mapped-partition"; - label = "image-scratch"; - reg = <0x00018000 DT_SIZE_K(32)>; - }; }; }; diff --git a/boards/st/nucleo_f413zh/Kconfig.sysbuild b/boards/st/nucleo_f413zh/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_f413zh/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_f429zi/Kconfig.sysbuild b/boards/st/nucleo_f429zi/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_f429zi/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_f446re/Kconfig.sysbuild b/boards/st/nucleo_f446re/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_f446re/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_f446re/nucleo_f446re.dts b/boards/st/nucleo_f446re/nucleo_f446re.dts index ae48e94be17c..af4bbfec8f90 100644 --- a/boards/st/nucleo_f446re/nucleo_f446re.dts +++ b/boards/st/nucleo_f446re/nucleo_f446re.dts @@ -21,6 +21,7 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,canbus = &can2; + zephyr,code-partition = &slot0_partition; }; leds: leds { @@ -173,36 +174,38 @@ #size-cells = <1>; ranges; + /* Sectors 0 and 1 (2x16kByte) */ boot_partition: partition@0 { compatible = "zephyr,mapped-partition"; label = "mcuboot"; - reg = <0x00000000 DT_SIZE_K(64)>; + reg = <0x00000000 DT_SIZE_K(32)>; read-only; }; - /* - * The flash starting at 0x00010000 and ending at - * 0x0001ffff (sectors 16-31) is reserved for use - * by the application. - */ - storage_partition: partition@10000 { + /* Sectors 2 and 3 (2x16kByte) */ + storage_partition: partition@8000 { compatible = "zephyr,mapped-partition"; label = "storage"; - reg = <0x00010000 DT_SIZE_K(64)>; + reg = <0x00008000 DT_SIZE_K(32)>; }; + /* Sector 4 (64kByte): spare/unused */ + + /* Sector 5 (128kByte) */ slot0_partition: partition@20000 { compatible = "zephyr,mapped-partition"; label = "image-0"; reg = <0x00020000 DT_SIZE_K(128)>; }; + /* Sector 6 (128kByte) */ slot1_partition: partition@40000 { compatible = "zephyr,mapped-partition"; label = "image-1"; reg = <0x00040000 DT_SIZE_K(128)>; }; + /* Sector 7 (128kByte) */ scratch_partition: partition@60000 { compatible = "zephyr,mapped-partition"; label = "image-scratch"; diff --git a/boards/st/nucleo_f446ze/Kconfig.sysbuild b/boards/st/nucleo_f446ze/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_f446ze/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_f446ze/nucleo_f446ze.dts b/boards/st/nucleo_f446ze/nucleo_f446ze.dts index 72cc8f063fc6..27c6df197d78 100644 --- a/boards/st/nucleo_f446ze/nucleo_f446ze.dts +++ b/boards/st/nucleo_f446ze/nucleo_f446ze.dts @@ -20,6 +20,7 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,canbus = &can1; + zephyr,code-partition = &slot0_partition; }; leds: leds { @@ -194,36 +195,38 @@ zephyr_udc0: &usbotg_fs { #size-cells = <1>; ranges; + /* Sectors 0 and 1 (2x16kByte) */ boot_partition: partition@0 { compatible = "zephyr,mapped-partition"; label = "mcuboot"; - reg = <0x00000000 DT_SIZE_K(64)>; + reg = <0x00000000 DT_SIZE_K(32)>; read-only; }; - /* - * The flash starting at 0x00010000 and ending at - * 0x0001ffff (sectors 16-31) is reserved for use - * by the application. - */ - storage_partition: partition@10000 { + /* Sectors 2 and 3 (2x16kByte) */ + storage_partition: partition@8000 { compatible = "zephyr,mapped-partition"; label = "storage"; - reg = <0x00010000 DT_SIZE_K(64)>; + reg = <0x00008000 DT_SIZE_K(32)>; }; + /* Sector 4 (64kByte): spare/unused */ + + /* Sector 5 (128kByte) */ slot0_partition: partition@20000 { compatible = "zephyr,mapped-partition"; label = "image-0"; reg = <0x00020000 DT_SIZE_K(128)>; }; + /* Sector 6 (128kByte) */ slot1_partition: partition@40000 { compatible = "zephyr,mapped-partition"; label = "image-1"; reg = <0x00040000 DT_SIZE_K(128)>; }; + /* Sector 7 (128kByte) */ scratch_partition: partition@60000 { compatible = "zephyr,mapped-partition"; label = "image-scratch"; diff --git a/boards/st/nucleo_f746zg/nucleo_f746zg.dts b/boards/st/nucleo_f746zg/nucleo_f746zg.dts index 22a4127ae38b..1b963758826d 100644 --- a/boards/st/nucleo_f746zg/nucleo_f746zg.dts +++ b/boards/st/nucleo_f746zg/nucleo_f746zg.dts @@ -248,35 +248,41 @@ zephyr_udc0: &usbotg_fs { #size-cells = <1>; ranges; - /* set 4* 32KB */ + /* Sectors 0 and 1 (2x32kByte) */ boot_partition: partition@0 { compatible = "zephyr,mapped-partition"; label = "mcuboot"; - reg = <0x00000000 DT_SIZE_K(128)>; + reg = <0x00000000 DT_SIZE_K(64)>; }; - storage_partition: partition@20000 { + /* Sectors 2 and 3 (2x32kByte) */ + storage_partition: partition@10000 { compatible = "zephyr,mapped-partition"; label = "storage"; - reg = <0x00020000 DT_SIZE_K(256)>; + reg = <0x00010000 DT_SIZE_K(64)>; }; - slot0_partition: partition@60000 { + /* Sector 4 (128kByte): spare/unused */ + + /* Sectors 5 (256kByte) */ + slot0_partition: partition@40000 { compatible = "zephyr,mapped-partition"; label = "image-0"; - reg = <0x00060000 DT_SIZE_K(128)>; + reg = <0x00040000 DT_SIZE_K(256)>; }; + /* Sectors 6 (256kByte) */ slot1_partition: partition@80000 { compatible = "zephyr,mapped-partition"; label = "image-1"; - reg = <0x00080000 DT_SIZE_K(128)>; + reg = <0x00080000 DT_SIZE_K(256)>; }; - scratch_partition: partition@a0000 { + /* Sectors 7 (256kByte) */ + scratch_partition: partition@c0000 { compatible = "zephyr,mapped-partition"; label = "image-scratch"; - reg = <0x000a0000 DT_SIZE_K(256)>; + reg = <0x000c0000 DT_SIZE_K(256)>; }; }; }; diff --git a/boards/st/nucleo_f756zg/Kconfig.sysbuild b/boards/st/nucleo_f756zg/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_f756zg/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_h743zi/Kconfig.sysbuild b/boards/st/nucleo_h743zi/Kconfig.sysbuild new file mode 100644 index 000000000000..372e4f605c61 --- /dev/null +++ b/boards/st/nucleo_h743zi/Kconfig.sysbuild @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: Copyright STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + +choice MCUBOOT_MODE + default MCUBOOT_MODE_SWAP_SCRATCH if BOOTLOADER_MCUBOOT +endchoice diff --git a/boards/st/nucleo_h743zi/nucleo_h743zi.dts b/boards/st/nucleo_h743zi/nucleo_h743zi.dts index b8888405d1d4..e554a8d5a8fa 100644 --- a/boards/st/nucleo_h743zi/nucleo_h743zi.dts +++ b/boards/st/nucleo_h743zi/nucleo_h743zi.dts @@ -262,12 +262,18 @@ zephyr_udc0: &usbotg_fs { read-only; }; - /* storage: 128KB for settings */ - storage_partition: partition@20000 { - compatible = "zephyr,mapped-partition"; - label = "storage"; - reg = <0x00020000 DT_SIZE_K(128)>; - }; + /* storage: 128KB for settings + * + * NVS needs at least 2 sectors of 32kB each max + * which does not match H743x internal flash whose + * sectors are all 128kB. + * + * storage_partition: partition@20000 { + * compatible = "zephyr,mapped-partition"; + * label = "storage"; + * reg = <0x00020000 DT_SIZE_K(128)>; + * }; + */ /* application image slot: 256KB */ slot0_partition: partition@40000 { diff --git a/boards/st/sensortile_box/sensortile_box.dts b/boards/st/sensortile_box/sensortile_box.dts index 4100cac89d3c..b18152641d73 100644 --- a/boards/st/sensortile_box/sensortile_box.dts +++ b/boards/st/sensortile_box/sensortile_box.dts @@ -251,10 +251,10 @@ zephyr_udc0: &usbotg_fs { reg = <0x000f8000 DT_SIZE_K(24)>; }; - storage_partition: partition@fc000 { + storage_partition: partition@fe000 { compatible = "zephyr,mapped-partition"; label = "storage"; - reg = <0x000fc000 DT_SIZE_K(24)>; + reg = <0x000fe000 DT_SIZE_K(16)>; }; }; }; diff --git a/boards/st/sensortile_box_pro/sensortile_box_pro.dts b/boards/st/sensortile_box_pro/sensortile_box_pro.dts index e1ec76eea47e..a8bebd676efb 100644 --- a/boards/st/sensortile_box_pro/sensortile_box_pro.dts +++ b/boards/st/sensortile_box_pro/sensortile_box_pro.dts @@ -361,14 +361,10 @@ zephyr_udc0: &usbotg_fs { slot1_partition: partition@78000 { compatible = "zephyr,mapped-partition"; label = "image-1"; - reg = <0x00078000 DT_SIZE_K(416)>; + reg = <0x00078000 DT_SIZE_K(424)>; }; - scratch_partition: partition@e0000 { - compatible = "zephyr,mapped-partition"; - label = "image-scratch"; - reg = <0x000e0000 DT_SIZE_K(64)>; - }; + /* Range [0xe2000..0xf0000] is unused. */ storage_partition: partition@f0000 { compatible = "zephyr,mapped-partition"; diff --git a/boards/st/steval_stwinbx1/steval_stwinbx1.dts b/boards/st/steval_stwinbx1/steval_stwinbx1.dts index 5610e46710e5..4f6f3b3f8a79 100644 --- a/boards/st/steval_stwinbx1/steval_stwinbx1.dts +++ b/boards/st/steval_stwinbx1/steval_stwinbx1.dts @@ -330,14 +330,10 @@ zephyr_udc0: &usbotg_fs { slot1_partition: partition@78000 { compatible = "zephyr,mapped-partition"; label = "image-1"; - reg = <0x00078000 DT_SIZE_K(416)>; + reg = <0x00078000 DT_SIZE_K(424)>; }; - scratch_partition: partition@e0000 { - compatible = "zephyr,mapped-partition"; - label = "image-scratch"; - reg = <0x000e0000 DT_SIZE_K(64)>; - }; + /* Range [0xe2000..0xf0000] is unused. */ storage_partition: partition@f0000 { compatible = "zephyr,mapped-partition"; diff --git a/boards/st/stm32f0_disco/stm32f0_disco.dts b/boards/st/stm32f0_disco/stm32f0_disco.dts index a6f8be614237..2cd240778a64 100644 --- a/boards/st/stm32f0_disco/stm32f0_disco.dts +++ b/boards/st/stm32f0_disco/stm32f0_disco.dts @@ -120,27 +120,20 @@ read-only; }; - /* - * The flash starting at offset 0x2000 and ending at - * offset 0x3fff is reserved for use by the application. - */ - - slot0_partition: partition@4000 { - compatible = "zephyr,mapped-partition"; + slot0_partition: partition@2000 { label = "image-0"; - reg = <0x00004000 DT_SIZE_K(16)>; + reg = <0x00002000 DT_SIZE_K(20)>; }; slot1_partition: partition@8000 { compatible = "zephyr,mapped-partition"; label = "image-1"; - reg = <0x00008000 DT_SIZE_K(16)>; + reg = <0x00008000 DT_SIZE_K(24)>; }; - scratch_partition: partition@c000 { - compatible = "zephyr,mapped-partition"; - label = "image-scratch"; - reg = <0x0000c000 DT_SIZE_K(16)>; + storage_partition: partition@e000 { + label = "storage"; + reg = <0x0000e000 DT_SIZE_K(12)>; }; }; }; diff --git a/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts b/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts index cb23d1ab2de2..4b098093b31a 100644 --- a/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts +++ b/boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts @@ -160,14 +160,10 @@ zephyr_udc0: &usb { slot1_partition: partition@70000 { compatible = "zephyr,mapped-partition"; label = "image-1"; - reg = <0x00070000 DT_SIZE_K(400)>; + reg = <0x00070000 DT_SIZE_K(404)>; }; - scratch_partition: partition@d4000 { - compatible = "zephyr,mapped-partition"; - label = "image-scratch"; - reg = <0x000d4000 DT_SIZE_K(16)>; - }; + /* Area [0xd5000..0xd7fff] is unused */ storage_partition: partition@d8000 { compatible = "zephyr,mapped-partition"; diff --git a/boards/st/stm32wb5mmg/stm32wb5mmg.dts b/boards/st/stm32wb5mmg/stm32wb5mmg.dts index d5b37b27c9d2..c7415c95ee1d 100644 --- a/boards/st/stm32wb5mmg/stm32wb5mmg.dts +++ b/boards/st/stm32wb5mmg/stm32wb5mmg.dts @@ -104,5 +104,10 @@ zephyr_udc0: &usb { label = "image-0"; reg = <0x0000c000 DT_SIZE_K(400)>; }; + + slot1_partition: partition@70000 { + label = "image-1"; + reg = <0x0070000 DT_SIZE_K(404)>; + }; }; }; diff --git a/samples/subsys/fs/littlefs/boards/nucleo_h743zi.overlay b/samples/subsys/fs/littlefs/boards/nucleo_h743zi.overlay index 8f22354d6c90..5bcc334c90cc 100644 --- a/samples/subsys/fs/littlefs/boards/nucleo_h743zi.overlay +++ b/samples/subsys/fs/littlefs/boards/nucleo_h743zi.overlay @@ -4,7 +4,6 @@ * * SPDX-License-Identifier: Apache-2.0 */ -/delete-node/ &storage_partition; &sdmmc1 { status = "okay";