2026-01-14 6:30 AM
I had a Windows account with a space in user folder name (between forename and surname). VScode was installed under AppData subfolder. As a result CMake generated paths like this into compile_commands.json:
"command": "C:\\Users\\MIKKLE~1\\AppData\\Local\\STM32C~1\\bundles\\GNU-TO~2\\1431_S~1.2\\bin\\AR19DD~1.EXE -DDEBUG....
Most of the things worked (compiling and debugging), but vscode highlighted that it can't find includes like these:
#include <stdio.h>
#include <assert.h>
To be correct, clangd language server couldn't find them. Absence of these headers caused further errors. But when resolving other headers like stdint.h, clangd found them from st-arm-clangd bundle folder instead of compiler folder.
The workaround was to add the very same shortened path as query driver into .vscode\settings.json:
"--query-driver=C:\\Users\\MIKKLE~1\\AppData\\Local\\STM32C~1\\bundles\\GNU-TO~2\\1431_S~1.2\\bin\\AR19DD~1.EXE"
It solved the clangd issue temporarily until ST tools rewrote settings.json.
I thought it's the classical long path issue, but enabling long paths in Windows registry and forcing CMake to use longer paths (512 characters) did not solve it.
After removing space from my Windows user folder it started working normally.
Quick guide: Create temporary admin user, reboot, login with new user, rename user folder and update it in registry path HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. Expect trouble with some applications.
I don't know whether it should be solved in CMake, clangd, ST vscode toolset or just made as an installation time warning. I hope ST team decides. So far maybe it helps somebody with the same issue.
2026-01-14 7:03 AM
This is common.
Lots of things won't work with spaces (or other "special" characters) in folder and/or file names.
Only the other day:
2026-01-14 7:25 AM
Yep, unfortunately it is. I've put my ST tools usually under C:\ST due to such reasons and keep code in shallow path, but now vscode wants to be in user folder and I didn't see this one coming :(
Thanks for the links @Andrew Neil . I had some other strange issues, I'll check if something could be related.
Tip for those who rename their Windows user folder. CubeMX needs some manual help - parameter RepositoryPath needs to be updated in C:\Users\Username\.stm32cubemx\plugins\updater\updater.ini file.