Extension provides its own toolchain (gcc, gdb, etc.) but does not configure paths
I am using the latest (pre-release, version 3.something) official extension, on Linux.
Creating a new empty project went fairly smoothly (see my other form post about missing CMSIS headers), but when I tried to build the project, cmake couldn't find the toolchain.
It turns out that cmake was trying to run "arm-none-eabi-gcc" and so on, assuming that they would be in the current PATH! In fact, these executables are bundled with the extension and (on my Linux system) are located in
~/.local/share/stm32cube/bundles/gnu-tools-for-stm32/13.3.1+st.8/bin
No one (at least on Linux---not sure what Windows users do these days) is going to want to modify their system path to add a weird bin directory just for a single application. The right way to tell cmake where to find the tools is to either modify *its* environment or give it full paths to each tool. But the extension did not do this when it was installed---I think that is a bug because it is easy to automate.
Complicating matters further, there are several places that cmake can be told where the tools are, but it turns out some of them get overridden and hence don't work. For example, google's AI suggests to add CMAKE_C_COMPILER with the full path in CMakeLists, but that didn't work. I finally figured out that I needed to create a .vscode/settings.json file with the stanza
"cmake.environment": {
"PATH": "/home/mark/.local/share/stm32cube/bundles/gnu-tools-for-stm32/13.3.1+st.8/bin:${env:PATH}"
},(Interestingly, after I made the file, the extension added a bunch more stuff to it, but it didn't get created as part of the install.)
Again, it seems like this would be trivial for the extension to do automatically as part of the installation, since it knows exactly where the toolchain is located.
Thanks,
Mark




