2025-07-13 1:09 PM
I am using the STM32Cube VS Code extension (Preview) with the official ST-ARM-CLANG and clangd for code completion. Just ran into two issues:
1. Incomplete --query-driver config breaks C++ IntelliSense
The extension adds
--query-driver=${env:CUBE_BUNDLE_PATH}/st-arm-clang/19.1.6+st.8/bin/starm-clang.exe
to settings.json by default, but this is not enough for C++ files.
Unless you also add
--query-driver=${env:CUBE_BUNDLE_PATH}/st-arm-clang/19.1.6+st.8/bin/starm-clang++.exe
C++ IntelliSense will be broken (red squiggles, no symbols, etc).
Same issue for GCC toolchain: you need both gcc and g++ in the driver list.
2. --multi-lib-config triggers errors in clangd
If you enable --multi-lib-config, clangd just starts throwing errors about missing headers and stuff, even though the project still compiles fine.
Is this a known issue? Anyone have a workaround?
By the way, is there any official way to download the standalone ST Arm Clang toolchain (without the VSCode extension)?
It would be super useful for CI/CD or automation, similar to how STM32CubeCLT was distributed before.
Thanks!
Solved! Go to Solution.
2025-07-19 1:35 PM
To be honest, stm32cube-clangd's only job seems to be unconditionally reporting errors whenever it sees st-arm-clang options—even though these are perfectly valid for STM32. If you want real code completion, just use the regular clangd extension instead—at least it doesn't freak out over STM32's own toolchain.
2025-07-15 9:32 AM - edited 2025-07-15 10:07 PM
Same here.
I work with a VSCode workspace, and these settings are stored in the 'ProjectName.code-workspace' file.
Unfortunately, VSCode deletes the following entry every time the workspace is opened:
"--query-driver=${env:CUBE_BUNDLE_PATH}/st-arm-clang/19.1.6+st.8/bin/starm-clang++.exe".
An entry with a wildcard is replaced after opening the workspace.
"--query-driver=${env:CUBE_BUNDLE_PATH}/st-arm-clang/19.1.6+st.8/bin/starm-clang*".
=> no solution
You can see this behaviour in the attached video.
Please provide a solution for this. Thanks!
2025-07-19 1:35 PM
To be honest, stm32cube-clangd's only job seems to be unconditionally reporting errors whenever it sees st-arm-clang options—even though these are perfectly valid for STM32. If you want real code completion, just use the regular clangd extension instead—at least it doesn't freak out over STM32's own toolchain.
2025-07-21 10:47 PM
Except STM clangd extension sounds to be original one clone (per readme comment) just hacking it revisiting way to get clangd utility itself. Not sure moving back to original is helpful here.
What is your expérience so far doing it ?
2025-07-22 11:01 AM
Mainline clangd works better. It fully recognizes all st-arm-clang options and does not show any errors. Also, the settings are not messed up by STM32Cube plugin. I recommend just using official clangd.