From bb1b703dc1fb8bda36e884846176885434ee75de Mon Sep 17 00:00:00 2001 From: "E.T" Date: Wed, 17 Apr 2024 14:21:16 +0200 Subject: [PATCH] Add vscode debug configuration as a template (#2109) --- .vscode/launch.json | 148 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..cc3c84ae --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,148 @@ +{ + // 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": "(gdb) JTAG probe", + "type": "cppdbg", + "request": "launch", + "miDebuggerPath": "arm-none-eabi-gdb", + "targetArchitecture": "arm", + "program": "${workspaceRoot}/build/firmware/baseband/baseband_adsbrx.elf", + "cwd": "${workspaceRoot}", + "setupCommands": [ + // use logging for troubleshooting + //{"text": "set logging file ${workspaceRoot}/build/arm-none-eabi-gdb.log"}, + //{"text": "set logging on"}, + { + "text": "file '${workspaceRoot}/build/firmware/baseband/baseband_adsbrx.elf'" + }, + { + "text": "target extended-remote /dev/ttyACM0" + }, + { + "text": "monitor swdp_scan" + }, + { + "text": "attach 1" + }, + ], + "launchCompleteCommand": "None", + "externalConsole": false, + }, + { + "name": "(gdb) OpenOCD m4 baseband", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceRoot}/build/firmware/baseband/baseband_sd_over_usb.elf", + "args": [], + "cwd": "${workspaceRoot}", + // "environment": [ + // { + // "name": "PATH", + // "value": "${env:PATH}" + // } + // ], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "arm-none-eabi-gdb", + "targetArchitecture": "arm", + "debugServerPath": "openocd", + "debugServerArgs": "-f interface/ftdi/um232h.cfg -f target/lpc4350.cfg -c \"gdb_breakpoint_override hard\"", + "serverStarted": "Listening on port [0-9]+ for gdb connections", + "filterStderr": true, + "filterStdout": false, + "launchCompleteCommand": "None", + "postRemoteConnectCommands": [ + { + "description": "Target Remote Device on Port 3333", + "text": "target extended-remote :3333", + "ignoreFailures": false + }, + { + "description": "Respect Hardware Limitations", + "text": "set remote hardware-watchpoint-limit 2", + "ignoreFailures": false + }, + { + "description": "Respect Hardware Limitations", + "text": "set remote hardware-breakpoint-limit 4", + "ignoreFailures": false + }, + { + "description": "Shutdown GDB Server on GDB Detach", + "text": "monitor [target current] configure -event gdb-detach { shutdown }", + "ignoreFailures": false + }, + ], + "stopAtConnect": false, + "logging": { + "exceptions": true, + "engineLogging": false, + "moduleLoad": true, + "programOutput": true, + "trace": false, + "traceResponse": false + }, + "useExtendedRemote": true + }, + { + "name": "(gdb) OpenOCD m0 application", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceRoot}/build/firmware/application/application.elf", + "args": [], + "cwd": "${workspaceRoot}", + // "environment": [ + // { + // "name": "PATH", + // "value": "${env:PATH}" + // } + // ], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "arm-none-eabi-gdb", + "targetArchitecture": "arm", + "debugServerPath": "openocd", + "debugServerArgs": "-f interface/ftdi/um232h.cfg -f target/lpc4350.cfg -c \"gdb_breakpoint_override hard\"", + "serverStarted": "Listening on port [0-9]+ for gdb connections", + "filterStderr": true, + "filterStdout": false, + "launchCompleteCommand": "None", + "postRemoteConnectCommands": [ + { + "description": "Target Remote Device on Port 3334", + "text": "target extended-remote :3334", + "ignoreFailures": false + }, + { + "description": "Respect Hardware Limitations", + "text": "set remote hardware-watchpoint-limit 1", + "ignoreFailures": false + }, + { + "description": "Respect Hardware Limitations", + "text": "set remote hardware-breakpoint-limit 2", + "ignoreFailures": false + }, + { + "description": "Shutdown GDB Server on GDB Detach", + "text": "monitor [target current] configure -event gdb-detach { shutdown }", + "ignoreFailures": false + }, + ], + "stopAtConnect": false, + "logging": { + "exceptions": true, + "engineLogging": false, + "moduleLoad": true, + "programOutput": true, + "trace": false, + "traceResponse": false + }, + "useExtendedRemote": true + }, + ] +} \ No newline at end of file