Skip to content

Commit b5e9dae

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 9556982 commit b5e9dae

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
@@ -57,6 +57,7 @@
5757
die-temp0 = &die_temp;
5858
volt-sensor0 = &vref;
5959
volt-sensor1 = &vbat;
60+
spi-flash0 = &mx66uw1g45;
6061
};
6162
};
6263

@@ -173,6 +174,65 @@
173174
pinctrl-names = "default";
174175
};
175176

177+
&flash0 {
178+
partitions {
179+
compatible = "fixed-partitions";
180+
#address-cells = <1>;
181+
#size-cells = <1>;
182+
183+
/* Set the partitions with first MB to make use of the whole Bank1 */
184+
boot_partition: partition@0 {
185+
label = "mcuboot";
186+
reg = <0x00000000 DT_SIZE_K(64)>;
187+
};
188+
};
189+
};
190+
191+
&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@0 {
203+
compatible = "st,stm32-xspi-nor";
204+
reg = <0>;
205+
size = <DT_SIZE_M(1024)>; /* 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)