cancel
Showing results for 
Search instead for 
Did you mean: 

CMake error when building STM32 project outside STM32CubeIde

MaxC
Associate III

Hello everybody,

I'm trying to build an STM32 simple example based on CMake from the Windows shell but I got an error (I think because CMake doesn't find the GCC STM32CubeIde toolchain configuration).

If I run CMake from STM32CubeIde all works fine (I think because "the location of the toolchain is resolved by the "MCU Toolchain" project setting (via PATH)" as stated by the cubeide-gcc.cmake file).

I'm using STM32CubeIDe v 1.14.1

I started from the example shown in AN5952 doc.

I'm just wondering what is the additional option I have to set to build the example in Windows but outside the STM32CubeIde.

I attached a snapshot of the error. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
MaxC
Associate III

I added the path of STM32CubeIde Gnu and Make tools in the Windows PATH env variable. 

ex (for STM32CubeIde ver 1.14.1)

set PATH=C:\ST\STM32CubeIDE_1.14.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235\tools\bin;%PATH%

set PATH=C:\ST\STM32CubeIDE_1.14.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.make.win32_2.1.101.202401061624\tools\bin;%PATH%

 

View solution in original post

4 REPLIES 4
MaxC
Associate III

Ok, I found a solution.

For the benefit of others with the same problem who may find this, please describe your solution.

And Mark that as The Solution.

MaxC
Associate III

I added the path of STM32CubeIde Gnu and Make tools in the Windows PATH env variable. 

ex (for STM32CubeIde ver 1.14.1)

set PATH=C:\ST\STM32CubeIDE_1.14.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.11.3.rel1.win32_1.1.100.202309141235\tools\bin;%PATH%

set PATH=C:\ST\STM32CubeIDE_1.14.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.make.win32_2.1.101.202401061624\tools\bin;%PATH%

 

mattias norlander
ST Employee

Yes, you would need to setup the paths yourself. It is normally considered bad practice to have development tools contribute paths to the system PATH variable since that could mess with other existing build infrastructure on the customers PC. This is why we contain that "path management" within the CubeIDE environment.

In the VS Code based IDE, we cannot take that approach since we (ST) do not control the CMake extensions from Microsoft. Consequently we currently let the STM32CubeCLT package add paths for CMake and GCC (and some other tools) to the OS PATH variable.