Skip to content

Adopts CMake build system and updates STM32CubeG4#1

Open
gdepuille wants to merge 5 commits into
mainfrom
new-build
Open

Adopts CMake build system and updates STM32CubeG4#1
gdepuille wants to merge 5 commits into
mainfrom
new-build

Conversation

@gdepuille

Copy link
Copy Markdown
Member

This pull request migrates the project to a CMake-based build system for improved flexibility and maintainability. It also includes updating the STM32CubeG4 HAL and CMSIS drivers to their latest versions, bringing various bug fixes and enhancements, and introducing comprehensive thread-safety mechanisms.

Key Changes

  • Switches the project from STM32CubeIDE's internal build system to CMake, leveraging CMakePresets for configuration.
  • Upgrades the STM32CubeG4 HAL and CMSIS firmware package, incorporating bug fixes and device support enhancements.
  • Integrates newlib locking glue and STM32-specific thread-safety mechanisms, including configurable locking strategies for baremetal and FreeRTOS environments.
  • Updates pre-commit hooks to their latest version and refines their configuration.
  • Modifies IDE configuration files (.idea/) to align with the new CMake setup and debugging targets.
  • Introduces new GCC and Clang toolchain files for CMake, along with updated linker scripts and startup file.
  • Includes various patches and fixes to the updated HAL drivers, such as I2C timing, DMA abort logic, and const-correctness.

Checklist

  • Code has been tested
  • Documentation has been updated
  • Release notes have been drafted

Migrates the project to a CMake-based build system for improved portability and toolchain flexibility.

Includes:
- Reworked CMake configuration with support for GCC ARM Embedded and STARM-Clang toolchains.
- Introduction of `CMakePresets.json` for standardized build and configure presets.
- Integration of Newlib locking glue and an STM32 lock mechanism to enable C/C++ thread-safety for standard library functions and static initializers.
- Update of STM32CubeMX to 6.17.0 and STM32Cube FW_G4 HAL to V1.6.3, which provides various bug fixes, API `const`-correctness, and updated peripheral register definitions.
- Updated linker script with TLS support and refined `.idea` files for seamless CLion IDE integration.
@gdepuille gdepuille self-assigned this Jun 7, 2026
gdepuille added 3 commits June 8, 2026 10:41
Update linker script to start application code at 0x08008000, reserving the initial 32KB of Flash for OpenBootloader.
Enable `USER_VECT_TAB_ADDRESS` in `system_stm32g4xx.c` to account for this offset in vector table management.
Replaces `apt-get` based ARM toolchain installation with `carlosperate/arm-none-eabi-gcc-action` for improved reliability and explicit version pinning. Also upgrades CMake to version 4.3.3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant