Skip to content

Commit 6a23213

Browse files
committed
boards: weact: blackpill_h523ce: Add board support
This adds support for the WeAct blackpill_h523ce board. Signed-off-by: Filip Stojanovic <[email protected]>
1 parent 322da1d commit 6a23213

File tree

8 files changed

+315
-0
lines changed

8 files changed

+315
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright(c) 2025 Filip Stojanovic
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_BLACKPILL_H523CE
5+
select SOC_STM32H533XX
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright(c) 2025 Filip Stojanovic <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
#Enable MPU
5+
CONFIG_ARM_MPU=y
6+
7+
#Enable HW stack protection
8+
CONFIG_HW_STACK_PROTECTION=y
9+
10+
#Serial drivers
11+
CONFIG_SERIAL=y
12+
CONFIG_CONSOLE=y
13+
CONFIG_UART_CONSOLE=y
14+
15+
#Enable GPIO
16+
CONFIG_GPIO=y
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
* Copyright (c) 2025 Filip Stojanovic <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/h5/stm32h533Xe.dtsi>
9+
#include <st/h5/stm32h533retx-pinctrl.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "WeAct Studio Black Pill STM32H523 Board";
14+
compatible = "weact,blackpill-h523ce";
15+
16+
chosen {
17+
zephyr,console = &usart1;
18+
zephyr,shell-uart = &usart1;
19+
zephyr,sram = &sram1;
20+
zephyr,flash = &flash0;
21+
};
22+
23+
leds {
24+
compatible = "gpio-leds";
25+
26+
user_led: led {
27+
gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
28+
label = "User LED";
29+
};
30+
};
31+
32+
gpio_keys {
33+
compatible = "gpio-keys";
34+
35+
user_button: button {
36+
label = "KEY";
37+
gpios = <&gpioa 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
38+
zephyr,code = <INPUT_KEY_0>;
39+
};
40+
};
41+
42+
aliases {
43+
led0 = &user_led;
44+
sw0 = &user_button;
45+
volt-sensor0 = &vref;
46+
volt-sensor1 = &vbat;
47+
};
48+
};
49+
50+
&timers3 {
51+
status = "okay";
52+
st, prescaler = <1000>;
53+
54+
pwm3: pwm {
55+
status = "okay";
56+
pinctrl-0 = <&tim3_ch3_pb0 &tim3_ch4_pb1>;
57+
pinctrl-names = "default";
58+
};
59+
};
60+
61+
&usart1 {
62+
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
63+
pinctrl-names = "default";
64+
status = "okay";
65+
current-speed = <115200>;
66+
};
67+
68+
&i2c1 {
69+
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
70+
pinctrl-names = "default";
71+
status = "okay";
72+
clock-frequency = <I2C_BITRATE_FAST>;
73+
};
74+
75+
&spi1 {
76+
pinctrl-0 = <&spi1_sck_pa5 &spi1_nss_pa4 &spi1_miso_pa6 &spi1_mosi_pa7>;
77+
pinctrl-names = "default";
78+
status = "okay";
79+
};
80+
81+
&rtc {
82+
clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00200000>, <&rcc STM32_SRC_LSE RTC_SEL(1)>;
83+
status = "okay";
84+
};
85+
86+
zephyr_udc0: &usb {
87+
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
88+
pinctrl-names = "default";
89+
status = "okay";
90+
};
91+
92+
&adc1 {
93+
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000400>, <&rcc STM32_SRC_HCLK ADCDAC_SEL(0)>;
94+
pinctrl-0 = <&adc1_inp1_pa1>;
95+
pinctrl-names = "default";
96+
st,adc-clock - source = "ASYNC";
97+
st,adc-prescaler = <8>;
98+
status = "okay";
99+
};
100+
101+
&clk_lsi {
102+
status = "okay";
103+
};
104+
105+
&clk_lse {
106+
status = "okay";
107+
};
108+
109+
&clk_hsi {
110+
status = "okay";
111+
};
112+
113+
&clk_hsi48 {
114+
status = "okay";
115+
};
116+
117+
&clk_hse {
118+
status = "okay";
119+
clock-frequency = <DT_FREQ_M(8)>;
120+
};
121+
122+
&rcc {
123+
clocks = <&pll>;
124+
clock-frequency = <DT_FREQ_M(240)>;
125+
ahb-prescaler = <1>;
126+
apb1-prescaler = <1>;
127+
apb2-prescaler = <1>;
128+
apb3-prescaler = <1>;
129+
};
130+
131+
&pll {
132+
div-m = <1>;
133+
mul-n = <60>;
134+
div-p = <2>;
135+
div-q = <2>;
136+
div-r = <2>;
137+
clocks = <&clk_hse>;
138+
status = "okay";
139+
};
140+
141+
&vref {
142+
status = "okay";
143+
};
144+
145+
&vbat {
146+
status = "okay";
147+
};
148+
149+
&iwdg {
150+
status = "okay";
151+
};
152+
153+
&rng {
154+
status = "okay";
155+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
identifier: blackpill_h523ce
2+
name: WeAct Studio Black Pill STM32H523
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 274
9+
flash: 512
10+
supported:
11+
- gpio
12+
- counter
13+
- spi
14+
- i2c
15+
- uart
16+
- pwm
17+
- adc
18+
vendor: weact
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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=STM32H523CE" "--speed=4000")
5+
6+
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
7+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
8+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
9+
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: blackpill_h523ce
3+
full_name: Black Pill STM32H523
4+
vendor: weact
5+
socs:
6+
- name: stm32h533xx
Binary file not shown.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
.. zephyr:board:: blackpill_h523ce
2+
3+
Overview
4+
********
5+
The WeAct STM32H523CE Core Board is a low cost and bare-bone development
6+
board made in famous "blackpill" package. It features STM32H523CE, high
7+
performance microcontroller based on a Arm Cortex M33 processor.
8+
9+
Hardware
10+
********
11+
12+
The STM32H523CE based Black Pill board provides the following hardware
13+
components:
14+
15+
- STM32H523CE in 48 pin package
16+
- ARM 32-bit Cortex -M33 CPU with FPU
17+
- 250 MHz max CPU frequency
18+
- VDD from 1.7 V to 3.6 V
19+
- 512 kB Flash
20+
- 274 kB SRAM
21+
- TIM
22+
- ADC
23+
- USART
24+
- I2C
25+
- SPI
26+
- USBFS
27+
- FDCAN
28+
- RTC
29+
30+
Supported Features
31+
==================
32+
33+
.. zephyr:board-supported-hw::
34+
35+
Connections and IOs
36+
===================
37+
38+
Default Zephyr Peripheral Mapping:
39+
----------------------------------
40+
41+
- UART_1 TX/RX : PA9/PA10
42+
- I2C1 SCL/SDA : PB6/PB7
43+
- SPI1 CS/SCK/MISO/MOSI : PA4/PA5/PA6/PA7 (Routed to footprint for external flash)
44+
- PWM_3_CH3 : PB0
45+
- PWM_3_CH4 : PB1
46+
- ADC_1 : PA1
47+
- USER_PB : PA0
48+
- USER_LED : PC13
49+
50+
Programming and Debugging
51+
*************************
52+
53+
.. zephyr:board-supported-runners::
54+
55+
There are 2 main entry points for flashing STM32H5X SoCs, one using the ROM
56+
bootloader, and another by using the SWD debug port (which requires additional
57+
hardware). Flashing using the ROM bootloader requires a special activation
58+
pattern, which can be triggered by using the BOOT0 pin.
59+
60+
Flashing
61+
========
62+
63+
Installing dfu-util
64+
-------------------
65+
66+
It is recommended to use at least v0.8 of `dfu-util`_. The package available in
67+
debian/ubuntu can be quite old, so you might have to build dfu-util from source.
68+
69+
There is also a Windows version which works, but you may have to install the
70+
right USB drivers with a tool like `Zadig`_.
71+
72+
Flashing an Application
73+
-----------------------
74+
75+
Connect a USB-C cable and the board should power ON. Force the board into DFU mode
76+
by keeping the BOOT0 switch pressed while pressing and releasing the NRST switch.
77+
78+
The dfu-util runner is supported on this board and so a sample can be built and
79+
tested easily.
80+
81+
.. zephyr-app-commands::
82+
:zephyr-app: samples/basic/blinky
83+
:board: blackpill_h523ce
84+
:goals: build flash
85+
86+
87+
Debugging
88+
=========
89+
90+
The board can be debugged by installing the included 100 mil (0.1 inch) header,
91+
and attaching an SWD debugger to the 3V3 (3.3V), GND, SCK, and DIO
92+
pins on that header.
93+
94+
References
95+
**********
96+
97+
.. target-notes::
98+
99+
.. _WeAct Github:
100+
https://github.com/WeActStudio/WeActStudio.STM32H523CoreBoard/tree/master
101+
102+
.. _STM32H523CE website:
103+
https://www.st.com/en/microcontrollers-microprocessors/stm32h523ce.html
104+
105+
.. _STM32H523CE reference manual:
106+
https://www.st.com/en/microcontrollers-microprocessors/stm32h523ce.html#

0 commit comments

Comments
 (0)