feat(vscode): add connect-under-reset tasks

This commit is contained in:
2026-09-15 18:23:12 +08:00
parent 5feae37831
commit 142b0133d9
2 changed files with 97 additions and 2 deletions
+88
View File
@@ -120,6 +120,94 @@
"tooltip": "Erase MCU"
}
},
{
"label": "Build and Flash (Connect Under Reset)",
"dependsOn": [
"Build",
"Flash MCU (Connect Under Reset)"
],
"dependsOrder": "sequence",
"group": "build",
"icon": {
"id": "insert",
"tooltip": "Build and Flash (Connect Under Reset)"
}
},
{
"label": "Flash MCU (Connect Under Reset)",
"type": "process",
"command": "${env:GD32_OPENOCD_BIN}/openocd.exe",
"args": [
"-s", "${env:GD32_OPENOCD_SCRIPTS}",
"-f", "${env:GD32_OPENOCD_SCRIPTS}/${config:gd32.openocd.targetConfig}",
"-c", "adapter srst delay 100; reset_config srst_only srst_nogate connect_assert_srst; init; adapter deassert srst; sleep 200; catch {reset halt}; reset halt; flash write_image erase ${command:cmake.launchTargetFilename}; reset; exit"
],
"group": "build",
"problemMatcher": [],
"options": {
"cwd": "${command:cmake.buildDirectory}/Application",
"environment": {
"OPENOCD_SCRIPTS": "${env:GD32_OPENOCD_SCRIPTS}"
}
},
"presentation": {
"clear": true
},
"icon": {
"id": "gather",
"tooltip": "Flash MCU (Connect Under Reset)"
}
},
{
"label": "Reset MCU (Connect Under Reset)",
"type": "process",
"command": "${env:GD32_OPENOCD_BIN}/openocd.exe",
"args": [
"-s", "${env:GD32_OPENOCD_SCRIPTS}",
"-f", "${env:GD32_OPENOCD_SCRIPTS}/${config:gd32.openocd.targetConfig}",
"-c", "adapter srst delay 100; reset_config srst_only srst_nogate connect_assert_srst; init; adapter deassert srst; sleep 200; reset; exit"
],
"group": "build",
"problemMatcher": [],
"options": {
"cwd": "${command:cmake.buildDirectory}/Application",
"environment": {
"OPENOCD_SCRIPTS": "${env:GD32_OPENOCD_SCRIPTS}"
}
},
"presentation": {
"clear": true
},
"icon": {
"id": "discard",
"tooltip": "Reset MCU (Connect Under Reset)"
}
},
{
"label": "Mass Erase MCU (Connect Under Reset)",
"type": "process",
"command": "${env:GD32_OPENOCD_BIN}/openocd.exe",
"args": [
"-s", "${env:GD32_OPENOCD_SCRIPTS}",
"-f", "${env:GD32_OPENOCD_SCRIPTS}/${config:gd32.openocd.targetConfig}",
"-c", "adapter srst delay 100; reset_config srst_only srst_nogate connect_assert_srst; init; adapter deassert srst; sleep 200; catch {reset halt}; reset halt; ${config:gd32.openocd.massEraseCommand}; exit"
],
"group": "build",
"problemMatcher": [],
"options": {
"cwd": "${command:cmake.buildDirectory}/Application",
"environment": {
"OPENOCD_SCRIPTS": "${env:GD32_OPENOCD_SCRIPTS}"
}
},
"presentation": {
"clear": true
},
"icon": {
"id": "clear-all",
"tooltip": "Erase MCU (Connect Under Reset)"
}
},
{
"label": "OpenOCD Server",
"type": "process",