Visual Studio OpenOCD Debug Mbed on STM32F103

Playing with MiniMaple clone board from eBay, found that eclipse is really hard to edit code. So spending a lot of time trying to compile and debug on Visual studio code.
Finally got it working, not 100% perfect though.

How to do the setup.

  1. Install gnu arm toolchain; https://gnu-mcu-eclipse.github.io/toolchain/arm/install/
  2. Install make; https://gnu-mcu-eclipse.github.io/windows-build-tools/install/
  3. Install OpenOCD; https://gnu-mcu-eclipse.github.io/openocd/install/
  4. Go to OpenOCD folder to create this file: maplemini.cfg
    eg: D:\Program Files\GNU MCU Eclipse\OpenOCD\scripts\board\maplemini.cfg

    source [find interface/stlink-v2-1.cfg]
    transport select hla_swd
    source [find target/stm32f1x.cfg]
    reset_config none separate
  5. Clone the project GitHub link
  6. Open in vscode
  7. Change these files to meet your local settings: .vscode/c_cpp_properties.json, runDebuggerServer.bat, launch.json
  8. Press F5