This directory contains example workflows for building STM32 firmware using the stm32-build reusable workflow.
| Example | Description | Use Case |
|---|---|---|
| basic-makefile.yml | Simple Makefile build | STM32CubeMX generated projects |
| cmake-project.yml | CMake-based build | Complex projects with CMake |
| cubeide-project.yml | STM32CubeIDE headless build | Native CubeIDE projects |
| multi-mcu-matrix.yml | Matrix build for multiple MCUs | Products supporting multiple STM32 variants |
| industrial-release.yml | Secure release pipeline | Safety-critical applications |
For STM32CubeMX generated projects:
name: STM32 Build
on:
push:
branches: [main]
pull_request:
jobs:
build:
uses: bauer-group/automation-templates/.github/workflows/stm32-build.yml@main
with:
build-system: makefile
target-mcu: STM32F407VGFor CMake-based projects:
jobs:
build:
uses: bauer-group/automation-templates/.github/workflows/stm32-build.yml@main
with:
build-system: cmake
target-mcu: STM32H743ZI
cmake-toolchain: cmake/arm-none-eabi.cmakeFor tagged releases:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
uses: bauer-group/automation-templates/.github/workflows/stm32-build.yml@main
with:
config-file: industrial
create-release: true| Template | Description |
|---|---|
default |
Standard projects, basic settings |
industrial |
Safety-critical with MISRA checks |
prototype |
Fast iteration, debug builds |
low-power |
Optimized for battery devices |
| Family | Core | Typical Use |
|---|---|---|
| STM32F0 | Cortex-M0 | Entry-level |
| STM32F1 | Cortex-M3 | Mainstream |
| STM32F4 | Cortex-M4F | High-performance |
| STM32F7 | Cortex-M7 | High-performance |
| STM32G0 | Cortex-M0+ | Cost-optimized |
| STM32G4 | Cortex-M4F | Motor control |
| STM32H7 | Cortex-M7 | Highest performance |
| STM32L0/L4 | Cortex-M0+/M4 | Ultra-low-power |
| STM32WB/WL | Cortex-M4/M0+ | Wireless |
my-stm32-project/
├── .github/
│ └── workflows/
│ └── build.yml
├── Core/
│ ├── Inc/
│ └── Src/
│ └── main.c
├── Drivers/
│ ├── CMSIS/
│ └── STM32F4xx_HAL_Driver/
├── Makefile
├── STM32F407VGTx_FLASH.ld
└── startup_stm32f407vgtx.s
my-stm32-project/
├── .github/
│ └── workflows/
│ └── build.yml
├── cmake/
│ └── arm-none-eabi.cmake
├── src/
│ └── main.c
├── include/
├── CMakeLists.txt
└── STM32F407VGTx_FLASH.ld
The workflow uses the xPack ARM GCC toolchain.
Available versions:
13.3.rel1- Latest (recommended)12.3.rel1- Previous stable11.3.rel1- Older stable
The toolchain is installed automatically. Check runner logs for installation errors.
Ensure your project-path points to the directory containing the Makefile.
Check that your .ld file is referenced correctly in the Makefile or CMake.
Verify the ELF file is being generated and the path is correct.