Application note AN-20 · U20ABSTRACT
STM32 Homebrew fix
Product status
- Idea
- Design
- Build
- Shipped
- In use
If you build CubeMX projects in VS Code on a Mac with Homebrew's arm-none-eabi-gcc, two things usually break: the toolchain has no newlib, and the Makefile points at a gcc without a sysroot. This script fixes both.
1From the README
STM32 project fix script for macOS.
Run this from any STM32CubeMX project directory generated for VS Code to fix the two most common build failures when using Homebrew arm-none-eabi-gcc:
-
Updates .stm32env (used by STM32Make.make / STM32-for-VSCode extension) to point ARM_GCC_PATH at an ARM GNU Toolchain that bundles newlib.
-
Patches the CubeMX-generated Makefile so the -isystem flag points at a gcc that actually has a sysroot (so #include_next
resolves).