STM32 Nucleo-G031K8
Support for the STM32 Nucleo-G031K8 board.
Support for the STM32 Nucleo-G031K8 board.
General information
The Nucleo-G031K8 is a board from ST’s Nucleo family supporting ARM Cortex-M0+ STM32G031K8 microcontroller with 8KiB of RAM and 64KiB of Flash.
You can find general information about the Nucleo32 boards on the boards_common_nucleo32 page.
Pinout
MCU
| MCU | STM32G031K8 |
|---|---|
| Family | ARM Cortex-M0+ |
| Vendor | ST Microelectronics |
| RAM | 8KiB |
| Flash | 64KiB |
| Frequency | up to 64MHz |
| FPU | no |
| Timers | 11 (7x 16-bit, 1x 32-bit, 2x Watchdog, 1x Systick) |
| ADC | 1x 12-bit (16 channels) |
| UARTs | 3 (two USART) |
| SPIs | 2 |
| CANs | 0 |
| RTC | 1 |
| I2Cs | 2 |
| Vcc | 1.7V - 3.6V |
| Datasheet | Datasheet |
| Reference Manual | Reference Manual |
| Programming Manual | Programming Manual |
| Board Manual | Board Manual |
Flashing the board
A detailed description about the flashing process can be found on the
guides page.
The board name for the Nucleo-G031K8 is nucleo-g031k8.
Reset configuration
Some boards ship with the NRST_MODE option byte set to 2 (the documented
default is 3), which turns the NRST pin into the PF2 GPIO and disables its
reset function, so the reset button, the NRST pin and the ST-Link reset no
longer reset the MCU. RIOT works around this by resetting over SWD
(reset_config none), so make flash always works.
To restore the hardware reset, set NRST_MODE to 1 or 3. The easiest way
to do this is to use STM32CubeProgrammer, which is available for Linux,
Mac (x86 and ARM) and Windows on the
ST website.
Warning: If your program crashes after startup, it might become impossible to
reset and flash the microcontroller if the software reset
is enabled! The microcontroller would be bricked in this case.
You can try to power up the microcontroller with the BOOT0 pin pulled
high to enter the bootloader and then connect with e.g.
STM32CubeProgrammer to erase the flash memory. This suggestion
is not tested yet!
Note: STM32CubeProgrammer v2.22 from February 2026 has a bug that prevents writing the Option Bytes. Use an older or newer version instead!