Skip to content

Commit 42ec0f0

Browse files
committed
boards: st: stm32h573i_dk: introduce soc-nv-flash node
Introduce a 'soc-nv-flash' node in the stm32h573i_dk board DTS file to define the external Flash memory parameters used for MCUBoot integration. This way BOOT_MAX_IMG_SECTORS_AUTO can be used to automatically calculate the maximum number of image sectors based on the actual external Flash configuration. Signed-off-by: Tim Pambor <[email protected]>
1 parent cefc5bc commit 42ec0f0

File tree

4 files changed

+38
-9
lines changed

4 files changed

+38
-9
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
choice BOOTLOADER
5+
default BOOTLOADER_MCUBOOT
6+
endchoice
7+
8+
choice BOOT_SIGNATURE_TYPE
9+
default BOOT_SIGNATURE_TYPE_NONE
10+
endchoice
11+
12+
if BOARD_STM32H573I_DK_STM32H573XX_EXT_FLASH_APP
13+
14+
choice MCUBOOT_MODE
15+
default MCUBOOT_MODE_DIRECT_XIP
16+
endchoice
17+
18+
endif # BOARD_STM32H573I_DK_STM32H573XX_EXT_FLASH_APP

boards/st/stm32h573i_dk/stm32h573i_dk-common.dtsi

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@
7676
volt-sensor1 = &vbat;
7777
};
7878

79-
ext_memory: memory@90000000 {
79+
ext_flash_mem: memory@90000000 {
8080
compatible = "zephyr,memory-region";
8181
reg = <0x90000000 DT_SIZE_M(64)>;
82-
zephyr,memory-region = "EXTMEM";
83-
/* The ATTR_MPU_EXTMEM attribut causing a MPU FAULT */
84-
zephyr,memory-attr = <DT_MEM_ARM(ATTR_MPU_IO)>;
82+
zephyr,memory-region = "EXT_FLASH";
83+
/* DT_MEM_ARM_MPU_EXTMEM and DT_MEM_ARM_MPU_FLASH cause MPU issues */
84+
zephyr,memory-attr = <DT_MEM_ARM_MPU_IO>;
8585
};
8686

8787
lvgl_pointer {
@@ -354,7 +354,7 @@
354354

355355
status = "okay";
356356

357-
mx25lm51245: ospi-nor-flash@0 {
357+
ext_flash_ctrl: xspi-flash-controller@0 {
358358
compatible = "st,stm32-xspi-nor";
359359
reg = <0>;
360360
size = <DT_SIZE_M(512)>; /* 512 Mbits */
@@ -363,6 +363,17 @@
363363
data-rate = <XSPI_DTR_TRANSFER>;
364364
four-byte-opcodes;
365365
status = "okay";
366+
367+
#address-cells = <1>;
368+
#size-cells = <1>;
369+
ranges = <0x0 0x90000000 DT_SIZE_M(64)>; /* Ext Flash mem-mapped to 0x90000000 */
370+
371+
ext_flash: mx25lm51245: ext-flash@0 {
372+
compatible = "soc-nv-flash";
373+
reg = <0x0 DT_SIZE_M(64)>;
374+
write-block-size = <1>;
375+
erase-block-size = <DT_SIZE_K(64)>;
376+
};
366377
};
367378
};
368379

boards/st/stm32h573i_dk/stm32h573i_dk.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
};
4949
};
5050

51-
&mx25lm51245 {
51+
&ext_flash {
5252
partitions {
5353
compatible = "fixed-partitions";
5454
#address-cells = <1>;

boards/st/stm32h573i_dk/stm32h573i_dk_stm32h573xx_ext_flash_app.dts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
compatible = "st,stm32h573i-dk";
1313

1414
chosen {
15-
zephyr,flash = &mx25lm51245;
16-
zephyr,flash-controller = &mx25lm51245;
15+
zephyr,flash = &ext_flash;
16+
zephyr,flash-controller = &ext_flash_ctrl;
1717
zephyr,code-partition = &slot0_partition;
1818
};
1919
};
@@ -37,7 +37,7 @@
3737
};
3838
};
3939

40-
&mx25lm51245 {
40+
&ext_flash {
4141
partitions {
4242
compatible = "fixed-partitions";
4343
#address-cells = <1>;

0 commit comments

Comments
 (0)