Using vs code to debug ARM-CortexM
This document describes how to use vs code to debug arm-cortexM3 (STM32F207) in my project.
Environement:
VS code
VS code plug-in : Cortex-Debug
CMAKE is not mandatory.
install software:
cmake-3.18.2-win64-x64.msi
gcc-arm-none-eabi-9-2020-q2-update-win32.exe
ninjia : using ninjia as the build shell
using hareware Jlinker, you shall install the software to support jlinker.
firstly, you have to make sure your project is successful built and generate the elf file. I will not describe it here.
Configurion
setting.json has to define the armToolchainPath and JLinkGDBServerPath.
"cortex-debug.armToolchainPath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/9 2020-q2-update/bin/",
"cortex-debug.JLinkGDBServerPath": "C:/Program Files (x86)/SEGGER/JLink_V614b/JLinkGDBServer.exe"
laungh.json as below
{
"version": "0.2.0",
"configurations": [
{
"type": "cortex-debug",
"request": "launch",
"servertype": "jlink",
"cwd": "${workspaceRoot}",
"executable": "./BuildARM/out/bin/DemoPanel.elf",
"name": "Debug (J-Link)",
"device": "STM32F207ZE",
"interface": "jtag",
"ipAddress": null,
"serialNumber": null,
}
]
}