synix/templates/dev/stm32-blink
sid ecf5132cbb
Some checks failed
Build tests / build-hosts (pull_request) Failing after 3s
Flake check / flake-check (pull_request) Failing after 13s
enforce new flake schema. formatting.
2026-05-31 18:50:41 +02:00
..
src add stm32 dev template 2026-05-07 18:57:46 +02:00
.envrc enforce new flake schema. formatting. 2026-05-31 18:50:41 +02:00
.gitignore add stm32 dev template 2026-05-07 18:57:46 +02:00
build.sh add stm32 dev template 2026-05-07 18:57:46 +02:00
flake.nix add stm32 dev template 2026-05-07 18:57:46 +02:00
Makefile add stm32 dev template 2026-05-07 18:57:46 +02:00
README.md add stm32 dev template 2026-05-07 18:57:46 +02:00

STM32G4 blink template

Blinks the LD2 LED (PA5) on a Nucleo-G474RE using libopencm3.

Set BLINK_PORT / BLINK_PIN for your board in src/main.c.

Toolchain

The Nix dev shell provides:

  • arm-none-eabi-gcc (via gcc-arm-embedded)
  • openocd for flashing and debugging
  • stlink utilities (st-flash, st-info)
  • libopencm3 built for stm32/g4 (exposed as $LIBOPENCM3_DIR)

Build

make

Flash

make flash

This uses OpenOCD with the built-in ST-Link interface config.