Skip to content

Commit ebca689

Browse files
committed
boards: weact: blackpill_h523ce: Add initial support for WeAct STM32H523CE board
This commit adds support for the WeAct blackpill_h523ce board based on the STM32H523CE microcontroller. This MCU has 274 kB of RAM and 512 kB of Flash and supports various peripherals. Support has been added for several basic peripherals including UART, SPI, I2C, USB, ADC, and timers. Signed-off-by: Filip Stojanovic <[email protected]>
1 parent 3b03595 commit ebca689

File tree

9 files changed

+317
-0
lines changed

9 files changed

+317
-0
lines changed

boards/weact/blackpill_f411ce/blackpill_f411ce_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Copyright (c) 2025 Filip Stojanovic <[email protected]>
12
# SPDX-License-Identifier: Apache-2.0
23

34
# Enable MPU
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: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
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+
user_led: led {
26+
gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
27+
label = "User LED";
28+
};
29+
};
30+
31+
gpio_keys {
32+
compatible = "gpio-keys";
33+
user_button: button {
34+
label = "KEY";
35+
gpios = <&gpioa 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
36+
zephyr,code = <INPUT_KEY_0>;
37+
};
38+
};
39+
40+
aliases {
41+
led0 = &user_led;
42+
sw0 = &user_button;
43+
volt-sensor0 = &vref;
44+
volt-sensor1 = &vbat;
45+
};
46+
};
47+
48+
&timers3 {
49+
status = "okay";
50+
st,prescaler = <1000>;
51+
52+
pwm3: pwm {
53+
status = "okay";
54+
pinctrl-0 = <&tim3_ch3_pb0 &tim3_ch4_pb1>;
55+
pinctrl-names = "default";
56+
};
57+
};
58+
59+
&usart1 {
60+
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
61+
pinctrl-names = "default";
62+
status = "okay";
63+
current-speed = <115200>;
64+
};
65+
66+
&i2c1 {
67+
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
68+
pinctrl-names = "default";
69+
status = "okay";
70+
clock-frequency = <I2C_BITRATE_FAST>;
71+
};
72+
73+
&spi1 {
74+
pinctrl-0 = <&spi1_sck_pa5 &spi1_nss_pa4
75+
&spi1_miso_pa6 &spi1_mosi_pa7>;
76+
pinctrl-names = "default";
77+
status = "okay";
78+
};
79+
80+
&rtc {
81+
clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00200000>,
82+
<&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>,
94+
<&rcc STM32_SRC_HCLK ADCDAC_SEL(0)>;
95+
pinctrl-0 = <&adc1_inp1_pa1>;
96+
pinctrl-names = "default";
97+
st,adc-clock-source = "ASYNC";
98+
st,adc-prescaler = <8>;
99+
status = "okay";
100+
};
101+
102+
&clk_lsi {
103+
status = "okay";
104+
};
105+
106+
&clk_lse {
107+
status = "okay";
108+
};
109+
110+
&clk_hsi {
111+
status = "okay";
112+
};
113+
114+
&clk_hsi48 {
115+
status = "okay";
116+
};
117+
118+
&clk_hse {
119+
status = "okay";
120+
clock-frequency = <DT_FREQ_M(8)>;
121+
};
122+
123+
&rcc {
124+
clocks = <&pll>;
125+
clock-frequency = <DT_FREQ_M(240)>;
126+
ahb-prescaler = <1>;
127+
apb1-prescaler = <1>;
128+
apb2-prescaler = <1>;
129+
apb3-prescaler = <1>;
130+
};
131+
132+
&pll {
133+
div-m = <1>;
134+
mul-n = <60>;
135+
div-p = <2>;
136+
div-q = <2>;
137+
div-r = <2>;
138+
clocks = <&clk_hse>;
139+
status = "okay";
140+
};
141+
142+
&vref {
143+
status = "okay";
144+
};
145+
146+
&vbat {
147+
status = "okay";
148+
};
149+
150+
&iwdg {
151+
status = "okay";
152+
};
153+
154+
&rng {
155+
status = "okay";
156+
};
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
Loading
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 harware
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_f523ce
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+
.. _STM32F523CE website:
103+
https://www.st.com/en/microcontrollers-microprocessors/stm32h523ce.html
104+
105+
.. _STM32F523CE reference manual:
106+
https://www.st.com/en/microcontrollers-microprocessors/stm32h523ce.html#

0 commit comments

Comments
 (0)