Skip to content
Merged
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
12 changes: 12 additions & 0 deletions boards/weact/stm32g030_core/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# STM32G030 Core V1.0 board configuration

# Copyright (c) 2025 Siratul Islam
# SPDX-License-Identifier: Apache-2.0

if BOARD_WEACT_STM32G030_CORE

config SPI_STM32_INTERRUPT
default y
depends on SPI

endif # BOARD_WEACT_STM32G030_CORE
5 changes: 5 additions & 0 deletions boards/weact/stm32g030_core/Kconfig.weact_stm32g030_core
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 Siratul Islam
# SPDX-License-Identifier: Apache-2.0

config BOARD_WEACT_STM32G030_CORE
select SOC_STM32G030XX
10 changes: 10 additions & 0 deletions boards/weact/stm32g030_core/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0

# keep first
board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
board_runner_args(jlink "--device=STM32G031K8" "--speed=4000")

# keep first
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd-stm32.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
6 changes: 6 additions & 0 deletions boards/weact/stm32g030_core/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
board:
name: weact_stm32g030_core
full_name: STM32G030 Core Board 1.0
vendor: weact
socs:
- name: stm32g030xx
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions boards/weact/stm32g030_core/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
.. zephyr:board:: weact_stm32g030_core

Overview
********
The WeAct Studio STM32G030 Core Board provides an affordable and flexible way for
users to try out new concepts and build prototypes with the STM32G030F6
microcontroller. This compact development board is designed for space-constrained
applications while maintaining essential functionality.

The board requires an external ST-LINK or compatible SWD programmer
for flashing and debugging, as it does not include an onboard debugger.

Hardware
********
WeAct STM32G030 provides the following hardware components:

- STM32G030F6P6 microcontroller in TSSOP-20 package featuring 32 Kbytes of Flash
memory and 8 Kbytes of SRAM
- Compact form factor optimized for embedded applications
- Exposed SWD header for programming and debugging (SWDIO, SWCLK, GND, 3V3)
- One user LED connected to PA4 (blue LED)
- NRST button for manual reset
- Flexible board power supply:

- External 3.3V supply via power pins
- 5V input with onboard regulator

- All GPIO pins broken out for maximum flexibility

More information about STM32G030F6 can be found in the
`STM32G0x0 reference manual`_ and `STM32G030x6 datasheet`_.

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

.. zephyr:board-supported-hw::

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

Each of the GPIO pins can be configured by software as output (push-pull or open-drain),
as input (with or without pull-up or pull-down), or as peripheral alternate function.
Most of the GPIO pins are shared with digital or analog alternate functions. All GPIOs
are high current capable except for analog inputs.

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

- UART_1 TX/RX : PB6/PB7 (Primary Console)
- UART_2 TX/RX : PA2/PA3 (Secondary UART)
- I2C2 SCL/SDA : PA11/PA12
- SPI1 SCK/MISO/MOSI : PA1/PA6/PA7
- User LED : PA4 (Blue LED)
- SWD Interface : PA13 (SWDIO), PA14 (SWCLK)

System Clock
------------

The WeAct STM32G030 board is configured to use the internal HSI oscillator at 16 MHz
with PLL to generate a system clock of 64 MHz. The board also includes LSE crystal
support for RTC applications.

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

.. zephyr:board-supported-runners::

WeAct STM32G030 board requires an external ST-LINK/V2 or compatible SWD debugger for
programming and debugging. Connect your debugger to the SWD header:

- SWDIO (PA13)
- SWCLK (PA14)
- GND
- 3V3 (optional, for powering the board)

Flashing
========

The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.

Alternatively, OpenOCD or JLink can also be used to flash the board using
the ``--runner`` (or ``-r``) option:

.. code-block:: console

$ west flash --runner openocd
$ west flash --runner jlink

Flashing an application to WeAct STM32G030
-------------------------------------------

Connect your ST-LINK or compatible programmer to the SWD header on the board.

Here is an example for the :zephyr:code-sample:`blinky` application.

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

You will see the blue LED on PA4 blinking every second.

Debugging
=========

You can debug an application in the usual way. Here is an example for the
:zephyr:code-sample:`hello_world` application.

.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: weact_stm32g030_core
:maybe-skip-config:
:goals: debug

Serial Console
==============

The primary serial console is available on USART1 (PB6/PB7) at 115200 baud. Connect
a USB-to-serial adapter to these pins to access the Zephyr shell and console output:

- TX: PB6
- RX: PB7
- GND: GND

References
**********

.. target-notes::

.. _STM32G0x0 reference manual:
https://www.st.com/resource/en/reference_manual/rm0454-stm32g0x0-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

.. _STM32G030x6 datasheet:
https://www.st.com/resource/en/datasheet/stm32g030c6.pdf

.. _STM32CubeProgrammer:
https://www.st.com/en/development-tools/stm32cubeprog.html
7 changes: 7 additions & 0 deletions boards/weact/stm32g030_core/support/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source [find interface/stlink.cfg]

transport select hla_swd

source [find target/stm32g0x.cfg]

reset_config srst_only
85 changes: 85 additions & 0 deletions boards/weact/stm32g030_core/weact_stm32g030_core.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* Copyright (c) 2025 Siratul Islam
*
* SPDX-License-Identifier: Apache-2.0
*/

/dts-v1/;
#include <st/g0/stm32g030X6.dtsi>
#include <st/g0/stm32g030f6px-pinctrl.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "WeAct Studio STM32G030 Core Board";
compatible = "weact,stm32g030-core";

chosen {
zephyr,console = &usart1;
zephyr,shell-uart = &usart1;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
};

leds: leds {
compatible = "gpio-leds";

blue_led: blue_led {
gpios = <&gpioa 4 GPIO_ACTIVE_HIGH>;
label = "User LED";
};
};

aliases {
led0 = &blue_led;
};
};

&clk_hsi {
status = "okay";
};

&clk_lse {
status = "okay";
};

&pll {
div-m = <1>;
mul-n = <8>;
div-r = <2>;
clocks = <&clk_hsi>;
status = "okay";
};

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

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

&usart2 {
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};

&i2c2 {
pinctrl-0 = <&i2c2_scl_pa11 &i2c2_sda_pa12>;
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_FAST>;
status = "okay";
};

&spi1 {
pinctrl-0 = <&spi1_sck_pa1 &spi1_miso_pa6 &spi1_mosi_pa7>;
pinctrl-names = "default";
status = "okay";
};
14 changes: 14 additions & 0 deletions boards/weact/stm32g030_core/weact_stm32g030_core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
identifier: weact_stm32g030_core
name: WeAct Studio STM32G030 Core Board
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
supported:
- gpio
- i2c
- spi
ram: 8
flash: 32
vendor: weact
12 changes: 12 additions & 0 deletions boards/weact/stm32g030_core/weact_stm32g030_core_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: Apache-2.0

# Serial Drivers
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

# GPIO Controller
CONFIG_GPIO=y