From 084b7b7e3f1b66f909e81cf89a9bc550bc7a4a4d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 10 Dec 2021 10:13:42 +0100 Subject: [PATCH] updated .vscode handling --- .gitignore | 1 + .vscode/launch.json | 67 +++++++--------- .vscode/tasks.json | 4 +- README.md | 15 ++++ launch-unix.json | 176 ++++++++++++++++++++++++++++++++++++++++++ settings-default.json | 3 + vorago-reb1-rs | 2 +- 7 files changed, 227 insertions(+), 41 deletions(-) create mode 100644 launch-unix.json create mode 100644 settings-default.json diff --git a/.gitignore b/.gitignore index 51c87c3..fe1e0d4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ Cargo.lock **/*.rs.bk /.vscode/.cortex-debug.* +/.vscode/settings.json diff --git a/.vscode/launch.json b/.vscode/launch.json index f898ebd..69014ae 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,6 +2,9 @@ // 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 + + // You can set the "gdbPath" setting in a custom settings.json to use a non-default + // GDB application "version": "0.2.0", "configurations": [ { @@ -9,10 +12,9 @@ "request": "launch", "name": "Debug LED Blinky", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build led blinky", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-leds", "interface": "jtag", @@ -23,10 +25,9 @@ "request": "launch", "name": "Debug Tests HAL", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build hal tests", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/tests", "interface": "jtag", @@ -37,10 +38,9 @@ "request": "launch", "name": "Debug RTT", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build rtt", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/rtt-log", "interface": "jtag", @@ -51,10 +51,9 @@ "request": "launch", "name": "Debug Blinky Button IRQ", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build button blinky", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-irq", "interface": "jtag", @@ -65,10 +64,9 @@ "request": "launch", "name": "Debug Timer MS Ticks", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build systick", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/timer-ticks", "interface": "jtag", @@ -79,10 +77,9 @@ "request": "launch", "name": "Debug UART", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build uart", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/uart", "interface": "jtag", @@ -93,10 +90,9 @@ "request": "launch", "name": "Debug SPI", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build spi", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/spi", "interface": "jtag", @@ -107,12 +103,11 @@ "request": "launch", "name": "Debug I2C / Temperature Sensor", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build temp sensor", - "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/temp-sensor", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adt75-temp-sensor", "interface": "jtag", "runToMain": true, }, @@ -121,10 +116,9 @@ "request": "launch", "name": "Debug Button Blinky RTIC", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build button blinky rtic", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-rtic", "interface": "jtag", @@ -135,10 +129,9 @@ "request": "launch", "name": "Debug PWM", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build pwm", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/pwm", "interface": "jtag", @@ -149,10 +142,9 @@ "request": "launch", "name": "Debug Cascade", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build cascade", "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/cascade", "interface": "jtag", @@ -163,12 +155,11 @@ "request": "launch", "name": "Debug Accelerometer", "servertype": "jlink", - "gdbPath": "/usr/bin/gdb-multiarch", "cwd": "${workspaceRoot}", - "device": "VA10820", - "svdFile": "./va108xx-rs/svd/va108xx-base.svd.patched", + "device": "Cortex-M0", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", "preLaunchTask": "rust: cargo build accelerometer", - "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/accelerometer", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adxl343-accelerometer", "interface": "jtag", "runToMain": true, }, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 4ce62b5..691bf9e 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -131,7 +131,7 @@ "type": "shell", "command": "~/.cargo/bin/cargo", // note: full path to the cargo "args": [ - "build", "-p", "vorago-reb1", "--example", "temp-sensor", + "build", "-p", "vorago-reb1", "--example", "adt75-temp-sensor", ], "group": { "kind": "build", @@ -156,7 +156,7 @@ "type": "shell", "command": "~/.cargo/bin/cargo", // note: full path to the cargo "args": [ - "build", "-p", "vorago-reb1", "--example", "accelerometer", + "build", "-p", "vorago-reb1", "--example", "adxl343-accelerometer", "--features", "rt" ], "group": { diff --git a/README.md b/README.md index f76039f..050071f 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,18 @@ After cloning, run git submodule init git submodule update ``` + +## Use VS Code files + +Make sure to install the `Cortex-Debug` extension first. + +The `tasks.json` and the `launch.json` files are generic and you can use them immediately by +opening the folder in VS code or adding it to a workspace. + +If you would like to use a custom GDB application, you can specify the gdb binary in the following +configuration variables in your `settings.json`: + +- `"cortex-debug.gdbPath"` +- `"cortex-debug.gdbPath.linux"` +- `"cortex-debug.gdbPath.windows"` +- `"cortex-debug.gdbPath.osx"` diff --git a/launch-unix.json b/launch-unix.json new file mode 100644 index 0000000..df4e352 --- /dev/null +++ b/launch-unix.json @@ -0,0 +1,176 @@ +{ + // 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": [ + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug LED Blinky", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build led blinky", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-leds", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug Tests HAL", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build hal tests", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/tests", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug RTT", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build rtt", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/rtt-log", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug Blinky Button IRQ", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build button blinky", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-irq", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug Timer MS Ticks", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build systick", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/timer-ticks", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug UART", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build uart", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/uart", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug SPI", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build spi", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/spi", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug I2C / Temperature Sensor", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build temp sensor", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adt75-temp-sensor", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug Button Blinky RTIC", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build button blinky rtic", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/blinky-button-rtic", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug PWM", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build pwm", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/pwm", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug Cascade", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build cascade", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/cascade", + "interface": "jtag", + "runToMain": true, + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug Accelerometer", + "servertype": "jlink", + "gdbPath": "/usr/bin/gdb-multiarch", + "cwd": "${workspaceRoot}", + "device": "VA10820", + "svdFile": "./va108xx/svd/va108xx-base.svd.patched", + "preLaunchTask": "rust: cargo build accelerometer", + "executable": "${workspaceFolder}/target/thumbv6m-none-eabi/debug/examples/adxl343-accelerometer", + "interface": "jtag", + "runToMain": true, + }, + ] +} \ No newline at end of file diff --git a/settings-default.json b/settings-default.json new file mode 100644 index 0000000..e2ecf80 --- /dev/null +++ b/settings-default.json @@ -0,0 +1,3 @@ +{ + "cortex-debug.gdbPath.linux": "gdb-multiarch" +} \ No newline at end of file diff --git a/vorago-reb1-rs b/vorago-reb1-rs index dbca9d8..87134c9 160000 --- a/vorago-reb1-rs +++ b/vorago-reb1-rs @@ -1 +1 @@ -Subproject commit dbca9d8fd2126193cefbab1f1255f0c0eb104dc7 +Subproject commit 87134c9c6d9bcb2cb59e971cc83f9e305467f727