Think Create | Deqing Sun

Debug STM32 with VScode

by on Jul.19, 2017, under Uncategorized

This tutorial shows how to debug STM32 with VScode. Tested with $2 STM32F103C8T6 “blue pill” board and $2 ST link V2.



Follow instructions on

And make sure it works in Arduino IDE. Also make sure the folder is called “Arduino_STM32”, not “Arduino_STM32-master”



In Arduino’s board manager, install “Arduino SAM Boards (32-bits ARM Cortex-m3)”, in order to get a compiled version of openOCD


Now openOCD should appear in “Arduino15” folder. The location of that folder is different in Mac, Windows or Linux. In Mac, it is located in ~/Library


Open “packages” in “Arduino15”, create a folder called “Arduino_STM32”. Look for openOCD and copy it to “Arduino_STM32” within “packages”.


Download a copy of openOCD for its script files.


Copy scripts files into “scripts” folder in “packages”. Follow this structure.


Install VScode and Arduino extension


Debugging STM32 require some edit in “misc/usbmapping.json”. I did a PR and get merged into master branch. However you may not get it automatically until next release. If not, find your local file and replace it with the newest one on


Happy debugging!


Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!


A few highly recommended websites...