Skip to content

Commit 3ce5226

Browse files
heronetfabiobaltieri
authored andcommitted
boards: arm: add WeAct STM32F446 Core board
Add support for WeAct STM32F446 Core board featuring: - STM32F446RET6 MCU (ARM Cortex-M4F @ 180 MHz) - 512KB Flash, 128KB SRAM - 8MHz HSE crystal oscillator - USB Type-C connector with DFU support - User LED (PB2) and button (PC13) - MicroSD card slot (SDIO) - SWD debug header - 30×2 pin headers exposing GPIO pins Peripherals supported: - 4x USART/UART - 4x I2C - 4x SPI/I2S - 2x CAN - 3x 12-bit ADC - 2x 12-bit DAC - USB OTG FS - SDIO interface Tested with samples/basic/blinky and samples/hello_world. Signed-off-by: Siratul Islam <sirat4757@gmail.com> Signed-off-by: heronet <sirat4757@gmail.com>
1 parent 19fe604 commit 3ce5226

File tree

9 files changed

+371
-0
lines changed

9 files changed

+371
-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 Siratul Islam
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_WEACT_STM32F446_CORE
5+
select SOC_STM32F446XX
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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=STM32F446RE" "--speed=4000")
5+
6+
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
7+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
8+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

boards/weact/stm32f446_core/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: weact_stm32f446_core
3+
full_name: STM32F446 Core Board V1.1
4+
vendor: weact
5+
socs:
6+
- name: stm32f446xx
Binary file not shown.
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
.. zephyr:board:: weact_stm32f446_core
2+
3+
Overview
4+
********
5+
6+
The WeAct STM32F446 Core Board is an extremely low cost and bare-bones
7+
development board featuring the STM32F446RE, see `STM32F446RE website`_.
8+
This is the 64-pin variant of the STM32F446x series,
9+
see `STM32F446x reference manual`_. More info about the board available
10+
on `WeAct Github`_.
11+
12+
Hardware
13+
********
14+
15+
The STM32F446RE based Core Board provides the following
16+
hardware components:
17+
18+
- STM32F446RE in QFPN64 package
19+
- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU, Adaptive real-time
20+
accelerator (ART Accelerator) allowing 0-wait state execution from Flash memory
21+
- 180 MHz max CPU frequency
22+
- VDD from 1.7 V to 3.6 V
23+
- 512 KB Flash
24+
- 128 Kbytes of SRAM
25+
- GPIO with external interrupt capability
26+
- 3x12-bit, 2.4 MSPS ADC up to 16 channels
27+
- 2x12-bit D/A converters
28+
- 16-stream DMA controller
29+
- Up to 17 Timers (twelve 16-bit, two 32-bit, two watchdog timers and a SysTick timer)
30+
- USART/UART (4)
31+
- I2C (4)
32+
- SPI/I2S (4)
33+
- CAN (2)
34+
- SDIO
35+
- USB 2.0 full-speed device/host/OTG controller with on-chip PHY
36+
- SAI (Serial Audio Interface)
37+
- SPDIFRX interface
38+
- HDMI-CEC
39+
- CRC calculation unit
40+
- 96-bit unique ID
41+
- RTC with hardware calendar
42+
43+
44+
Supported Features
45+
==================
46+
47+
.. zephyr:board-supported-hw::
48+
49+
Pin Mapping
50+
===========
51+
52+
Default Zephyr Peripheral Mapping:
53+
----------------------------------
54+
55+
- UART_1 TX/RX : PA9/PA10 (also available on USB-C for console)
56+
- UART_2 TX/RX : PA2/PA3
57+
- I2C1 SCL/SDA : PB6/PB7
58+
- I2C2 SCL/SDA : PB10/PB11
59+
- SPI1 SCK/MISO/MOSI : PA5/PA6/PA7
60+
- SPI2 SCK/MISO/MOSI : PB13/PB14/PB15
61+
- CAN1 TX/RX : PB9/PB8
62+
- SDMMC1 D0/D1/D2/D3/CLK/CMD : PC8/PC9/PC10/PC11/PC12/PD2
63+
- USER_PB : PC13 (Active Low)
64+
- USER_LED : PB2 (Active High)
65+
- USB_DM/USB_DP : PA11/PA12
66+
67+
OnBoard Features
68+
69+
- USB Type-C connector
70+
- User LED (PB2) - Active High
71+
- User Key (PC13) - Active Low
72+
- BOOT0 Key for DFU mode
73+
- RESET Key
74+
- 8MHz HSE crystal oscillator
75+
- 32.768kHz LSE crystal oscillator
76+
- MicroSD card slot (SDIO interface)
77+
- SWD debug header (3.3V, GND, SWCLK, SWDIO)
78+
- 30×2 pin headers exposing GPIO pins
79+
80+
Clock Sources
81+
-------------
82+
83+
The board has two external oscillators. The frequency of the slow clock (LSE) is
84+
32.768 kHz. The frequency of the main clock (HSE) is 8 MHz.
85+
86+
The default configuration sources the system clock from the PLL, which is
87+
derived from HSE, and is set at 180MHz, which is the maximum possible frequency
88+
for the STM32F446RE.
89+
90+
Programming and Debugging
91+
*************************
92+
93+
.. zephyr:board-supported-runners::
94+
95+
There are 2 main entry points for flashing STM32F4X SoCs, one using the ROM
96+
bootloader, and another by using the SWD debug port (which requires additional
97+
hardware). Flashing using the ROM bootloader requires a special activation
98+
pattern, which can be triggered by using the BOOT0 pin.
99+
100+
Flashing
101+
========
102+
103+
Installing dfu-util
104+
-------------------
105+
106+
It is recommended to use at least v0.8 of `dfu-util`_. The package available in
107+
debian/ubuntu can be quite old, so you might have to build dfu-util from source.
108+
109+
There is also a Windows version which works, but you may have to install the
110+
right USB drivers with a tool like `Zadig`_.
111+
112+
Flashing an Application
113+
-----------------------
114+
115+
Connect a USB-C cable and the board should power ON. Force the board into DFU mode
116+
by keeping the BOOT0 switch pressed while pressing and releasing the NRST switch.
117+
118+
The dfu-util runner is supported on this board and so a sample can be built and
119+
tested easily.
120+
121+
.. zephyr-app-commands::
122+
:zephyr-app: samples/basic/blinky
123+
:board: weact_stm32f446_core
124+
:goals: build flash
125+
126+
.. zephyr-app-commands::
127+
:zephyr-app: samples/basic/button
128+
:board: weact_stm32f446_core
129+
:goals: build flash
130+
131+
.. zephyr-app-commands::
132+
:zephyr-app: samples/subsys/fs/fs_sample
133+
:board: weact_stm32f446_core
134+
:goals: build flash
135+
136+
137+
Debugging
138+
=========
139+
140+
The board can be debugged by installing the included 100 mil (0.1 inch) header,
141+
and attaching an SWD debugger to the 3V3 (3.3V), GND, SCK, and DIO
142+
pins on that header.
143+
144+
References
145+
**********
146+
147+
.. target-notes::
148+
149+
.. _board release notes:
150+
https://github.com/WeActStudio/WeActStudio.STM32F4_64Pin_CoreBoard/blob/master/README.md
151+
152+
.. _Zadig:
153+
https://zadig.akeo.ie/
154+
155+
.. _WeAct Github:
156+
https://github.com/WeActStudio/WeActStudio.STM32F4_64Pin_CoreBoard
157+
158+
.. _dfu-util:
159+
http://dfu-util.sourceforge.net/build.html
160+
161+
.. _STM32F446RE website:
162+
https://www.st.com/en/microcontrollers-microprocessors/stm32f446re.html
163+
164+
.. _STM32F446x reference manual:
165+
https://www.st.com/resource/en/reference_manual/rm0390-stm32f446xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
source [find interface/stlink.cfg]
2+
3+
transport select hla_swd
4+
5+
source [find target/stm32f4x.cfg]
6+
7+
reset_config srst_only
8+
9+
$_TARGETNAME configure -event gdb-attach {
10+
echo "Debugger attaching: halting execution"
11+
reset halt
12+
gdb_breakpoint_override hard
13+
}
14+
15+
$_TARGETNAME configure -event gdb-detach {
16+
echo "Debugger detaching: resuming execution"
17+
resume
18+
}
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
/*
2+
* Copyright (c) 2024 Siratul Islam
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/f4/stm32f446Xe.dtsi>
9+
#include <st/f4/stm32f446r(c-e)tx-pinctrl.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "WeAct Studio STM32F446 Core Board";
14+
compatible = "weact,stm32f446-core", "st,stm32f446";
15+
16+
chosen {
17+
zephyr,console = &usart1;
18+
zephyr,shell-uart = &usart1;
19+
zephyr,sram = &sram0;
20+
zephyr,flash = &flash0;
21+
};
22+
23+
leds {
24+
compatible = "gpio-leds";
25+
26+
led: led {
27+
gpios = <&gpiob 2 GPIO_ACTIVE_HIGH>;
28+
label = "User LED";
29+
};
30+
};
31+
32+
gpio_keys {
33+
compatible = "gpio-keys";
34+
35+
user_button: button {
36+
label = "User";
37+
gpios = <&gpioc 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
38+
zephyr,code = <INPUT_KEY_0>;
39+
};
40+
};
41+
42+
aliases {
43+
led0 = &led;
44+
sw0 = &user_button;
45+
watchdog0 = &iwdg;
46+
sdhc0 = &sdmmc1;
47+
};
48+
};
49+
50+
&clk_lsi {
51+
status = "okay";
52+
};
53+
54+
&clk_hse {
55+
clock-frequency = <DT_FREQ_M(8)>;
56+
status = "okay";
57+
};
58+
59+
&pll {
60+
div-m = <8>;
61+
mul-n = <360>;
62+
div-p = <2>;
63+
div-q = <2>;
64+
clocks = <&clk_hse>;
65+
status = "okay";
66+
};
67+
68+
&rcc {
69+
clocks = <&pll>;
70+
clock-frequency = <DT_FREQ_M(180)>;
71+
ahb-prescaler = <1>;
72+
apb1-prescaler = <4>;
73+
apb2-prescaler = <2>;
74+
};
75+
76+
77+
&usart1 {
78+
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
79+
pinctrl-names = "default";
80+
current-speed = <115200>;
81+
status = "okay";
82+
};
83+
84+
&usart2 {
85+
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
86+
pinctrl-names = "default";
87+
current-speed = <115200>;
88+
status = "okay";
89+
};
90+
91+
&i2c1 {
92+
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
93+
pinctrl-names = "default";
94+
status = "okay";
95+
clock-frequency = <I2C_BITRATE_FAST>;
96+
};
97+
98+
&spi1 {
99+
pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
100+
pinctrl-names = "default";
101+
status = "okay";
102+
};
103+
104+
&can1 {
105+
pinctrl-0 = <&can1_rx_pb8 &can1_tx_pb9>;
106+
pinctrl-names = "default";
107+
status = "okay";
108+
};
109+
110+
&sdmmc1 {
111+
status = "okay";
112+
pinctrl-0 = <&sdio_d0_pc8 &sdio_d1_pc9
113+
&sdio_d2_pc10 &sdio_d3_pc11
114+
&sdio_ck_pc12 &sdio_cmd_pd2>;
115+
pinctrl-names = "default";
116+
cd-gpios = <&gpioa 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
117+
disk-name = "SD";
118+
};
119+
120+
&rtc {
121+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
122+
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
123+
status = "okay";
124+
};
125+
126+
zephyr_udc0: &usbotg_fs {
127+
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
128+
pinctrl-names = "default";
129+
status = "okay";
130+
};
131+
132+
&iwdg {
133+
status = "okay";
134+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
identifier: weact_stm32f446_core
2+
name: WeAct Studio STM32F446 Core Board
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 128
9+
flash: 512
10+
supported:
11+
- counter
12+
- spi
13+
- i2c
14+
- uart
15+
- can
16+
- gpio
17+
- watchdog
18+
- backup_sram
19+
vendor: weact
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# Enable MPU
4+
CONFIG_ARM_MPU=y
5+
6+
# Enable HW stack protection
7+
CONFIG_HW_STACK_PROTECTION=y
8+
9+
CONFIG_SERIAL=y
10+
11+
# Console
12+
CONFIG_CONSOLE=y
13+
CONFIG_UART_CONSOLE=y
14+
15+
# Enable GPIO
16+
CONFIG_GPIO=y

0 commit comments

Comments
 (0)