synix/templates/dev/stm32-blink/README.md
sid 93c8d40a98
Some checks failed
Flake check / flake-check (pull_request) Failing after 6s
Build tests / build-hosts (pull_request) Successful in 24s
add stm32 dev template
2026-05-07 18:57:46 +02:00

28 lines
640 B
Markdown

# STM32G4 blink template
Blinks the LD2 LED (PA5) on a [Nucleo-G474RE](https://www.st.com/en/evaluation-tools/nucleo-g474re.html) using [libopencm3](https://github.com/libopencm3/libopencm3).
Set `BLINK_PORT` / `BLINK_PIN` for your board in [`src/main.c`](./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
```bash
make
```
## Flash
```bash
make flash
```
This uses OpenOCD with the built-in ST-Link interface config.