diff --git a/README.md b/README.md index 1b55377..c9b6d7e 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,9 @@ example. ### Using VS Code Assuming a working debug connection to your VA108xx board, you can debug using VS Code with -the [`Cortex-Debug` plugin](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug). +the [`Cortex-Debug` plugin](https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug). Please make sure that +[`objdump-multiarch` and `nm-multiarch`](https://forums.raspberrypi.com/viewtopic.php?t=333146) +are installed as well. Some sample configuration files for VS code were provided and can be used by running `cp -rT vscode .vscode` like specified above. After that, you can use `Run and Debug` @@ -111,4 +113,5 @@ configuration variables in your `settings.json`: - `"cortex-debug.gdbPath.osx"` The provided VS Code configurations also provide an integrated RTT logger, which you can access -via the terminal at `RTT Ch:0 console`. +via the terminal at `RTT Ch:0 console`. In order for the RTT block address detection to +work properly, `objdump-multiarch` and `nm-multiarch` need to be installed. diff --git a/vscode/launch.json b/vscode/launch.json index 7d5f4de..f583000 100644 --- a/vscode/launch.json +++ b/vscode/launch.json @@ -74,8 +74,7 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", "decoders": [ { "port": 0, @@ -104,8 +103,7 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", "decoders": [ { "port": 0, @@ -134,8 +132,7 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", "decoders": [ { "port": 0, @@ -164,11 +161,11 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", "decoders": [ { "port": 0, + "timestamp": true, "type": "console" } ] @@ -194,8 +191,7 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", "decoders": [ { "port": 0, @@ -224,8 +220,7 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", "decoders": [ { "port": 0, @@ -255,8 +250,7 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", "decoders": [ { "port": 0, @@ -286,8 +280,127 @@ "runToEntryPoint": "main", "rttConfig": { "enabled": true, - // Have to use exact address unfortunately. "auto" does not work for some reason.. - "address": "0x1fff8000", + "address": "auto", + "decoders": [ + { + "port": 0, + "timestamp": true, + "type": "console" + } + ] + } + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug PWM Example", + "servertype": "jlink", + "jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript", + "cwd": "${workspaceRoot}", + "device": "Cortex-M4", + "svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched", + "preLaunchTask": "pwm-example", + "overrideLaunchCommands": [ + "monitor halt", + "monitor reset", + "load", + ], + "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/examples/pwm", + "interface": "swd", + "runToEntryPoint": "main", + "rttConfig": { + "enabled": true, + "address": "auto", + "decoders": [ + { + "port": 0, + "timestamp": true, + "type": "console" + } + ] + } + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Debug DMA Example", + "servertype": "jlink", + "jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript", + "cwd": "${workspaceRoot}", + "device": "Cortex-M4", + "svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched", + "preLaunchTask": "dma-example", + "overrideLaunchCommands": [ + "monitor halt", + "monitor reset", + "load", + ], + "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/examples/dma", + "interface": "swd", + "runToEntryPoint": "main", + "rttConfig": { + "enabled": true, + "address": "auto", + "decoders": [ + { + "port": 0, + "timestamp": true, + "type": "console" + } + ] + } + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Bootloader", + "servertype": "jlink", + "jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript", + "cwd": "${workspaceRoot}", + "device": "Cortex-M4", + "svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched", + "preLaunchTask": "bootloader", + "overrideLaunchCommands": [ + "monitor halt", + "monitor reset", + "load", + ], + "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/bootloader", + "interface": "swd", + "runToEntryPoint": "main", + "rttConfig": { + "enabled": true, + "address": "auto", + "decoders": [ + { + "port": 0, + "timestamp": true, + "type": "console" + } + ] + } + }, + { + "type": "cortex-debug", + "request": "launch", + "name": "Flashloader", + "servertype": "jlink", + "jlinkscript": "${workspaceFolder}/jlink/JLinkSettings.JLinkScript", + "cwd": "${workspaceRoot}", + "device": "Cortex-M4", + "svdFile": "${workspaceFolder}/va416xx/svd/va416xx.svd.patched", + "preLaunchTask": "flashloader", + "overrideLaunchCommands": [ + "monitor halt", + "monitor reset", + "load", + ], + "executable": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/flashloader", + "interface": "swd", + "runToEntryPoint": "main", + "rttConfig": { + "enabled": true, + "address": "auto", "decoders": [ { "port": 0, @@ -298,4 +411,4 @@ } }, ] -} \ No newline at end of file +} diff --git a/vscode/tasks.json b/vscode/tasks.json index bf7bbd9..cf2752f 100644 --- a/vscode/tasks.json +++ b/vscode/tasks.json @@ -3,6 +3,32 @@ // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ + { + "label": "bootloader", + "type": "shell", + "command": "~/.cargo/bin/cargo", // note: full path to the cargo + "args": [ + "build", + "--bin", + "bootloader" + ], + "group": { + "kind": "build", + } + }, + { + "label": "flashloader", + "type": "shell", + "command": "~/.cargo/bin/cargo", // note: full path to the cargo + "args": [ + "build", + "--bin", + "flashloader" + ], + "group": { + "kind": "build", + } + }, { "label": "blinky-pac-example", "type": "shell", @@ -29,6 +55,19 @@ "kind": "build", } }, + { + "label": "timer-ticks-example", + "type": "shell", + "command": "~/.cargo/bin/cargo", // note: full path to the cargo + "args": [ + "build", + "--example", + "timer-ticks" + ], + "group": { + "kind": "build", + } + }, { "label": "blinky-example", "type": "shell", @@ -56,6 +95,19 @@ "kind": "build", } }, + { + "label": "pwm-example", + "type": "shell", + "command": "~/.cargo/bin/cargo", // note: full path to the cargo + "args": [ + "build", + "--example", + "pwm" + ], + "group": { + "kind": "build", + } + }, { "label": "wdt-example", "type": "shell", @@ -108,5 +160,31 @@ "kind": "build", } }, + { + "label": "dma-example", + "type": "shell", + "command": "~/.cargo/bin/cargo", // note: full path to the cargo + "args": [ + "build", + "--example", + "dma" + ], + "group": { + "kind": "build", + } + }, + { + "label": "embassy-example", + "type": "shell", + "command": "~/.cargo/bin/cargo", // note: full path to the cargo + "args": [ + "build", + "--bin", + "embassy-example" + ], + "group": { + "kind": "build", + } + }, ] } \ No newline at end of file