Designing a PCB with the STM32G0
The STM32G0 is ST's entry-level Arm Cortex-M0+ microcontroller family, running at up to 64 MHz from a single 1.7 V to 3.6 V supply. A part such as the STM32G031 or STM32G071 needs very little around it: a 100 nF plus 4.7 µF decoupling pair, a 0.1 µF capacitor on NRST and a two-wire SWD header. Its internal 16 MHz RC oscillator is factory-calibrated to 1 %, so a crystal is optional for many designs.
- Core
- Arm Cortex-M0+, up to 64 MHz
- Flash / SRAM
- STM32G031: up to 64 KB / 8 KB; STM32G071: up to 128 KB / 36 KB
- Supply
- 1.7 V to 3.6 V (VBAT 1.55 V to 3.6 V)
- Clocks
- 4 to 48 MHz crystal oscillator, internal 16 MHz RC (±1 %), 32 kHz crystal or RC
- USB
- None on G031; USB Type-C PD controller on G071; USB 2.0 FS device and host on G0B1
- Packages
- STM32G031: SO8N and WLCSP18 up to LQFP48; STM32G071: up to LQFP64 and UFBGA64
- Debug
- SWD on PA13 (SWDIO) and PA14 (SWCLK)
- Board plans in Cuprio using it
- 10 (as of 27 November 2026)
What is the STM32G0 family?
The STM32G031 has up to 64 KB of flash and 8 KB of SRAM in packages from an 8-pin SO8N to 48 pins. The STM32G071 steps up to 128 KB of flash, 36 KB of SRAM, two DACs and a USB Type-C Power Delivery controller, in up to 64 pins. Neither has a USB data port; the STM32G0B1 adds a crystal-less USB 2.0 full-speed controller. All share the same power, reset, boot and debug scheme.
How many decoupling capacitors does an STM32G0 need?
On most G0 packages VDD and VDDA share one pin, as do VSS and VSSA. ST asks for a 100 nF ceramic decoupling capacitor plus about 4.7 µF on that pair, as close as possible to the pins or directly under them, with short vias into a solid ground plane. A separate VDDIO2 pin gets its own 100 nF.
If the internal reference buffer drives VREF+, decouple that pin with 100 nF plus 1 µF. Below 2 V, VREF+ must equal VDDA; above 2 V it may sit anywhere from 2 V to VDDA. The core runs from an embedded linear regulator, so the board only supplies VDD. VBAT keeps the RTC alive from 1.55 V; with no battery, tie it to VDD.
Does the STM32G0 need a crystal?
Not always. The HSI16 RC oscillator is factory-calibrated to 1 % at 25 °C, enough for a UART and most timing. The HSE crystal oscillator takes 4 to 48 MHz, and ST recommends load capacitors of 5 to 20 pF each. The crystal's specified load is the series combination of the two capacitors plus about 10 pF of pin and board capacitance, so a crystal rated for 20 pF needs roughly 2 × (20 − 10) = 20 pF on each side. ST's reference design uses an 8 MHz crystal with 20 pF capacitors and an optional 390 Ω series resistor, and a 32.768 kHz crystal with 10 pF capacitors for the RTC. Keep the crystal and its capacitors right at the oscillator pins.
How do BOOT0, NRST and SWD work on the STM32G0?
By default the boot source comes from option bytes, and BOOT0 shares a pin with PA14 (SWCLK). If the first flash word reads 0xFFFF FFFF, the empty check boots the ROM bootloader, so a blank chip can be programmed over USART (PA9/PA10 or PA2/PA3) or I2C (PB6/PB7 or PB10/PB11) on the STM32G031. After that first programming, a power cycle is needed before your code runs.
NRST has a 25 to 55 kΩ internal pull-up, and ST recommends a 0.1 µF capacitor close to the pin. Option bits can turn NRST into the PF2 GPIO. SWD needs only PA13 (SWDIO, internal pull-up) and PA14 (SWCLK, internal pull-down), with no external resistors. Wire NRST to the debug header too.
Common STM32G0 layout mistakes
- Decoupling capacitors placed far from the VDD/VDDA pin, or connected through long thin tracks instead of short vias.
- Driving two pads of a multi-bonded pin on 8- and 20-pin packages at once: several GPIOs share one package pin, and nothing on the die prevents them from fighting.
- Expecting a SPI bootloader on the STM32G031: its datasheet lists USART and I2C only.
- Picking a G031 or G071 for a USB data port: only the G0B1 and G0C1 lines have the USB peripheral.
- Leaving unused I/Os floating instead of tying them to a fixed level or setting them as outputs.
- Leaving NRST off the SWD connector, so a stuck board cannot be reset from the debugger.
Checking an STM32G0 board
An open VBAT or VREF+ pin shows up in the netlist before layout. Cuprio checks the schematic with electrical rule checks.
Sources
- STMicroelectronics: AN5096 Getting started with STM32G0 MCUs hardware development (Rev 4)st.com
Supplies, decoupling, VREF+, VBAT, reset, HSI16 calibration, HSE/LSE, boot modes, empty check, SWD, reference design values, layout rules
- STMicroelectronics: STM32G031x4/x6/x8 datasheet DS12992st.com
STM32G031 memory, packages, clocks, power supply scheme, crystal load capacitors, NRST pull-up and 0.1 µF capacitor, bootloader interfaces
- STMicroelectronics: STM32G071x8/xB datasheet DS12232st.com
STM32G071 memory, DACs, USB Type-C PD controller, packages
- STMicroelectronics: STM32G0B1xB/xC/xE datasheet DS13560st.com
STM32G0B1 crystal-less USB 2.0 full-speed device and host controller
