From 3583492890ca06d6751a8a80e616a2ea8259e6d2 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Wed, 13 Nov 2024 16:49:00 +0100 Subject: [PATCH] boards: st: nucleo_f429zi: Rework flash partition STM32F4 series flash layout is as follows: {.pages_count = 4, .pages_size = KB(16)}, {.pages_count = 1, .pages_size = KB(64)}, {.pages_count = 7, .pages_size = KB(128)} Since NVS subsys requires 2 sectors of max 32K in total, provide a flash partition which respects this constraint using 2 of the 16K sectors in the beginning of the layout. Provide a compatible flash partition usable with mcuboot, but keep the storage partition commented as its usage is not compatible with use w/o mcuboot enabled (in this case main image starts as offset 0 which conflicts with storage partition). Note that it isn't possible either to get main image starting directly in the 128K sectors w/o bootloader as boot flash address can't be configured. Signed-off-by: Erwan Gouriou --- boards/st/nucleo_f429zi/nucleo_f429zi.dts | 20 +++++++++++++------- boards/st/nucleo_f429zi/nucleo_f429zi.yaml | 1 - 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/boards/st/nucleo_f429zi/nucleo_f429zi.dts b/boards/st/nucleo_f429zi/nucleo_f429zi.dts index 2e37e448655..29a36b11555 100644 --- a/boards/st/nucleo_f429zi/nucleo_f429zi.dts +++ b/boards/st/nucleo_f429zi/nucleo_f429zi.dts @@ -194,18 +194,24 @@ zephyr_udc0: &usbotg_fs { #address-cells = <1>; #size-cells = <1>; - /* 64KB for bootloader */ + /* 32KB for bootloader */ boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 DT_SIZE_K(64)>; + reg = <0x00000000 DT_SIZE_K(32)>; read-only; }; - /* storage: 64KB for settings */ - storage_partition: partition@10000 { - label = "storage"; - reg = <0x00010000 DT_SIZE_K(64)>; - }; + /* + * nvs subsystem requires 2 sectors with a max total of 32K + * On F4 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. + * + * storage_partition: partition@8000 { + * label = "storage"; + * reg = <0x0008000 DT_SIZE_K(32)>; + * }; + */ /* application image slot: 256KB */ slot0_partition: partition@20000 { diff --git a/boards/st/nucleo_f429zi/nucleo_f429zi.yaml b/boards/st/nucleo_f429zi/nucleo_f429zi.yaml index 8674acc45c8..bec17951950 100644 --- a/boards/st/nucleo_f429zi/nucleo_f429zi.yaml +++ b/boards/st/nucleo_f429zi/nucleo_f429zi.yaml @@ -23,7 +23,6 @@ supported: - adc - dac - dma - - nvs - rtc - usbd vendor: st