STM32G431 Core Board

The WeAct STM32G431 Core Board is a low-cost bare-bones STM32G431-based development board. See the STM32G431CB website [2] for more information about the MCU. More information about the board, including schematics, is available from the WeAct GitHub [1].

Modifications USB-C Power Delivery

The board does not support USB-C PD in its standard configuration. To enable USB-C PD, CC1 and CC2 need to be disconnected from their pull-down resistors and be connected to PB6 and PB4 respectively. Dead battery support requires PA9 and PA10 to be routed to CC1 and CC2. VBUS also needs to be connected to the MCU through a voltage divider.

The pull-downs are disconnected by removing the zero-Ohm resistors on SB8 and SB9 next to the USB-C connector. SB3, SB5, SB6, and SB7 then need to be closed to connect the CCx lines to the MCU. The voltage divider is connected to PB2 by closing SB4.

After these modifications have been made, PA9, PA10, PB2, PB4, and PB6 should be considered reserved for USB-C and not available for other applications.

Warning

The internal USB DFU boot loader may not work correctly with machines that respect USB PD signaling unless dead battery support has been enabled. A USB-C to USB-A adapter or programming using the SWD port can be used as a workaround.

Supported Features

The weact_stm32g431_core board supports the hardware features listed below.

on-chip / on-board
Feature integrated in the SoC / present on the board.
2 / 2
Number of instances that are enabled / disabled.
Click on the label to see the first instance of this feature in the board/SoC DTS files.
vnd,foo
Compatible string for the Devicetree binding matching the feature.
Click on the link to view the binding documentation.
weact_stm32g431_core
/
stm32g431xx

Type

Location

Description

Compatible

CPU

on-chip

ARM Cortex-M4F CPU1

arm,cortex-m4f

ADC

on-chip

STM32 ADC2

st,stm32-adc

CAN

on-chip

STM32 FDCAN CAN FD controller1

st,stm32-fdcan

Clock control

on-chip

STM32 RCC (Reset and Clock controller)1

st,stm32-rcc

on-chip

STM32 HSE Clock1

st,stm32-hse-clock

on-chip

Generic fixed-rate clock provider1 2

fixed-clock

on-chip

STM32 LSE Clock1

st,stm32-lse-clock

on-chip

STM32G4 main PLL1

st,stm32g4-pll-clock

Counter

on-chip

STM32 counters6

st,stm32-counter

DAC

on-chip

STM32 family DAC2

st,stm32-dac

DMA

on-chip

STM32 DMA controller (V2)2

st,stm32-dma-v2

on-chip

STM32 DMAMUX controller1

st,stm32-dmamux

Flash controller

on-chip

STM32 Family flash controller1

st,stm32-flash-controller

GPIO & Headers

on-chip

STM32 GPIO Controller7

st,stm32-gpio

I2C

on-chip

STM32 I2C V2 controller3

st,stm32-i2c-v2

Input

on-board

Group of GPIO-bound input keys1

gpio-keys

Interrupt controller

on-chip

ARMv7-M NVIC (Nested Vectored Interrupt Controller)1

arm,v7m-nvic

on-chip

STM32 External Interrupt Controller1

st,stm32-exti

LED

on-board

Group of GPIO-controlled LEDs1

gpio-leds

MTD

on-chip

STM32 flash memory1

st,stm32-nv-flash

on-board

Fixed partitions of a flash (or other non-volatile storage) memory1

fixed-partitions

PHY

on-chip

This binding is to be used by all the usb transceivers which are built-in with USB IP1

usb-nop-xceiv

Pin control

on-chip

STM32 Pin controller1

st,stm32-pinctrl

PWM

on-chip

STM32 PWM8

st,stm32-pwm

Reset controller

on-chip

STM32 Reset and Clock Control (RCC) Controller1

st,stm32-rcc-rctl

RNG

on-chip

STM32 Random Number Generator1

st,stm32-rng

RTC

on-chip

STM32 RTC1

st,stm32-rtc

Sensors

on-chip

STM32 family TEMP node for production calibrated sensors with two calibration temperatures1

st,stm32-temp-cal

on-chip

STM32 VREF+1

st,stm32-vref

on-chip

STM32 VBAT1

st,stm32-vbat

Serial controller

on-chip

STM32 USART1 2

st,stm32-usart

on-chip

STM32 UART1

st,stm32-uart

on-chip

STM32 LPUART1

st,stm32-lpuart

SMbus

on-chip

STM32 SMBus controller3

st,stm32-smbus

SPI

on-chip

STM32 SPI controller with embedded Rx and Tx FIFOs3

st,stm32-spi-fifo

SRAM

on-chip

Generic on-chip SRAM description1

mmio-sram

USB Type-C Port Controller

on-chip

STM32 USB Type-C / Power Delivery1

st,stm32-ucpd

Timer

on-chip

ARMv7-M System Tick1

arm,armv7m-systick

on-chip

STM32 low-power timer (LPTIM)1

st,stm32-lptim

on-chip

STM32 timers10

st,stm32-timers

USB

on-chip

STM32 USB controller1

st,stm32-usb

USB Type-C

on-board

A USB Type-C connector node represents a physical USB Type-C connector1

usb-c-connector

Watchdog

on-chip

STM32 watchdog1

st,stm32-watchdog

on-chip

STM32 system window watchdog1

st,stm32-window-watchdog

Pin Mapping

Default Zephyr Peripheral Mapping:

  • UART_2 TX/RX : PA2/PA3

  • UCPD1 CCx : PB6/PB4 (not connected by default)

  • UCPD1 DBCCx : PA9/PA10 (not connected by default)

  • BUTTON (User) : PC13

  • BUTTON (BOOT0) : PB8

  • LED0 : PC6

  • ADC (VBUS) : PB2

The ADC is disabled by default since the VBUS voltage divider is not connected in the board’s standard configuration.

Hardware Configuration

Solder bridge

Default

Description

SB1/SB2

Open

Route PC14/PC15 (LSE) to header

SB6/SB7

Open

Connect PB4/PB6 (UCPD1_CCx) to USB-C CCx pins

SB3/SB5

Open

Connect PA9/PA10 (UCPD1_DBCCx) to PB6/PB4

SB4

Open

Connect PB2 to VBUS voltage divider

SB8/SB9

Closed

Connect USB-CCx to pull-down resistors

SB10

Open

VBUS protection diode bypass

Clock Sources

The board has two external oscillators. The frequency of the slow clock (LSE) is 32.768 kHz. The frequency of the main clock (HSE) is 8 MHz.

The default configuration sources the system clock from the PLL, which is derived from HSE, and is set at 144 MHz. The 48 MHz clock used by the USB interface is derived from the PLL instead of the internal 48 MHz oscillator.

Programming and Debugging

The MCU is normally programmed using the ROM bootloader or the exposed SWD port.

Please note that some laptops may not detect the ROM bootloader correctly if the CCx pull-downs have been disconnected by opening SB8 and SB9 unless dead battery support has been enabled by closing SB3 and SB5. A USB-C to USB-A adapter can be used as a workaround if this is a problem.

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.

# From the root of the zephyr repository
west build -b weact_stm32g431_core samples/basic/blinky
west 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