Skip to content

Instantly share code, notes, and snippets.

@GaryLee
Last active September 19, 2024 17:15
Show Gist options
  • Save GaryLee/25101eccd50be9997e08cf21c39567bc to your computer and use it in GitHub Desktop.
Save GaryLee/25101eccd50be9997e08cf21c39567bc to your computer and use it in GitHub Desktop.
Build STM32CubeIDE project from command line.
@ECHO OFF
@REM By check the headless-build.bat which come along with STM32CubeIDE.
@REM we can invoke the build process without invoking the GUI.
@REM Set PATH for STM32CubeIDE.
SET "CUBEIDE_PATH=C:\ST\STM32CubeIDE_1.14.0\STM32CubeIDE"
SET OLD_PATH=%PATH%
SET PATH=%CUBEIDE_PATH%;%PATH%
@REM Use stm32cubeidec.exe to build the project in specified workspace.
SET "WORKSPACE=Your workspace path here"
SET "PROJECT=Your project name here"
SET HEADLESS=--launcher.suppressErrors -nosplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild
stm32cubeidec.exe %HEADLESS% -build %PROJECT% -data "%WORKSPACE%"
SET PATH=%OLD_PATH%
ECHO ON
@TDERL
Copy link

TDERL commented Sep 19, 2024

Very helpful. Thank you.
How can I get it to only build the debug configuration and not the release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment