Skip to content

Commit 76de42f

Browse files
pyadvichuknashif
authored andcommitted
boards: WeAct: Add STM32F405 Core board
The WeAct STM32F405 Core Board is an extremely low cost and bare-bones development board featuring the STM32F405RG, 64-pin variant of the STM32F405x series. Signed-off-by: Pavlo Yadvychuk <[email protected]>
1 parent 1fe9840 commit 76de42f

File tree

9 files changed

+397
-0
lines changed

9 files changed

+397
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Pavlo Yadvychuk
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_WEACT_STM32F405_CORE
5+
select SOC_STM32F405XX
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=STM32F405RG" "--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)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
board:
2+
name: weact_stm32f405_core
3+
vendor: weact
4+
socs:
5+
- name: stm32f405xx
65.9 KB
Loading
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
.. _weact_stm32f405_core:
2+
3+
WeAct Studio STM32F405 Core Board V1.0
4+
######################################
5+
6+
Overview
7+
********
8+
9+
The WeAct STM32F405 Core Board is an extremely low cost and bare-bones
10+
development board featuring the STM32F405RG, see `STM32F405RG website`_.
11+
This is the 64-pin variant of the STM32F405x series,
12+
see `STM32F405x reference manual`_. More info about the board available
13+
on `WeAct Github`_.
14+
15+
.. image:: img/stm32f405_core.jpg
16+
:align: center
17+
:alt: STM32F405 Core Board v1.0
18+
19+
Hardware
20+
********
21+
22+
The STM32F405RG based Core V1.0 Board provides the following
23+
hardware components:
24+
25+
- STM32F405RG in QFPN64 package
26+
- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU, Adaptive real-time
27+
accelerator (ART Accelerator) allowing 0-wait state execution from Flash memory
28+
- 168 MHz max CPU frequency
29+
- VDD from 1.7 V to 3.6 V
30+
- 1 MB Flash
31+
- 192+4 Kbytes of SRAM including 64-Kbyte of CCM (core coupled memory)
32+
- GPIO with external interrupt capability
33+
- 3x12-bit, 2.4 MSPS ADC up to 24 channels and 7.2 MSPS in triple interleaved mode
34+
- 2x12-bit D/A converters
35+
- 16-stream DMA controller
36+
- Up to 17 Timers (twelve 16-bit, two 32-bit, two watchdog timers and a SysTick timer)
37+
- USART/UART (4)
38+
- I2C (3)
39+
- SPI/I2S (3)
40+
- CAN (2)
41+
- SDIO
42+
- USB 2.0 full-speed device/host/OTG controller with on-chip PHY
43+
- USB 2.0 high-speed/full-speed device/host/OTG controller with on-chip full-speed PHY and ULPI
44+
- 10/100 Ethernet MAC
45+
- CRC calculation unit
46+
- 96-bit unique ID
47+
- RTC with hardware calendar
48+
- 8- to 14-bit parallel camera interface
49+
- LCD parallel interface, 8080/6800 modes
50+
51+
52+
Supported Features
53+
==================
54+
55+
The Zephyr weact_stm32f405_core board configuration supports the following
56+
hardware features:
57+
58+
+------------+------------+-------------------------------------+
59+
| Interface | Controller | Driver/Component |
60+
+============+============+=====================================+
61+
| NVIC | on-chip | nested vector interrupt controller |
62+
+------------+------------+-------------------------------------+
63+
| SYSTICK | on-chip | system clock |
64+
+------------+------------+-------------------------------------+
65+
| UART | on-chip | serial port |
66+
+------------+------------+-------------------------------------+
67+
| GPIO | on-chip | gpio |
68+
+------------+------------+-------------------------------------+
69+
| PINMUX | on-chip | pinmux |
70+
+------------+------------+-------------------------------------+
71+
| FLASH | on-chip | flash |
72+
+------------+------------+-------------------------------------+
73+
| SPI | on-chip | spi |
74+
+------------+------------+-------------------------------------+
75+
| I2C | on-chip | i2c |
76+
+------------+------------+-------------------------------------+
77+
| ADC | on-chip | ADC Controller |
78+
+------------+------------+-------------------------------------+
79+
| USB OTG FS | on-chip | USB device |
80+
+------------+------------+-------------------------------------+
81+
82+
The default configuration can be found in
83+
:zephyr_file:`boards/weact/stm32f405_core/weact_stm32f405_core_defconfig`
84+
85+
Pin Mapping
86+
===========
87+
88+
Default Zephyr Peripheral Mapping:
89+
----------------------------------
90+
91+
- UART_1 TX/RX : PA9/PA10
92+
- UART_2 TX/RX : PA2/PA3
93+
- I2C1 SCL/SDA : PB6/PB7
94+
- SPI1 SCK/MISO/MOSI : PA5/PA6/PA7
95+
- CAN1 TX/RX : Pb9/PB8
96+
- SDMMC1 D0..D4/CLK/CMD : PC8/PC9/PC10/PC11/PC12/PD2
97+
- USER_PB : PC13
98+
- USER_LED : PB2
99+
100+
Clock Sources
101+
-------------
102+
103+
The board has two external oscillators. The frequency of the slow clock (LSE) is
104+
32.768 kHz. The frequency of the main clock (HSE) is 8 MHz.
105+
106+
The default configuration sources the system clock from the PLL, which is
107+
derived from HSE, and is set at 168MHz, which is the maximum possible frequency
108+
to achieve a stable USB clock (48MHz).
109+
110+
Programming and Debugging
111+
*************************
112+
113+
There are 2 main entry points for flashing STM32F4X SoCs, one using the ROM
114+
bootloader, and another by using the SWD debug port (which requires additional
115+
hardware). Flashing using the ROM bootloader requires a special activation
116+
pattern, which can be triggered by using the BOOT0 pin.
117+
118+
Flashing
119+
========
120+
121+
Installing dfu-util
122+
-------------------
123+
124+
It is recommended to use at least v0.8 of `dfu-util`_. The package available in
125+
debian/ubuntu can be quite old, so you might have to build dfu-util from source.
126+
127+
There is also a Windows version which works, but you may have to install the
128+
right USB drivers with a tool like `Zadig`_.
129+
130+
Flashing an Application
131+
-----------------------
132+
133+
Connect a USB-C cable and the board should power ON. Force the board into DFU mode
134+
by keeping the BOOT0 switch pressed while pressing and releasing the NRST switch.
135+
136+
The dfu-util runner is supported on this board and so a sample can be built and
137+
tested easily.
138+
139+
.. zephyr-app-commands::
140+
:zephyr-app: samples/basic/blinky
141+
:board: weact_stm32f405_core
142+
:goals: build flash
143+
144+
.. zephyr-app-commands::
145+
:zephyr-app: samples/basic/button
146+
:board: weact_stm32f405_core
147+
:goals: build flash
148+
149+
.. zephyr-app-commands::
150+
:zephyr-app: samples/subsys/fs/fs_sample
151+
:board: weact_stm32f405_core
152+
:goals: build flash
153+
154+
155+
Debugging
156+
=========
157+
158+
The board can be debugged by installing the included 100 mil (0.1 inch) header,
159+
and attaching an SWD debugger to the 3V3 (3.3V), GND, SCK, and DIO
160+
pins on that header.
161+
162+
References
163+
**********
164+
165+
.. target-notes::
166+
167+
.. _board release notes:
168+
https://github.com/WeActStudio/WeActStudio.STM32F4_64Pin_CoreBoard/blob/master/README.md
169+
170+
.. _Zadig:
171+
https://zadig.akeo.ie/
172+
173+
.. _WeAct Github:
174+
https://github.com/WeActStudio/WeActStudio.STM32F4_64Pin_CoreBoard
175+
176+
.. _dfu-util:
177+
http://dfu-util.sourceforge.net/build.html
178+
179+
.. _STM32F405RG website:
180+
https://www.st.com/en/microcontrollers-microprocessors/stm32f405rg.html
181+
182+
.. _STM32F405x reference manual:
183+
https://www.st.com/resource/en/reference_manual/rm0090-stm32f405415-stm32f407417-stm32f427437-and-stm32f429439-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: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/*
2+
* Copyright (c) 2024 Pavlo Yadvychuk
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/f4/stm32f405Xg.dtsi>
9+
#include <st/f4/stm32f405rgtx-pinctrl.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "WeAct Studio STM32F405 Core Board";
14+
compatible = "weact,stm32f405-core", "st,stm32f405";
15+
16+
chosen {
17+
zephyr,console = &usart1;
18+
zephyr,shell-uart = &usart1;
19+
zephyr,sram = &sram0;
20+
zephyr,flash = &flash0;
21+
zephyr,ccm = &ccm0;
22+
};
23+
24+
leds {
25+
compatible = "gpio-leds";
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+
user_button: button {
35+
label = "User";
36+
gpios = <&gpioc 13 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
37+
zephyr,code = <INPUT_KEY_0>;
38+
};
39+
};
40+
41+
aliases {
42+
led0 = &led;
43+
sw0 = &user_button;
44+
watchdog0 = &iwdg;
45+
sdhc0 = &sdmmc1;
46+
};
47+
};
48+
49+
&clk_lsi {
50+
status = "okay";
51+
};
52+
53+
&clk_hse {
54+
clock-frequency = <DT_FREQ_M(8)>;
55+
status = "okay";
56+
};
57+
58+
&pll {
59+
div-m = <8>;
60+
mul-n = <336>;
61+
div-p = <2>;
62+
div-q = <7>;
63+
clocks = <&clk_hse>;
64+
status = "okay";
65+
};
66+
67+
&rcc {
68+
clocks = <&pll>;
69+
clock-frequency = <DT_FREQ_M(168)>;
70+
ahb-prescaler = <1>;
71+
apb1-prescaler = <4>;
72+
apb2-prescaler = <2>;
73+
};
74+
75+
&usart1 {
76+
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
77+
pinctrl-names = "default";
78+
current-speed = <115200>;
79+
status = "okay";
80+
};
81+
82+
&usart2 {
83+
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
84+
pinctrl-names = "default";
85+
current-speed = <115200>;
86+
status = "okay";
87+
};
88+
89+
&i2c1 {
90+
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
91+
pinctrl-names = "default";
92+
status = "okay";
93+
clock-frequency = <I2C_BITRATE_FAST>;
94+
};
95+
96+
&spi1 {
97+
pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
98+
pinctrl-names = "default";
99+
status = "okay";
100+
};
101+
102+
&can1 {
103+
pinctrl-0 = <&can1_rx_pb8 &can1_tx_pb9>;
104+
pinctrl-names = "default";
105+
status = "okay";
106+
};
107+
108+
&sdmmc1 {
109+
status = "okay";
110+
pinctrl-0 = <&sdio_d0_pc8 &sdio_d1_pc9
111+
&sdio_d2_pc10 &sdio_d3_pc11
112+
&sdio_ck_pc12 &sdio_cmd_pd2>;
113+
pinctrl-names = "default";
114+
cd-gpios = <&gpioa 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
115+
};
116+
117+
&rtc {
118+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
119+
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
120+
status = "okay";
121+
};
122+
123+
zephyr_udc0: &usbotg_fs {
124+
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
125+
pinctrl-names = "default";
126+
status = "okay";
127+
};
128+
129+
&iwdg {
130+
status = "okay";
131+
};
132+
133+
&backup_sram {
134+
status = "okay";
135+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
identifier: weact_stm32f405_core
2+
name: WeAct Studio STM32F405 Core Board
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 128
10+
flash: 1024
11+
supported:
12+
- counter
13+
- spi
14+
- i2c
15+
- uart
16+
- usb
17+
- can
18+
- gpio
19+
- watchdog
20+
- backup_sram
21+
vendor: weact

0 commit comments

Comments
 (0)