Skip to main content
Associate II
May 10, 2025
Solved

Why this extension do not USE environment variables?

  • May 10, 2025
  • 1 reply
  • 1008 views

STM32CLT has written an environment variable %STM32CLT_PATH% when it was installed, and the "armToolchainPath" is specified also in launch.json. Why not use it when creating a project, and try to search for the tool chain in PATH? Instead, you people write the entire toolchain into system-wide PATH, that will stop other MCU's toolchain from working!  

To Fix:

 
change cmake/gcc-arm-none-eabi.cmake:11 and following to:

cmake_path(SET TOOCHAIN_PATH $ENV{STM32CLT_PATH} )
set(TOOLCHAIN_PREFIX ${TOOCHAIN_PATH}/GNU-tools-for-STM32/bin/arm-none-eabi-)

set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc${CMAKE_HOST_EXECUTABLE_SUFFIX})
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++${CMAKE_HOST_EXECUTABLE_SUFFIX})
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}g++${CMAKE_HOST_EXECUTABLE_SUFFIX})
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy${CMAKE_HOST_EXECUTABLE_SUFFIX})
set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size${CMAKE_HOST_EXECUTABLE_SUFFIX})

that's quite bit easy

Best answer by AlanCui4080

AlanCui4080_0-1746926652673.png

Thank you! i switched it to latest STM32Cube Extension, and now it finally can manage toolchain by itself.

It provided much better experience than old one, and i will advise it to all my mates.

if i can know when it can be a stable release?

1 reply

Cartu38 OpenDev
Graduate II
May 10, 2025

Have you got a chance to try brand new released solution ? STM32CubeCLT is not required anymore ! Some brand new integrated solution is promoted instead so called STM32Cube bundles serving the same but revisited experience. May help possibly.

Associate II
May 10, 2025

STM32CubeCLT is necessary for this extension as far as i know. The STM32CubeIDE as eclipse is much worse than VS Code.

Cartu38 OpenDev
Graduate II
May 10, 2025

Not for the brand new VSCode solution. Released 3 dans agora as pre-release. See pinned post.