-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tab indent for cmake |
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 |
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"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tab indent for dts |
||
compatible = "weact,blackpill-h523ce"; | ||
|
||
chosen { | ||
zephyr,console = &usart1; | ||
Check warning on line 17 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts
|
||
zephyr,shell-uart = &usart1; | ||
Check warning on line 18 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts
|
||
zephyr,sram = &sram1; | ||
Check warning on line 19 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts
|
||
zephyr,flash = &flash0; | ||
Check warning on line 20 in boards/weact/blackpill_h523ce/blackpill_h523ce.dts
|
||
}; | ||
|
||
leds { | ||
compatible = "gpio-leds"; | ||
user_led: led { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 { | ||
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>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
identifier: blackpill_h523ce | ||
name: WeAct Studio Black Pill STM32H523 | ||
type: mcu | ||
arch: arm | ||
toolchain: | ||
- zephyr | ||
- gnuarmemb | ||
ram: 274 | ||
flash: 512 | ||
supported: | ||
- gpio | ||
- counter | ||
- spi | ||
- i2c | ||
- uart | ||
- pwm | ||
- adc | ||
vendor: weact |
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) |
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 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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/ There was a problem hiding this comment. Choose a reason for hiding this commentThe 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! |
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# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated and wrong change