# ANN: New configurable STM32 bareboard runtimes

**URL:** <https://forum.ada-lang.io/t/ann-new-configurable-stm32-bareboard-runtimes/2198>\
**Category:** Releases\
**Tags:** bare-board, embedded, gnat, runtime\
**Created:** [July 8, 2025, 10:45am UTC](https://forum.ada-lang.io/t/ann-new-configurable-stm32-bareboard-runtimes/2198 "2025-07-08T10:45:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![damaki](https://forum.ada-lang.io/letter_avatar_proxy/v4/letter/d/3bc359/32.png) [@damaki](https://forum.ada-lang.io/u/damaki)\
**Post date:** [July 8, 2025, 10:45am UTC](https://forum.ada-lang.io/t/ann-new-configurable-stm32-bareboard-runtimes/2198/1 "2025-07-08T10:45:35Z")

</div>

I’ve recently released a some configurable bareboard runtime crates for several STM32 families, with support for the light, light-tasking, and embedded runtime profiles:

- STM32F0xx crates (GitHub page: [GitHub - damaki/stm32f0xx-runtimes: GNAT Ada runtimes for the STM32F0 family](https://github.com/damaki/stm32f0xx-runtimes/)):
  - [light\_stm32f0xx](https://alire.ada.dev/crates/light_stm32f0xx)
  - [light\_tasking\_stm32f0xx](https://alire.ada.dev/crates/light_tasking_stm32f0xx)
  - [embedded\_stm32f0xx](https://alire.ada.dev/crates/embedded_stm32f0xx)

- STM32G0xx crates (GitHub page: [GitHub - damaki/stm32g0xx-runtimes: GNAT Ada runtimes for the STM32G0 family](https://github.com/damaki/stm32g0xx-runtimes/)):
  - [light\_stm32g0xx](https://alire.ada.dev/crates/light_stm32g0xx)
  - [light\_tasking\_stm32g0xx](https://alire.ada.dev/crates/light_tasking_stm32g0xx)
  - [embedded\_stm32g0xx](https://alire.ada.dev/crates/embedded_stm32g0xx)

- STM32G4xx crates (GitHub page: [GitHub - damaki/stm32g4xx-runtimes: GNAT Ada runtimes for the STM32G4 family](https://github.com/damaki/stm32g4xx-runtimes/)):
  - [light\_stm32g4xx](https://alire.ada.dev/crates/light_stm32g4xx)
  - [light\_tasking\_stm32g4xx](https://alire.ada.dev/crates/light_tasking_stm32g4xx)
  - [embedded\_stm32g4xx](https://alire.ada.dev/crates/embedded_stm32g4xx)

The runtimes are based on GNAT FSF 15, but I could do releases for older versions of GNAT if there’s a demand for it.

Each runtime supports every device in the family. The runtime is configured for a specific device via crate configuration variables. For example, to configure the light\_tasking\_stm32g4xx runtime for the STM32G431K6 device, add the following to your project’s `alire.toml`:

```toml
[configuration.values]
light_tasking_stm32g4xx.MCU_Sub_Family = "G431"
light_tasking_stm32g4xx.MCU_Flash_Memory_Size = "6"

```

The clock tree is also configurable. By default the runtime sets up the system clock from the PLL and the high-speed internal (HSI) oscillator, but you can also configure it for the HSE if your board has one (some Nucleo boards seem to have one) or configure a different clock speed if you want. Here’s an example of configuring the light\_tasking\_stm32g4xx runtime to generate a 170 MHz sytem clock from a 24 MHz HSE oscillator in `alire.toml`:

```toml
[configuration.values]
# Configure a 24 MHz HSE crystal oscillator
light_tasking_stm32g4xx.HSE_Clock_Frequency = 24000000
light_tasking_stm32g4xx.HSE_Bypass = false

# Select PLLRCLK as the SYSCLK source
light_tasking_stm32g4xx.SYSCLK_Src = "PLLRCLK"

# Configure the PLL VCO to run at 340 MHz from the 24 MHz HSE (fVCO = fHSE * (N/M))
light_tasking_stm32g4xx.PLL_Src = "HSE"
light_tasking_stm32g4xx.PLL_N_Mul = 85
light_tasking_stm32g4xx.PLL_M_Div = 6

# Configure the PLLRCLK to run at 170 MHz from the 340 MHz VCO.
light_tasking_stm32g4xx.PLL_R_Div = 2

# Configure the AHB and APB to also run at 170 MHz
light_tasking_stm32g4xx.AHB_Pre = "DIV1"
light_tasking_stm32g4xx.APB1_Pre = "DIV1"
light_tasking_stm32g4xx.APB2_Pre = "DIV1"

```

See the projects’ GitHub pages (links above) for full details of what is configurable.

The hope is that these runtimes are flexible and easy-to-use enough that they help people get started with a new STM32 project quickly, without needing to build their own runtimes for their specific device/board since they can use and configure these runtimes instead.
