Skip to content

Commit 0cd3f56

Browse files
sanpeqfcarlescufi
authored andcommitted
board: add support for VCC-GND STM32H750VB
YD-STM23H750VB board has 128 Kbytes of flash memory, 1 Mbytes of SRAM and 16 Mbytes onboard SPI norflash. Signed-off-by: John Sanpe <sanpeqf@gmail.com>
1 parent 84572a6 commit 0cd3f56

File tree

10 files changed

+372
-0
lines changed

10 files changed

+372
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# YD-STM32H750VB board configuration
2+
3+
# Copyright(c) 2024 John Sanpe <sanpeqf@gmail.com>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if BOARD_YD_STM32H750VB
7+
8+
config DISK_DRIVER_SDMMC
9+
default y if DISK_DRIVERS
10+
11+
endif # BOARD_YD_STM32H750VB
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# YD-STM32H750VB board configuration
2+
3+
# Copyright(c) 2024 John Sanpe <sanpeqf@gmail.com>
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_YD_STM32H750VB
7+
select SOC_STM32H750XX
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
4+
board_runner_args(jlink "--device=STM32H735IG" "--speed=4000")
5+
board_runner_args(openocd --target-handle=_CHIPNAME.cpu0)
6+
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
7+
8+
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
9+
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
10+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
11+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: yd_stm32h750vb
3+
vendor: vcc-gnd
4+
socs:
5+
- name: stm32h750xx
Loading
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
.. _yd_stm32h750vb:
2+
3+
YD-STM32H750VB
4+
##############
5+
6+
Overview
7+
********
8+
9+
The YD-STM32H750VB development board is a complete demonstration and development
10+
platform for Arm |reg| Cortex |reg|-M7 core-based STM32H750VBT6 microcontroller, with
11+
128Kbytes of Flash memory and 1 Mbytes of SRAM.
12+
13+
.. image:: img/yd_stm32h750vb.png
14+
:align: center
15+
:alt: YD-STM32H750VB
16+
17+
More information about STM32H750 can be found here:
18+
19+
- `STM32H750 on www.st.com`_
20+
- `STM32H750xx reference manual`_
21+
- `STM32H750xx datasheet`_
22+
23+
Supported Features
24+
==================
25+
26+
The current Zephyr YD-STM32H750VB board supports the following features:
27+
28+
+-----------+------------+-------------------------------------+
29+
| Interface | Controller | Driver/Component |
30+
+===========+============+=====================================+
31+
| CLOCK | on-chip | reset and clock control |
32+
+-----------+------------+-------------------------------------+
33+
| NVIC | on-chip | nested vector interrupt controller |
34+
+-----------+------------+-------------------------------------+
35+
| UART | on-chip | serial port-polling; |
36+
| | | serial port-interrupt |
37+
+-----------+------------+-------------------------------------+
38+
| PINMUX | on-chip | pinmux |
39+
+-----------+------------+-------------------------------------+
40+
| GPIO | on-chip | gpio |
41+
+-----------+------------+-------------------------------------+
42+
43+
Other hardware features are not yet supported on Zephyr porting.
44+
45+
The default configuration can be found in the defconfig file:
46+
:zephyr_file:`boards/vcc-gnd/yd_stm32h750vb/yd_stm32h750vb_defconfig`
47+
48+
Pin Mapping
49+
===========
50+
51+
Default Zephyr Peripheral Mapping:
52+
----------------------------------
53+
54+
- UART_1_TX : PA9
55+
- UART_1_RX : PA10
56+
- LED_1 : PA13 (SWDIO)
57+
- LED_2 : PA14 (SWCLK)
58+
- LED_3 : PA15
59+
- LED_4 : PB4
60+
- KEY : PB3
61+
62+
System Clock
63+
============
64+
65+
The STM32H750VB System Clock can be driven by an internal or external oscillator,
66+
as well as by the main PLL clock. By default, the System clock
67+
is driven by the PLL clock at 480MHz. PLL clock is feed by a 25MHz high speed external clock.
68+
69+
Flashing
70+
========
71+
72+
There are 2 main entry points for flashing STM32H750VB SoCs, one using the ROM
73+
bootloader, and another by using the SWD debug port (which requires additional
74+
hardware such as ST-Link). Flashing using the ROM bootloader requires a special activation
75+
pattern, which can be triggered by using the BOOT0 button.
76+
77+
Installing dfu-util
78+
-------------------
79+
80+
It is recommended to use at least v0.8 of `dfu-util`_. The package available in
81+
debian/ubuntu can be quite old, so you might have to build dfu-util from source.
82+
83+
There is also a Windows version which works, but you may have to install the
84+
right USB drivers with a tool like `Zadig`_.
85+
86+
Flashing an application to YD-STM32H750VB
87+
-----------------------------------------
88+
89+
Connect a USB-C cable and the board should power ON. Force the board into DFU mode
90+
by keeping the BOOT0 switch pressed while pressing and releasing the RST switch.
91+
92+
The dfu-util runner is supported on this board and so a sample can be built and
93+
tested easily.
94+
95+
Here is an example for the :zephyr:code-sample:`blinky` application.
96+
97+
.. zephyr-app-commands::
98+
:zephyr-app: samples/basic/blinky
99+
:board: yd_stm32h750vb
100+
:goals: build flash
101+
102+
You will see the LED blinking every second.
103+
104+
Debugging
105+
=========
106+
107+
You can debug an application in the usual way. Here is an example for the
108+
:ref:`hello_world` application.
109+
110+
.. zephyr-app-commands::
111+
:zephyr-app: samples/hello_world
112+
:board: yd_stm32h750vb
113+
:goals: debug
114+
115+
References
116+
**********
117+
118+
.. target-notes::
119+
120+
.. _Zadig:
121+
https://zadig.akeo.ie/
122+
123+
.. _dfu-util:
124+
http://dfu-util.sourceforge.net/build.html
125+
126+
.. _STM32H750 on www.st.com:
127+
https://www.st.com/en/microcontrollers-microprocessors/stm32h750-value-line.html
128+
129+
.. _STM32H750xx reference manual:
130+
https://www.st.com/resource/en/reference_manual/rm0433-stm32h742-stm32h743753-and-stm32h750-value-line-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
131+
132+
.. _STM32H750xx datasheet:
133+
https://www.st.com/resource/en/datasheet/stm32h750vb.pdf
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
source [find interface/stlink-dap.cfg]
2+
transport select dapdirect_swd
3+
4+
set WORKAREASIZE 0x2000
5+
set CHIPNAME STM23H750VB
6+
set BOARDNAME YD_STM23H750VB
7+
8+
source [find target/stm32h7x.cfg]
9+
10+
# Use connect_assert_srst here to be able to program
11+
# even when core is in sleep mode
12+
reset_config srst_only srst_nogate connect_assert_srst
13+
14+
$_CHIPNAME.cpu0 configure -event gdb-attach {
15+
echo "Debugger attaching: halting execution"
16+
gdb_breakpoint_override hard
17+
}
18+
19+
$_CHIPNAME.cpu0 configure -event gdb-detach {
20+
echo "Debugger detaching: resuming execution"
21+
resume
22+
}
23+
24+
# Due to the use of connect_assert_srst, running gdb requires
25+
# to reset halt just after openocd init.
26+
rename init old_init
27+
proc init {} {
28+
old_init
29+
reset halt
30+
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
/*
2+
* Copyright(c) 2024 John Sanpe <sanpeqf@gmail.com>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/h7/stm32h750Xb.dtsi>
9+
#include <st/h7/stm32h750vbtx-pinctrl.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "VCC-GND Studio STM32H750VB";
14+
compatible = "st,stm32h750vb";
15+
16+
aliases {
17+
led0 = &yellow_led;
18+
led1 = &blue_led;
19+
sw0 = &user_button;
20+
spi-flash0 = &w25q128jv;
21+
};
22+
23+
chosen {
24+
zephyr,console = &usart1;
25+
zephyr,shell-uart = &usart1;
26+
zephyr,sram = &sram0;
27+
zephyr,flash = &flash0;
28+
zephyr,flash-controller = &w25q128jv;
29+
};
30+
31+
leds {
32+
compatible = "gpio-leds";
33+
red_led: led_1 {
34+
gpios = <&gpioa 13 GPIO_ACTIVE_HIGH>;
35+
label = "LED1";
36+
status = "disabled";
37+
};
38+
green_led: led_2 {
39+
gpios = <&gpioa 14 GPIO_ACTIVE_HIGH>;
40+
label = "LED2";
41+
status = "disabled";
42+
};
43+
yellow_led: led_3 {
44+
gpios = <&gpioa 15 GPIO_ACTIVE_HIGH>;
45+
label = "LED3";
46+
};
47+
blue_led: led_4 {
48+
gpios = <&gpiob 4 GPIO_ACTIVE_HIGH>;
49+
label = "LED4";
50+
};
51+
};
52+
53+
gpio_keys {
54+
compatible = "gpio-keys";
55+
user_button: button {
56+
gpios = <&gpiob 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
57+
zephyr,code = <INPUT_KEY_0>;
58+
label = "USR";
59+
};
60+
};
61+
};
62+
63+
&clk_hse {
64+
clock-frequency = <DT_FREQ_M(25)>;
65+
status = "okay";
66+
};
67+
68+
&clk_lse {
69+
status = "okay";
70+
};
71+
72+
&pll {
73+
div-m = <5>;
74+
mul-n = <192>;
75+
div-p = <2>;
76+
div-q = <4>;
77+
div-r = <4>;
78+
clocks = <&clk_hse>;
79+
status = "okay";
80+
};
81+
82+
&rcc {
83+
clocks = <&pll>;
84+
clock-frequency = <DT_FREQ_M(480)>;
85+
d1cpre = <1>;
86+
hpre = <2>;
87+
d1ppre = <2>;
88+
d2ppre1 = <2>;
89+
d2ppre2 = <2>;
90+
d3ppre = <2>;
91+
};
92+
93+
&usart1 {
94+
pinctrl-names = "default";
95+
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
96+
current-speed = <115200>;
97+
status = "okay";
98+
};
99+
100+
&sdmmc1 {
101+
pinctrl-names = "default";
102+
pinctrl-0 = <&sdmmc1_d0_pc8 &sdmmc1_d1_pc9
103+
&sdmmc1_d2_pc10 &sdmmc1_d3_pc11
104+
&sdmmc1_ck_pc12 &sdmmc1_cmd_pd2>;
105+
cd-gpios = <&gpioa 8 GPIO_ACTIVE_LOW>;
106+
status = "okay";
107+
};
108+
109+
&quadspi {
110+
pinctrl-names = "default";
111+
pinctrl-0 = <&quadspi_clk_pb2 &quadspi_bk1_ncs_pb10
112+
&quadspi_bk1_io0_pd11 &quadspi_bk1_io1_pd12
113+
&quadspi_bk1_io2_pe2 &quadspi_bk1_io3_pd13>;
114+
status = "okay";
115+
116+
w25q128jv: qspi-nor-flash@90000000 {
117+
compatible = "st,stm32-qspi-nor";
118+
reg = <0x90000000 DT_SIZE_M(16)>;
119+
qspi-max-frequency = <80000000>;
120+
spi-bus-width = <4>;
121+
status = "okay";
122+
123+
partitions {
124+
compatible = "fixed-partitions";
125+
#address-cells = <1>;
126+
#size-cells = <1>;
127+
128+
storage_partition: partition@0 {
129+
label = "storage";
130+
reg = <0x0 DT_SIZE_M(16)>;
131+
};
132+
};
133+
};
134+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
identifier: yd_stm32h750vb
2+
name: YD-STM32H750VB
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 1024
10+
flash: 128
11+
supported:
12+
- gpio
13+
- uart
14+
- qspi
15+
vendor: vcc-gnd
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright(c) 2024 John Sanpe <sanpeqf@gmail.com>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Enable the internal SMPS regulator
5+
CONFIG_POWER_SUPPLY_LDO=y
6+
7+
# Enable MPU
8+
CONFIG_ARM_MPU=y
9+
10+
# Enable HW stack protection
11+
CONFIG_HW_STACK_PROTECTION=y
12+
13+
CONFIG_SERIAL=y
14+
15+
# console
16+
CONFIG_CONSOLE=y
17+
CONFIG_UART_CONSOLE=y
18+
19+
# enable GPIO
20+
CONFIG_GPIO=y
21+
22+
# Enable Clocks
23+
CONFIG_CLOCK_CONTROL=y
24+
25+
# enable pin controller
26+
CONFIG_PINCTRL=y

0 commit comments

Comments
 (0)