cancel
Showing results for 
Search instead for 
Did you mean: 

Why this extension do not USE environment variables?

AlanCui4080
Associate II

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

3 REPLIES 3
Cartu38 OpenDev
Lead II

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.

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

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