Search code examples
stm32visual-studio-codemicrocontrollercubemx

How to configure Visual Studio Code to build and debug STM32 projects using STM32CubeMX - Windows 10


I am new to the realm of STM32 programming and have been trying to find a suitable IDE for quite a while now. I know of all the other IDEs, like Keil and IAR, but the cost of buying them just to learn is far too steep for me at this point in time.

I have started using Visual Studio Code for a growing amount of my development work and I thought it would be a good IDE to use for STM32 development. I have found many examples online over the past few days on how to configure the IDE to build STM32 projects, but they all seem to be missing important information that I need to properly get the project to compile. It is rather frustrating,

Is there a complete setup guide on how to set up Visual Studio Code to work with STM32CubeMX and the ARM toolchain? Or is there a sample project that I can use as a base learn from?

Just some background information, I know how to use STM32CubeMX to generate the base project as well as the associated makefile, I also have the latest GNU-Tools-Arm-Embedded installed.


Solution

  • A while ago I had the same question, but I did not find anything that I really liked. So I created STM32 for Visual Studio Code. It is an extension for Visual Studio Code which works with STM32CubeMX-generated files and sets up building and debugging for you.