2024-06-30 06:13 AM
I want to build my stm32cubeide code from CLI, and thought STM32CubeCLI https://www.st.com/en/development-tools/stm32cubeclt.html#documentation would be useful. However, its user manual https://www.st.com/resource/en/user_manual/um3088-stm32cube-commandline-toolset-quick-start-guide-stmicroelectronics.pdf only provides some simple examples in the case of Windows.
Does anyone know the information about the usage of STM32CubeCLI?
Solved! Go to Solution.
2024-06-30 07:38 AM - edited 2024-07-01 03:40 AM
Your question was specifically about CubeIDE. But, if you do choose to go for CMake based project, and prefer CLI flows in general, be aware that there is also the (more recent) STM32 extension for VScode which ST offers. They use CubeMX for code generation of CMake projects and VSCode as an IDE. You can certainly build CMake from command line, and you can still use CubeIDE for "debuggering". I haven't tried the extensions myself, but there are threads about them on this forum (and maybe knowledge base).
2024-06-30 07:09 AM
You can build from CLI in two ways: use the "headless Eclipse CDT" command or use make or CMake. If you already have a CubeIDE project, the first method is preferred. Do you have any specific question or issue with the tools?
2024-06-30 07:38 AM - edited 2024-07-01 03:40 AM
Your question was specifically about CubeIDE. But, if you do choose to go for CMake based project, and prefer CLI flows in general, be aware that there is also the (more recent) STM32 extension for VScode which ST offers. They use CubeMX for code generation of CMake projects and VSCode as an IDE. You can certainly build CMake from command line, and you can still use CubeIDE for "debuggering". I haven't tried the extensions myself, but there are threads about them on this forum (and maybe knowledge base).
2024-06-30 09:46 PM
Thank you for your response!
I already have the STM32CubeIDE project and want to build the project using .project and .cproject files. Although I'm not sure how to use "headless Eclipse CDT" you suggested, is it possible to execute the build like this?
2024-06-30 10:59 PM
Thank you for your suggestion!
Actually, I don't use VScode, but I will consider it if there are no other options.
2024-07-01 03:28 AM
Yes, it is exactly to build from command line. Just google and you'll find the details. Also read about this in the CubeIDE user manual.
2024-07-01 04:00 AM - edited 2024-07-01 04:14 AM
See this thread for headless build
But there's also the "STM32CubeCLT: stm32cube commandline toolset" package.
It has its own User manual which seems pretty succinct:
UM3088: stm32cube commandline toolset quick start guide
When you compile within CubeIDE it prepares a build folder called "Debug" or "Release". Inside it you will find a plain old makefile which the ide generates from the project files. If you have clt installed (and in your PATH), it should be as simple as "make".
FYI,
CubeIDE itself bundles a cross-compilation toolchain for ARM (GCC, ld and friends). It lives under
"<STM32CubeIDE Root>\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235\tools\"
It also bundles a bunch of tools ported from unix: bash, make, other
these live under
com.st.stm32cube.ide.mcu.externaltools.make.win32_2.1.101.202401061624
But it's be simpler to have the CLT installer prepare everything for you.