cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use STM32Cube command-line toolset in Ubuntu?

J-Sugihara
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
BarryWhit
Lead II

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).

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

View solution in original post

6 REPLIES 6
Pavel A.
Evangelist III

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?

 

BarryWhit
Lead II

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).

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

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?

Thank you for your suggestion!

Actually, I don't use VScode, but I will consider it if there are no other options.

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.

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.

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.