Skip to content

boards: weact: blackpill_h523ce: Add support for blackpill_h523ce board #92353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/weact/blackpill_f411ce/blackpill_f411ce_defconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) 2025 Filip Stojanovic <filipembedded@gmail.com>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated and wrong change

# SPDX-License-Identifier: Apache-2.0

# Enable MPU
Expand Down
5 changes: 5 additions & 0 deletions boards/weact/blackpill_h523ce/Kconfig.blackpill_h523ce
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 Filip Stojanovic
# SPDX-License-Identifier: Apache-2.0

config BOARD_BLACKPILL_H523CE
select SOC_STM32H533XX

Check warning on line 5 in boards/weact/blackpill_h523ce/Kconfig.blackpill_h523ce

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/Kconfig.blackpill_h523ce:5 please, no spaces at the start of a line
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab indent for cmake

16 changes: 16 additions & 0 deletions boards/weact/blackpill_h523ce/blackpill_h523ce.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2025 Filip Stojanovic <filipembedded@gmail.com>
# SPDX-License-Identifier: Apache-2.0

# Enable MPU
CONFIG_ARM_MPU=y

# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y

# Serial drivers
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# Enable GPIO
CONFIG_GPIO=y
156 changes: 156 additions & 0 deletions boards/weact/blackpill_h523ce/blackpill_h523ce.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/*
* Copyright (c) 2025 Filip Stojanovic <filipembedded@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <st/h5/stm32h533Xe.dtsi>
#include <st/h5/stm32h533retx-pinctrl.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "WeAct Studio Black Pill STM32H523 Board";

Check warning on line 13 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:13 please, no spaces at the start of a line
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab indent for dts

compatible = "weact,blackpill-h523ce";

Check warning on line 14 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:14 please, no spaces at the start of a line

chosen {

Check warning on line 16 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:16 please, no spaces at the start of a line
zephyr,console = &usart1;

Check warning on line 17 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:17 please, no spaces at the start of a line

Check failure on line 17 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:17 code indent should use tabs where possible
zephyr,shell-uart = &usart1;

Check warning on line 18 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:18 please, no spaces at the start of a line

Check failure on line 18 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:18 code indent should use tabs where possible
zephyr,sram = &sram1;

Check warning on line 19 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:19 please, no spaces at the start of a line

Check failure on line 19 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:19 code indent should use tabs where possible
zephyr,flash = &flash0;

Check warning on line 20 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:20 please, no spaces at the start of a line

Check failure on line 20 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:20 code indent should use tabs where possible
};

Check warning on line 21 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:21 please, no spaces at the start of a line

leds {
compatible = "gpio-leds";
user_led: led {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline before child nodes and between child nodes, e.g. line 25, line 33, fix in whole PR

gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
label = "User LED";
};
};

gpio_keys {
compatible = "gpio-keys";
user_button: button {
label = "KEY";
gpios = <&gpioa 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
zephyr,code = <INPUT_KEY_0>;
};
};

aliases {

Check warning on line 40 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

boards/weact/blackpill_h523ce/blackpill_h523ce.dts:40 please, no spaces at the start of a line
led0 = &user_led;
sw0 = &user_button;
volt-sensor0 = &vref;
volt-sensor1 = &vbat;
};
};

&timers3 {
status = "okay";
st,prescaler = <1000>;

pwm3: pwm {
status = "okay";
pinctrl-0 = <&tim3_ch3_pb0 &tim3_ch4_pb1>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aliment off

pinctrl-names = "default";
};
};

&usart1 {
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
pinctrl-names = "default";
status = "okay";
current-speed = <115200>;
};

&i2c1 {
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
pinctrl-names = "default";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
};

&spi1 {
pinctrl-0 = <&spi1_sck_pa5 &spi1_nss_pa4
&spi1_miso_pa6 &spi1_mosi_pa7>;
pinctrl-names = "default";
status = "okay";
};

&rtc {
clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00200000>,
<&rcc STM32_SRC_LSE RTC_SEL(1)>;
status = "okay";
};

zephyr_udc0: &usb {
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};

&adc1 {
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000400>,
<&rcc STM32_SRC_HCLK ADCDAC_SEL(0)>;
pinctrl-0 = <&adc1_inp1_pa1>;
pinctrl-names = "default";
st,adc-clock-source = "ASYNC";
st,adc-prescaler = <8>;
status = "okay";
};

&clk_lsi {
status = "okay";
};

&clk_lse {
status = "okay";
};

&clk_hsi {
status = "okay";
};

&clk_hsi48 {
status = "okay";
};

&clk_hse {
status = "okay";
clock-frequency = <DT_FREQ_M(8)>;
};

&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(240)>;
ahb-prescaler = <1>;
apb1-prescaler = <1>;
apb2-prescaler = <1>;
apb3-prescaler = <1>;
};

&pll {
div-m = <1>;
mul-n = <60>;
div-p = <2>;
div-q = <2>;
div-r = <2>;
clocks = <&clk_hse>;
status = "okay";
};

&vref {
status = "okay";
};

&vbat {
status = "okay";
};

&iwdg {
status = "okay";
};

&rng {
status = "okay";
};
18 changes: 18 additions & 0 deletions boards/weact/blackpill_h523ce/blackpill_h523ce.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
identifier: blackpill_h523ce

Check failure on line 1 in boards/weact/blackpill_h523ce/blackpill_h523ce.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

boards/weact/blackpill_h523ce/blackpill_h523ce.yaml:1 DOS line endings
name: WeAct Studio Black Pill STM32H523

Check failure on line 2 in boards/weact/blackpill_h523ce/blackpill_h523ce.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

boards/weact/blackpill_h523ce/blackpill_h523ce.yaml:2 DOS line endings
type: mcu

Check failure on line 3 in boards/weact/blackpill_h523ce/blackpill_h523ce.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

boards/weact/blackpill_h523ce/blackpill_h523ce.yaml:3 DOS line endings
arch: arm

Check failure on line 4 in boards/weact/blackpill_h523ce/blackpill_h523ce.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

boards/weact/blackpill_h523ce/blackpill_h523ce.yaml:4 DOS line endings
toolchain:

Check failure on line 5 in boards/weact/blackpill_h523ce/blackpill_h523ce.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

boards/weact/blackpill_h523ce/blackpill_h523ce.yaml:5 DOS line endings
- zephyr

Check failure on line 6 in boards/weact/blackpill_h523ce/blackpill_h523ce.yaml

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

DOS_LINE_ENDINGS

boards/weact/blackpill_h523ce/blackpill_h523ce.yaml:6 DOS line endings
- gnuarmemb
ram: 274
flash: 512
supported:
- gpio
- counter
- spi
- i2c
- uart
- pwm
- adc
vendor: weact
9 changes: 9 additions & 0 deletions boards/weact/blackpill_h523ce/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-License-Identifier: Apache-2.0

board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
board_runner_args(jlink "--device=STM32H523CE" "--speed=4000")

include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
6 changes: 6 additions & 0 deletions boards/weact/blackpill_h523ce/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: blackpill_h523ce
full_name: Black Pill STM32H523
vendor: weact
socs:
- name: stm32h533xx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a picture of the actual board rather than this? Whichever picture, convert to webp, put through https://tinypng.com/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I do have a few pictures of the actual board, so I'll replace this one with real photos. Appreciate your feedback!

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 106 additions & 0 deletions boards/weact/blackpill_h523ce/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
.. zephyr:board:: blackpill_h523ce

Overview
********
The WeAct STM32H523CE Core Board is a low cost and bare-bone development
board made in famous "blackpill" package. It features STM32H523CE, high
performance microcontroller based on a Arm Cortex M33 processor.

Hardware
********

The STM32H523CE based Black Pill board provides the following harware
components:

- STM32H523CE in 48 pin package
- ARM 32-bit Cortex -M33 CPU with FPU
- 250 MHz max CPU frequency
- VDD from 1.7 V to 3.6 V
- 512 kB Flash
- 274 kB SRAM
- TIM
- ADC
- USART
- I2C
- SPI
- USBFS
- FDCAN
- RTC

Supported Features
==================

.. zephyr:board-supported-hw::

Connections and IOs
===================

Default Zephyr Peripheral Mapping:
----------------------------------

- UART_1 TX/RX : PA9/PA10
- I2C1 SCL/SDA : PB6/PB7
- SPI1 CS/SCK/MISO/MOSI : PA4/PA5/PA6/PA7 (Routed to footprint for external flash)
- PWM_3_CH3 : PB0
- PWM_3_CH4 : PB1
- ADC_1 : PA1
- USER_PB : PA0
- USER_LED : PC13

Programming and Debugging
*************************

.. zephyr:board-supported-runners::

There are 2 main entry points for flashing STM32H5X SoCs, one using the ROM
bootloader, and another by using the SWD debug port (which requires additional
hardware). Flashing using the ROM bootloader requires a special activation
pattern, which can be triggered by using the BOOT0 pin.

Flashing
========

Installing dfu-util
-------------------

It is recommended to use at least v0.8 of `dfu-util`_. The package available in
debian/ubuntu can be quite old, so you might have to build dfu-util from source.

There is also a Windows version which works, but you may have to install the
right USB drivers with a tool like `Zadig`_.

Flashing an Application
-----------------------

Connect a USB-C cable and the board should power ON. Force the board into DFU mode
by keeping the BOOT0 switch pressed while pressing and releasing the NRST switch.

The dfu-util runner is supported on this board and so a sample can be built and
tested easily.

.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: blackpill_f523ce
:goals: build flash


Debugging
=========

The board can be debugged by installing the included 100 mil (0.1 inch) header,
and attaching an SWD debugger to the 3V3 (3.3V), GND, SCK, and DIO
pins on that header.

References
**********

.. target-notes::

.. _WeAct Github:
https://github.com/WeActStudio/WeActStudio.STM32H523CoreBoard/tree/master

.. _STM32F523CE website:
https://www.st.com/en/microcontrollers-microprocessors/stm32h523ce.html

.. _STM32F523CE reference manual:
https://www.st.com/en/microcontrollers-microprocessors/stm32h523ce.html#
Loading