From 8fd756bc08589970c11780ab31444b3f905c0ff4 Mon Sep 17 00:00:00 2001 From: "Hudson C. Dalpra" Date: Thu, 11 Apr 2024 21:28:21 +1200 Subject: [PATCH] boards: stm: nucleo_g4xx: added flash partitions to work with mcuboot Added code partitioning for ST Nucleo G431RB and G474RE boards. Defined flash partitions including "mcuboot," "image-0," and "image-1". Signed-off-by: Hudson C. Dalpra --- boards/st/nucleo_g431rb/nucleo_g431rb.dts | 14 ++++++++++++++ boards/st/nucleo_g474re/nucleo_g474re.dts | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/boards/st/nucleo_g431rb/nucleo_g431rb.dts b/boards/st/nucleo_g431rb/nucleo_g431rb.dts index 9303087c1d..8984d9d029 100644 --- a/boards/st/nucleo_g431rb/nucleo_g431rb.dts +++ b/boards/st/nucleo_g431rb/nucleo_g431rb.dts @@ -20,6 +20,7 @@ zephyr,shell-uart = &lpuart1; zephyr,sram = &sram0; zephyr,flash = &flash0; + zephyr,code-partition = &slot0_partition; }; leds: leds { @@ -49,6 +50,7 @@ aliases { led0 = &green_led; + mcuboot-led0 = &green_led; pwm-led0 = &green_pwm_led; sw0 = &user_button; watchdog0 = &iwdg; @@ -167,6 +169,18 @@ stm32_lp_tick_source: &lptim1 { #address-cells = <1>; #size-cells = <1>; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(34)>; + }; + slot0_partition: partition@8800 { + label = "image-0"; + reg = <0x00008800 DT_SIZE_K(48)>; + }; + slot1_partition: partition@14800 { + label = "image-1"; + reg = <0x00014800 DT_SIZE_K(42)>; + }; /* Set 4Kb of storage at the end of the 128Kb of flash */ storage_partition: partition@1f000 { label = "storage"; diff --git a/boards/st/nucleo_g474re/nucleo_g474re.dts b/boards/st/nucleo_g474re/nucleo_g474re.dts index 8a87f6e0d0..74b0308d70 100644 --- a/boards/st/nucleo_g474re/nucleo_g474re.dts +++ b/boards/st/nucleo_g474re/nucleo_g474re.dts @@ -20,6 +20,7 @@ zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,canbus = &fdcan1; + zephyr,code-partition = &slot0_partition; }; leds: leds { @@ -49,6 +50,7 @@ aliases { led0 = &green_led; + mcuboot-led0 = &green_led; pwm-led0 = &green_pwm_led; sw0 = &user_button; watchdog0 = &iwdg; @@ -170,6 +172,18 @@ stm32_lp_tick_source: &lptim1 { #address-cells = <1>; #size-cells = <1>; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(34)>; + }; + slot0_partition: partition@8800 { + label = "image-0"; + reg = <0x00008800 DT_SIZE_K(240)>; + }; + slot1_partition: partition@44800 { + label = "image-1"; + reg = <0x00044800 DT_SIZE_K(234)>; + }; /* Set 4Kb of storage at the end of the 512Kb of flash */ storage_partition: partition@7f000 { label = "storage";