diff --git a/.vscode/launch.json b/.vscode/launch.json index f1ac8be..1b75421 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,27 +2,17 @@ "version": "0.2.0", "configurations": [ { - "name": "Launch", - "device": "nRF52840_xxAA", - "cwd": "${workspaceFolder}", - "executable": "build/zephyr/zephyr.elf", - "request": "launch", - "type": "cortex-debug", - "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", - "preLaunchTask": "West Build" - }, - { - "name": "Attach", - "device": "nRF52840_xxAA", + "name": "Launch and Attach to GDB Server", "cwd": "${workspaceFolder}", "executable": "build/zephyr/zephyr.elf", "request": "attach", "type": "cortex-debug", "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb" + "servertype": "external", + "gdbTarget": "127.0.0.1:3333", + "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", + "preLaunchTask": "Start West Debug Server", + "postDebugTask": "Stop West Debug Server" }, ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 29204c9..a431af7 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -72,6 +72,40 @@ "problemMatcher": [ "$gcc" ] + }, + { + "label": "Start West Debug Server", + "type": "shell", + "isBackground": true, + "command": "west debugserver", + "dependsOn": "West Build", + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [ + { + "pattern": [{ + "regexp": ".", + "file": 1,"line": 1, + "column": 1,"message": 1 + }], + "background": { + "activeOnStart": true, + "beginsPattern": { "regexp": "." }, + "endsPattern": { "regexp": "." } + }, + } + ] + }, + { + "label": "Stop West Debug Server", + "command": "echo ${input:terminate west debug server}", + "type": "shell" } ], "inputs": [ @@ -91,6 +125,12 @@ "always", "never" ] + }, + { + "id": "terminate west debug server", + "type": "command", + "command": "workbench.action.tasks.terminate", + "args": "Start West Debug Server" } ] } \ No newline at end of file diff --git a/zephyr-linux.code-workspace b/zephyr-linux.code-workspace index dc114a3..7fd9b2d 100644 --- a/zephyr-linux.code-workspace +++ b/zephyr-linux.code-workspace @@ -65,6 +65,40 @@ "problemMatcher": [ "$gcc" ] + }, + { + "label": "Start West Debug Server", + "type": "shell", + "isBackground": true, + "command": "west debugserver", + "dependsOn": "West Build", + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [ + { + "pattern": [{ + "regexp": ".", + "file": 1,"line": 1, + "column": 1,"message": 1 + }], + "background": { + "activeOnStart": true, + "beginsPattern": { "regexp": "." }, + "endsPattern": { "regexp": "." } + }, + } + ] + }, + { + "label": "Stop West Debug Server", + "command": "echo ${input:terminate west debug server}", + "type": "shell" } ], "inputs": [ @@ -84,6 +118,12 @@ "always", "never" ] + }, + { + "id": "terminate west debug server", + "type": "command", + "command": "workbench.action.tasks.terminate", + "args": "Start West Debug Server" } ] }, @@ -91,29 +131,19 @@ "version": "0.2.0", "configurations": [ { - "name": "Launch", - "device": "nRF52840_xxAA", - "cwd": "${workspaceFolder}", - "executable": "build/zephyr/zephyr.elf", - "request": "launch", - "type": "cortex-debug", - "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", - "preLaunchTask": "West Build" - }, - { - "name": "Attach", - "device": "nRF52840_xxAA", + "name": "Launch and Attach to GDB Server", "cwd": "${workspaceFolder}", "executable": "build/zephyr/zephyr.elf", "request": "attach", "type": "cortex-debug", "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb" + "servertype": "external", + "gdbTarget": "127.0.0.1:3333", + "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", + "preLaunchTask": "Start West Debug Server", + "postDebugTask": "Stop West Debug Server" }, - ] + ] }, "extensions": { "recommendations": [ diff --git a/zephyr-macos.code-workspace b/zephyr-macos.code-workspace index dc114a3..7fd9b2d 100644 --- a/zephyr-macos.code-workspace +++ b/zephyr-macos.code-workspace @@ -65,6 +65,40 @@ "problemMatcher": [ "$gcc" ] + }, + { + "label": "Start West Debug Server", + "type": "shell", + "isBackground": true, + "command": "west debugserver", + "dependsOn": "West Build", + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [ + { + "pattern": [{ + "regexp": ".", + "file": 1,"line": 1, + "column": 1,"message": 1 + }], + "background": { + "activeOnStart": true, + "beginsPattern": { "regexp": "." }, + "endsPattern": { "regexp": "." } + }, + } + ] + }, + { + "label": "Stop West Debug Server", + "command": "echo ${input:terminate west debug server}", + "type": "shell" } ], "inputs": [ @@ -84,6 +118,12 @@ "always", "never" ] + }, + { + "id": "terminate west debug server", + "type": "command", + "command": "workbench.action.tasks.terminate", + "args": "Start West Debug Server" } ] }, @@ -91,29 +131,19 @@ "version": "0.2.0", "configurations": [ { - "name": "Launch", - "device": "nRF52840_xxAA", - "cwd": "${workspaceFolder}", - "executable": "build/zephyr/zephyr.elf", - "request": "launch", - "type": "cortex-debug", - "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", - "preLaunchTask": "West Build" - }, - { - "name": "Attach", - "device": "nRF52840_xxAA", + "name": "Launch and Attach to GDB Server", "cwd": "${workspaceFolder}", "executable": "build/zephyr/zephyr.elf", "request": "attach", "type": "cortex-debug", "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb" + "servertype": "external", + "gdbTarget": "127.0.0.1:3333", + "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", + "preLaunchTask": "Start West Debug Server", + "postDebugTask": "Stop West Debug Server" }, - ] + ] }, "extensions": { "recommendations": [ diff --git a/zephyr-windows.code-workspace b/zephyr-windows.code-workspace index 2d42780..fd45f00 100644 --- a/zephyr-windows.code-workspace +++ b/zephyr-windows.code-workspace @@ -65,6 +65,40 @@ "problemMatcher": [ "$gcc" ] + }, + { + "label": "Start West Debug Server", + "type": "shell", + "isBackground": true, + "command": "west debugserver", + "dependsOn": "West Build", + "presentation": { + "echo": true, + "reveal": "silent", + "focus": false, + "panel": "dedicated", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [ + { + "pattern": [{ + "regexp": ".", + "file": 1,"line": 1, + "column": 1,"message": 1 + }], + "background": { + "activeOnStart": true, + "beginsPattern": { "regexp": "." }, + "endsPattern": { "regexp": "." } + }, + } + ] + }, + { + "label": "Stop West Debug Server", + "command": "echo ${input:terminate west debug server}", + "type": "shell" } ], "inputs": [ @@ -84,36 +118,33 @@ "always", "never" ] + }, + { + "id": "terminate west debug server", + "type": "command", + "command": "workbench.action.tasks.terminate", + "args": "Start West Debug Server" } + ] }, "launch": { "version": "0.2.0", "configurations": [ { - "name": "Launch", - "device": "nRF52840_xxAA", - "cwd": "${workspaceFolder}", - "executable": "build/zephyr/zephyr.elf", - "request": "launch", - "type": "cortex-debug", - "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", - "preLaunchTask": "West Build" - }, - { - "name": "Attach", - "device": "nRF52840_xxAA", + "name": "Launch and Attach to GDB Server", "cwd": "${workspaceFolder}", "executable": "build/zephyr/zephyr.elf", "request": "attach", "type": "cortex-debug", "runToEntryPoint": "main", - "servertype": "jlink", - "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb" + "servertype": "external", + "gdbTarget": "127.0.0.1:3333", + "gdbPath": "${userHome}/zephyr-sdk-0.16.1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb", + "preLaunchTask": "Start West Debug Server", + "postDebugTask": "Stop West Debug Server" }, - ] + ] }, "extensions": { "recommendations": [