ObKo/stm32-cmake logo

ObKo/stm32-cmake

Free

CMake for stm32 developing.

FreeFree tier
Type
Open Source

About ObKo/stm32-cmake

ObKo/stm32-cmake is an open-source CMake project for developing applications on STM32 microcontrollers (ARM Cortex-Mx series). It provides CMake toolchain files, modules for device family detection (including RAM/flash sizes, CPU types), linker script generation, and integration with CMSIS and STM32 HAL libraries. The project supports a wide range of STM32 families (C0, F0-F4, F7, G0, G4, H7, L0-L5, U0, U5, WB, WL) and includes example projects such as blinky and FreeRTOS to help developers get started quickly.

Key Features

CMake toolchain file for ARM GCC cross-compilation
Device family support for STM32 C0/F0/F1/F2/F3/F4/F7/G0/G4/H7/L0/L1/L4/L5/U0/U5/WB/WL
Automated linker script generation with tunable RAM/flash sizes
CMake modules to find and configure CMSIS and STM32 HAL libraries
Integration with newlib and STM32Cube packages
Example projects including blinky, FreeRTOS, and custom linker scripts
Support for FetchContent to pull STM32Cube from ST's Git repositories

Pros & Cons

Pros
  • Open source and free to use
  • Supports a broad range of STM32 device families
  • CMake-based, enabling integration with existing build workflows
  • Includes ready-made examples for common use cases
  • Generates linker scripts automatically based on device specifications
  • Modular design allows easy integration with CMSIS, HAL, and RTOS libraries
Cons
  • Requires manual setup of GCC toolchain and STM32Cube paths
  • Not a complete IDE; users need to configure their own build environment
  • Limited documentation beyond the README and examples
  • May have a learning curve for developers new to CMake and cross-compilation

Best For

Embedded firmware development for STM32 microcontrollersBuilding and debugging STM32 projects with CMake and GCCLearning STM32 development with example templates (blinky, FreeRTOS)Automating STM32 project configuration in CI/CD environmentsDeveloping custom linker scripts for STM32 memory layouts