Skip to content

Commit 2d5937f

Browse files
committed
boards: arm: stm32h7s78 disco kit supporting xspi instance
Add the XSPI 2 which is an octoSPI connection to a octo NOR flash mx66uw1g45 on the stm32h7s78_dk disco kit Use the STM32Cube programmer to flash with the corresponding external loader for XiP mode. Signed-off-by: Francois Ramu <[email protected]>
1 parent 5dbe6fb commit 2d5937f

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-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,7 @@
1919
zephyr,shell-uart = &uart4;
2020
zephyr,flash = &flash0;
2121
zephyr,sram = &sram0;
22+
zephyr,flash-controller = &mx66uw1g45;
2223
};
2324

2425
leds {
@@ -57,6 +58,7 @@
5758
die-temp0 = &die_temp;
5859
volt-sensor0 = &vref;
5960
volt-sensor1 = &vbat;
61+
spi-flash0 = &mx66uw1g45;
6062
};
6163
};
6264

@@ -173,6 +175,64 @@
173175
pinctrl-names = "default";
174176
};
175177

178+
&flash0 {
179+
partitions {
180+
compatible = "fixed-partitions";
181+
#address-cells = <1>;
182+
#size-cells = <1>;
183+
184+
/* Set the partitions with first MB to make use of the whole Bank1 */
185+
boot_partition: partition@0 {
186+
label = "mcuboot";
187+
reg = <0x00000000 DT_SIZE_K(64)>;
188+
};
189+
};
190+
};
191+
192+
&xspi2 {
193+
pinctrl-0 = <&xspim_p2_clk_pn6 &xspim_p2_ncs1_pn1
194+
&xspim_p2_io0_pn2 &xspim_p2_io1_pn3
195+
&xspim_p2_io2_pn4 &xspim_p2_io3_pn5
196+
&xspim_p2_io4_pn8 &xspim_p2_io5_pn9
197+
&xspim_p2_io6_pn10 &xspim_p2_io7_pn11
198+
&xspim_p2_dqs0_pn0>;
199+
pinctrl-names = "default";
200+
201+
status = "okay";
202+
203+
mx66uw1g45: xspi-nor-flash@70000000 {
204+
compatible = "st,stm32-xspi-nor";
205+
reg = <0x70000000 DT_SIZE_M(128)>; /* 1 Gbits */
206+
ospi-max-frequency = <DT_FREQ_M(50)>;
207+
spi-bus-width = <XSPI_OCTO_MODE>;
208+
data-rate = <XSPI_DTR_TRANSFER>;
209+
status = "okay";
210+
211+
partitions {
212+
compatible = "fixed-partitions";
213+
#address-cells = <1>;
214+
#size-cells = <1>;
215+
216+
slot0_partition: partition@0 {
217+
label = "image-0";
218+
reg = <0x00000000 DT_SIZE_K(512)>;
219+
};
220+
slot1_partition: partition@80000 {
221+
label = "image-1";
222+
reg = <0x0080000 DT_SIZE_K(512)>;
223+
};
224+
scratch_partition: partition@100000 {
225+
label = "image-scratch";
226+
reg = <0x00100000 DT_SIZE_K(64)>;
227+
};
228+
storage_partition: partition@110000 {
229+
label = "storage";
230+
reg = <0x00110000 DT_SIZE_K(64)>;
231+
};
232+
};
233+
};
234+
};
235+
176236
&die_temp {
177237
status = "okay";
178238
};

boards/st/stm32h7s78_dk/stm32h7s78_dk.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ supported:
1515
- adc
1616
- usb_device
1717
- usbd
18+
- octospi
1819
vendor: st

0 commit comments

Comments
 (0)