Skip to content

Commit

Permalink
chore(debug): update debugging config
Browse files Browse the repository at this point in the history
Signed-off-by: HaoboGu <[email protected]>
  • Loading branch information
HaoboGu committed Nov 19, 2023
1 parent 5a40a3d commit 5917773
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 29 deletions.
23 changes: 21 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"configurations": [
{
"name": "Cortex-Debug - stm32h7",
"preLaunchTask": "Flash stm32h7",
"preLaunchTask": "flash stm32h7",
"cwd": "${workspaceFolder}",
"executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/rmk-stm32h7",
"request": "launch",
Expand All @@ -18,11 +18,14 @@
"${workspaceFolder}/boards/stm32h7/openocd.cfg"
],
"svdFile": "${workspaceFolder}/boards/stm32h7/STM32H7B0x.svd",
"postRestartCommands": [
"monitor rtt start",
],
"rttConfig": {
"enabled": true,
"address": "auto",
"clearSearch": false,
"polling_interval": 20,
"polling_interval": 10,
"rtt_start_retry": 2000,
"decoders": [
{
Expand All @@ -33,6 +36,22 @@
]
},
},
{
"name": "Cortex-Debug - rp2040",
"type": "cortex-debug",
"request": "launch",
"gdbPath" : "gdb-multiarch",
// "preLaunchTask": "flash rp2040",
"cwd": "${workspaceFolder}/boards/rp2040",
"device": "RP2040",
"servertype": "openocd",
"showDevDebugOutput": "parsed",
"executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/rmk-rp2040",
"runToEntryPoint": "main",
"configFiles": [
"openocd.cfg"
]
},
{
"name": "Probe-rs - rp2040",
"preLaunchTask": "Build Debug",
Expand Down
67 changes: 40 additions & 27 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
"version": "2.0.0",
"tasks": [
{
"label": "objcopy rmk-stm32h7 --bin --release",
"label": "build stm32h7 --debug",
"type": "process",
"command": "cargo",
"args": [
"objcopy",
"--release",
"size",
"-j",
"32",
"--",
"-O",
"binary",
"${workspaceFolder}/target/thumbv7em-none-eabihf/release/rmk-stm32h7.bin"
"32"
],
"options": {
"cwd": "${workspaceFolder}/boards/stm32h7"
Expand All @@ -28,18 +23,13 @@
},
},
{
"label": "objcopy rmk-rp2040 --bin --release",
"label": "build rp2040 --debug",
"type": "process",
"command": "cargo",
"args": [
"objcopy",
"--release",
"size",
"-j",
"32",
"--",
"-O",
"binary",
"${workspaceFolder}/target/thumbv6m-none-eabi/release/rmk-rp2040.bin"
"32"
],
"options": {
"cwd": "${workspaceFolder}/boards/rp2040"
Expand All @@ -51,57 +41,80 @@
"kind": "build",
},
},
{
"label": "Build Debug",
{
"label": "build stm32h7 --release",
"type": "process",
"command": "cargo",
"args": [
"size",
"--release",
"-j",
"32"
],
"options": {
"cwd": "${workspaceFolder}/boards/${input:targetChip}"
"cwd": "${workspaceFolder}/boards/stm32h7"
},
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
},
},
{
"label": "Build Release",
"label": "build rp2040 --release",
"type": "process",
"command": "cargo",
"args": [
"size",
"--release",
"-j",
"32",
"--release"
"32"
],
"options": {
"cwd": "${workspaceFolder}/boards/${input:targetChip}"
"cwd": "${workspaceFolder}/boards/rp2040"
},
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
},
},
{
"label": "Flash stm32h7",
"label": "flash stm32h7",
"group": "build",
"type": "shell",
"command": "openocd -f \"${workspaceFolder}/boards/stm32h7/openocd.cfg\" -c \"program target/thumbv7em-none-eabihf/debug/rmk-stm32h7 preverify verify reset exit\"",
"dependsOn": [
"Build Debug"
"build stm32h7 --debug"
],
"dependsOrder": "sequence"
},
{
"label": "flash rp2040",
"group": "build",
"type": "shell",
"command": "openocd -f \"${workspaceFolder}/boards/rp2040/openocd.cfg\" -c \"program target/thumbv6m-none-eabi/debug/rmk-rp2040 preverify verify reset exit\"",
"dependsOn": [
"build rp2040 --debug"
],
"dependsOrder": "sequence"
},
{
"label": "objcopy",
"type": "shell",
"command": "cargo objcopy --release -- -O binary \"${workspaceFolder}/target/release/rmk-${input:targetChip}.bin\" && cargo size -j 32 --release",
"options": {
"cwd": "${workspaceFolder}/boards/${input:targetChip}"
},
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
},
},
],
"inputs": [
{
Expand Down
6 changes: 6 additions & 0 deletions boards/rp2040/openocd.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source [find interface/cmsis-dap.cfg]
transport select swd

source [find target/rp2040.cfg]

adapter speed 10000

0 comments on commit 5917773

Please sign in to comment.