Skip to main content
Visitor II
October 22, 2024
Question

How to use PyOCD and DAPLink with vscode

  • October 22, 2024
  • 2 replies
  • 2164 views

 

To make life a little easier for those who use vscode with PyOCD and DAPLink.

There are two files that should be placed inside .vscode folder.

 

// tasks.json
{
 "version": "2.0.0",
 "tasks": [
 {
 "label": "PyOCD Flash",
 "type": "shell",
 "command": "pyocd load -t STM32G030F6Px ${workspaceFolder}/build/Debug/blink.elf",
 "presentation": {"echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true},
 },
 {
 "label": "STLINK Flash",
 "type": "shell",
 "command": "STM32_Programmer_CLI.exe -c port=SWD freq=4000 mode=normal -w ${workspaceFolder}/build/Debug/blink.elf -v -g",
 "presentation": {"echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true},
 },
 {
 "label": "CMAKE clean",
 "type": "shell",
 "command": "C:/STM32CubeCLT_1.16.0/CMake/bin/cmake.exe --build ${workspaceFolder}/build/Debug --target clean --",
 "presentation": {"echo": true, "reveal": "always", "focus": false, "panel": "shared", "showReuseMessage": false, "clear": true},
 }
 ]
}

 

// launch.json
{
 // Use IntelliSense to learn about possible attributes.
 // Hover to view descriptions of existing attributes.
 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
 "version": "0.2.0",
 "configurations": [
 {
 "name": "PyOCD Debug",
 "svdFile": "STM32G030.svd",
 "svdPath": "C:\\STM32CubeCLT_1.16.0\\STMicroelectronics_CMSIS_SVD",
 "cwd": "${workspaceFolder}",
 "executable": "build\\Debug\\blink.elf",
 "request": "launch",
 "showDevDebugOutput": "none",
 "type": "cortex-debug",
 "runToEntryPoint": "main",
 "servertype": "pyocd",
 "interface": "swd",
 "targetId": "STM32G030F6Px",
 "device": "STM32G030F6P6"
 }
 ]
}

 

 

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    October 23, 2024

    Hi @GL1 

    Thanks for you sharing

    Visitor II
    December 10, 2024

    Could you share me the tasks.json and launch.json for debuging using daplink jtag interface 

     

    Thx