step 9: Now it is time to install VScode, so go to: https://code.visualstudio.com/#alt-downloads and download the latest stable system installer for your OS (windows 64 bits in our case).
step 10: Go through the first installation steps, when the setup askes you which additional tasks should be preformed, make sure you have selected: “Add to PATH (requires shell restart)”.
step 11: Finish the install of Visual Studio Code, when it is finised launch VS code.
step 12: When you have launched VS code, go to the blocks icon on the left side of the window, hit: “CTRL + SHIFT + X” or press ctrl+shift+P to open the command pallete, type in the command pallete:
View: Show Extensions
step 13: Now that you have opened the extentions tab search for: “stm32-for-vscode”, this (https://marketplace.visualstudio.com/items?itemName=bmd.stm32-for-vscode) extentions is created by: “Bureau Moeilijke Dingen”. When you found the right extention install the extension by clicking the install button on the extention page.
step 14: If you skipped the first 9 steps you could also skip this step. If you followed the first 9 steps, you need to setup the paths so the “stm32-for-vscode” extension knows where to search the ARM toolchain, our MinGW compiler and OpenOcd. To do this navigate to the extension settings by clicking the cogwheel on the extension page inside VS code. A menu will popup, in this menu click: “Extension settings”. A new window will open, in this window you need to enter paths as follows:
-Stm32-for-vscode: Arm Toolchain Path: “C:\VSARM\ARMCC\\BIN”
-Stm32-for-vscode: Make Path: “C:\VSARM\MINGW\MINGW32\BIN\MAKE.BAT”
-Stm32-for-vscode: Open OCDPath: “C:\VSARM\OPENOCD\…”
after you filled out the right paths close the settings window.
step 15: After you installed the extention “stm32-for-vscode”, search in the search bar for the extention: “Cortex-Debug”, this (https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug&ssr=false#overview) extension is created by: “marus25”. Just like with the earlier extention install this one.
step 16: Last but not least install the extention: “C/C++” this (https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) extension created by: “Microsoft”.
step 17: Now it is time to head over to the st download page (https://www.st.com/en/development-tools/stm32cubemx.html#get-software) to download STM32CubeMX for windows, to do so you need to sign up with you email adres. After signing up you will get an email with the download link, this could take along, long time.
step 18: Well when you finally received the email just install STM32CubeMX, it is mostly self explainatory.
step 19: If you skipped the first 9 steps you need to install the toolchain, compiler and OpenOCD. STM32-for-vscode could do this for you. To do so create a project using STM32CubeMX, and open the freshly created project folder in vscode. If everything is right the STM32-for-vscode extension should also load, when it is loaded click on the extention icon in the left bar. If the extention couldn’t find the toolchain, compiler or OpenOCD, you will see three blue buttons, you could choose to enter the Paths manualy or let the extention install the components, it thinks that is’s missing.
step 20: You should be ready to build flash and debug a STM microcontroller. If you get error 0xC0000142 from arm-none-eabi-gcc.exe, check if you have Winavr installed, because this could trigger the error. If you don’t use winavr anymore remove it from your PC.
If I missed anything please let me know, and I will change it.