Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

stm32-just

Generic just recipes for building, flashing, erasing, and resetting STM32 firmware projects that use CMake presets and the toolchain/programmer bundled with the STM32Cube VS Code extension.

It's meant to be imported into an STM32 project's own justfile - see Usage.

Requirements

  • just installed and on PATH
  • The STM32Cube VS Code extension installed, which provides:
    • the gnu-tools-for-stm32 GCC toolchain
    • the STM32_Programmer_CLI tool and an ST-LINK probe
  • A CMake project configured with presets (CMakePresets.json) named e.g. Debug / Release

Usage

Import justfile from your project's own justfile:

project := "my-firmware"

import "path/to/stm32-just/justfile"

The project variable must name your CMake target/output (i.e. the build produces build/<preset>/<project>.elf).

Recipes

Recipe Description
just configure [preset] Configure the CMake preset (default: Debug)
just build [preset] Build the firmware, configuring first if needed
just clean [preset] Delete a preset's build directory
just rebuild [preset] Clean, then build
just flash [preset] Build, flash over SWD, and reset the target
just erase Mass-erase the flash
just reset Reset the target
just size [preset] Print ELF section sizes
just bin [preset] Produce a raw .bin next to the ELF
just hex [preset] Produce an Intel .hex next to the ELF

preset defaults to Debug. Override the default globally with the STM32_DEFAULT_PRESET environment variable, e.g.:

STM32_DEFAULT_PRESET=Release just flash

or per invocation:

just flash Release

About

Generic justfile for STM32 projects

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages