Skip to content

Commit f3bed11

Browse files
committed
boards: stm32h7s78-dk: add memory partitions for mcuboot
Add memory partitions for mcuboot and storage Also add config to program external XSPI Flash Signed-off-by: Abderrahmane JARMOUNI <[email protected]>
1 parent 5b39156 commit f3bed11

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

boards/st/stm32h7s78_dk/board.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
# keep first
4+
if(CONFIG_STM32_MEMMAP)
45
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
6+
board_runner_args(stm32cubeprogrammer "--extload=MX66UW1G45G_STM32H7S78-DK.stldr")
7+
else()
8+
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
9+
endif()
10+
511
board_runner_args(openocd --target-handle=_CHIPNAME.cpu0)
612

713
# keep first

boards/st/stm32h7s78_dk/stm32h7s78_dk.dts

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
zephyr,shell-uart = &uart4;
2020
zephyr,flash = &flash0;
2121
zephyr,sram = &sram0;
22+
zephyr,flash-controller = &mx66uw1g45;
23+
zephyr,code-partition = &slot0_partition;
2224
};
2325

2426
leds {
@@ -97,6 +99,18 @@
9799
ppre5 = <2>;
98100
};
99101

102+
&flash0 {
103+
partitions {
104+
compatible = "fixed-partitions";
105+
#address-cells = <1>;
106+
#size-cells = <1>;
107+
boot_partition: partition@0 {
108+
label = "mcuboot";
109+
reg = <0x00000000 DT_SIZE_K(64)>;
110+
};
111+
};
112+
};
113+
100114
&uart4 {
101115
pinctrl-0 = <&uart4_tx_pd1 &uart4_rx_pd0>;
102116
pinctrl-names = "default";
@@ -173,6 +187,52 @@
173187
pinctrl-names = "default";
174188
};
175189

190+
&xspi1 {
191+
/* same pins as xspi2 */
192+
pinctrl-0 = <&xspim_p2_clk_pn6 &xspim_p2_ncs1_pn1
193+
&xspim_p2_io0_pn2 &xspim_p2_io1_pn3
194+
&xspim_p2_io2_pn4 &xspim_p2_io3_pn5
195+
&xspim_p2_io4_pn8 &xspim_p2_io5_pn9
196+
&xspim_p2_io6_pn10 &xspim_p2_io7_pn11
197+
&xspim_p2_dqs0_pn0>;
198+
pinctrl-names = "default";
199+
200+
status = "okay";
201+
202+
mx66uw1g45: xspi-nor-flash@72000000 {
203+
compatible = "st,stm32-xspi-nor";
204+
reg = <0x72000000 DT_SIZE_M(96)>; /* bank1 - 3*/
205+
ospi-max-frequency = <DT_FREQ_M(50)>;
206+
spi-bus-width = <XSPI_OCTO_MODE>;
207+
data-rate = <XSPI_DTR_TRANSFER>;
208+
status = "okay";
209+
210+
partitions {
211+
compatible = "fixed-partitions";
212+
#address-cells = <1>;
213+
#size-cells = <1>;
214+
215+
/* bank1 */
216+
slot0_partition: partition@0000000 {
217+
label = "image-0";
218+
reg = <0x0000000 DT_SIZE_K(2048)>;
219+
};
220+
221+
/* bank2 */
222+
slot1_partition: partition@2000000 {
223+
label = "image-1";
224+
reg = <0x2000000 DT_SIZE_K(2048)>;
225+
};
226+
227+
/* bank3 */
228+
storage_partition: partition@4000000 {
229+
label = "storage";
230+
reg = <0x4000000 DT_SIZE_K(128)>;
231+
};
232+
};
233+
};
234+
};
235+
176236
&die_temp {
177237
status = "okay";
178238
};

boards/st/stm32h7s78_dk/stm32h7s78_dk.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ supported:
1313
- watchdog
1414
- entropy
1515
- adc
16+
- spi
17+
- octospi
1618
vendor: st

0 commit comments

Comments
 (0)