Skip to main content

BSP Overview

Supported STM32 families: F4 · G4 · H5 · U5
Not supported: H7, L4

The BSP module provides all necessary components to initialize and support the hardware of STM32 microcontrollers for a given MCU family.

Each STM32 family is available in a separate Git branch. For example, the branch STM32U5 contains all BSP components required for the U5 family.

Structure​

  • Linker Module
    Generates the linker script according to the MCU type selected by the user.

  • Startup Module

    • Calls the user application entry point.
    • Initializes memory sections (RAM, .data, .bss, etc.).
    • Executes C++ constructors if C++ is used.
  • MCAL Module
    Provides low-level drivers and peripheral access for the MCU.

  • RAL Module
    Provides unified access to peripheral libraries (abstracted LL/CMSIS headers) across all MCU families.

  • HAL Module
    Provides the high-level hardware abstraction for easier peripheral control.

  • CMake Configuration
    The BSP module sets up the compiler and build options according to the selected MCU family.
    Each family branch contains the appropriate CMake toolchain and configuration for that family.

Usage​

  • Clone the BSP repository and checkout the branch corresponding to your target MCU family, e.g.:
git clone <repo_url> bsp_project
cd bsp_project
git checkout STM32U5
  • Include the necessary BSP modules in your project via CMakeLists.txt.
  • The linker script, startup code, MCAL, RAL, and HAL are automatically configured based on the selected MCU family.

Branching Strategy​

  • Each STM32 family has its own branch:
    • STM32U5 – includes BSP for U5 family
    • STM32H5 – includes BSP for H5 family
    • STM32H7 – includes BSP for H7 family
    • STM32G4 – includes BSP for G4 family
    • … and others

This allows the user to work with the same BSP interface while supporting multiple MCU families through branches.

Notes​

  • Do not mix files from different MCU family branches.
  • Always build the project from the branch corresponding to the target MCU.
  • CMake automatically selects the correct toolchain and compiler flags for the selected family.

License​

This project is licensed under the Creative Commons Attribution–NonCommercial 4.0 International (CC BY-NC 4.0).

You are free to use, modify, and share this work for non-commercial purposes, provided appropriate credit is given.

See LICENSE.md for full terms or visit creativecommons.org/licenses/by-nc/4.0.


Authors​

Contributions are welcome! Please open a pull request.


Family support​

F4G4H5H7L4U5
Linker✅✅✅✅✅✅
Docs✅✅✅——✅
RAL✅✅✅✅✅✅
MCAL✅✅✅——✅