Back to Riot

Doc

boards/nucleo-g031k8/doc.md

2026.10-devel3.3 KB
Original Source
<!-- SPDX-FileCopyrightText: 2026 Hudson C. Dalpra SPDX-License-Identifier: LGPL-2.1-only -->

@defgroup boards_nucleo-g031k8 STM32 Nucleo-G031K8 @ingroup boards_common_nucleo32 @brief 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 @ref boards_common_nucleo32 page.

Pinout

MCU

MCUSTM32G031K8
FamilyARM Cortex-M0+
VendorST Microelectronics
RAM8KiB
Flash64KiB
Frequencyup to 64MHz
FPUno
Timers11 (7x 16-bit, 1x 32-bit, 2x Watchdog, 1x Systick)
ADC1x 12-bit (16 channels)
UARTs3 (two USART)
SPIs2
CANs0
RTC1
I2Cs2
Vcc1.7V - 3.6V
DatasheetDatasheet
Reference ManualReference Manual
Programming ManualProgramming Manual
Board ManualBoard 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!