Simple template for working in VS Code with STM32.
Template structure:
Example project structure:
How you can see in CubeMX directory should be files generated by CubeMX (except Core directory) such as linker script and stratup. User project files ought to be in appropriate subdirectories of Project directory.
To enter necessary data of the microcontroller, edit target.cmake, .vscode/launch.json and Makefile in root directory.
C/C++ flags and linker options are set in CMakeLists.txt and gcc-arm-none-eabi.cmake.
Template was written for a STM32F103C8.
An extension Cortex-Debug is needed for debugging. Code can be formatted with Clangd.