Skip to content

Commit 7f4c078

Browse files
committed
boards: st: stm32h7s3l8 nucleo board supporting xspi instance
Add the XSPI 2 which is an octoSPI connection to a octo NOR flash MX25UW25645GXDI00 (256 Mbits, 1.8 V, 200 MHz, DTR, rww) on the nucleo_h7s3l8 board. Use the STM32Cube programmer to flash with the corresponding external loader for XiP mode. Signed-off-by: Francois Ramu <[email protected]>
1 parent 0685e2a commit 7f4c078

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

boards/st/nucleo_h7s3l8/board.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
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=MX25UW25645G_NUCLEO-H7S3L8.stldr")
7+
else()
8+
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw" )
9+
endif()
510

611
board_runner_args(openocd --target-handle=_CHIPNAME.cpu0)
712

boards/st/nucleo_h7s3l8/nucleo_h7s3l8.dts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
zephyr,dtcm = &dtcm;
2121
zephyr,sram = &sram0;
2222
zephyr,flash = &flash0;
23+
zephyr,flash-controller = &mx25uw25645;
2324
};
2425

2526
leds: leds {
@@ -53,6 +54,7 @@
5354
led2 = &red_led;
5455
sw0 = &user_button;
5556
watchdog0 = &iwdg;
57+
spi-flash0 = &mx25uw25645;
5658
};
5759
};
5860

@@ -85,6 +87,19 @@
8587
status = "okay";
8688
};
8789

90+
/* PLL2 for clocking the xspi peripheral */
91+
&pll2 {
92+
div-m = <12>;
93+
mul-n = <200>;
94+
div-p = <2>;
95+
div-q = <2>;
96+
div-r = <2>;
97+
div-s = <2>;
98+
div-t = <2>;
99+
clocks = <&clk_hse>;
100+
status = "okay";
101+
};
102+
88103
&rcc {
89104
clocks = <&pll>;
90105
clock-frequency = <DT_FREQ_M(200)>;
@@ -139,3 +154,61 @@
139154
status = "okay";
140155
clock-frequency = <I2C_BITRATE_FAST>;
141156
};
157+
158+
&flash0 {
159+
partitions {
160+
compatible = "fixed-partitions";
161+
#address-cells = <1>;
162+
#size-cells = <1>;
163+
164+
/* Set the partitions with first MB to make use of the whole Bank1 */
165+
boot_partition: partition@0 {
166+
label = "mcuboot";
167+
reg = <0x00000000 DT_SIZE_K(64)>;
168+
};
169+
};
170+
};
171+
172+
&xspi2 {
173+
pinctrl-0 = <&xspim_p2_clk_pn6 &xspim_p2_ncs1_pn1
174+
&xspim_p2_io0_pn2 &xspim_p2_io1_pn3
175+
&xspim_p2_io2_pn4 &xspim_p2_io3_pn5
176+
&xspim_p2_io4_pn8 &xspim_p2_io5_pn9
177+
&xspim_p2_io6_pn10 &xspim_p2_io7_pn11
178+
&xspim_p2_dqs0_pn0>;
179+
pinctrl-names = "default";
180+
181+
status = "okay";
182+
183+
mx25uw25645: xspi-nor-flash@70000000 {
184+
compatible = "st,stm32-xspi-nor";
185+
reg = <0x70000000 DT_SIZE_M(32)>; /* 256Mbits */
186+
ospi-max-frequency = <DT_FREQ_M(50)>;
187+
spi-bus-width = <XSPI_OCTO_MODE>;
188+
data-rate = <XSPI_DTR_TRANSFER>;
189+
status = "okay";
190+
191+
partitions {
192+
compatible = "fixed-partitions";
193+
#address-cells = <1>;
194+
#size-cells = <1>;
195+
196+
slot0_partition: partition@0 {
197+
label = "image-0";
198+
reg = <0x00000000 DT_SIZE_K(512)>;
199+
};
200+
slot1_partition: partition@80000 {
201+
label = "image-1";
202+
reg = <0x0080000 DT_SIZE_K(512)>;
203+
};
204+
scratch_partition: partition@100000 {
205+
label = "image-scratch";
206+
reg = <0x00100000 DT_SIZE_K(64)>;
207+
};
208+
storage_partition: partition@110000 {
209+
label = "storage";
210+
reg = <0x00110000 DT_SIZE_K(64)>;
211+
};
212+
};
213+
};
214+
};

boards/st/nucleo_h7s3l8/nucleo_h7s3l8.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ supported:
1212
- watchdog
1313
- entropy
1414
- adc
15+
- octospi
1516
vendor: st

0 commit comments

Comments
 (0)