From 3a238651e4f3619b38722c67336e35ecc53fdfbb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Sep 2024 20:28:07 +0200 Subject: [PATCH] add examples --- vscode/launch.json | 124 +++++++++++++++++++++++++++++++++++++++++++++ vscode/tasks.json | 52 +++++++++++++++++++ 2 files changed, 176 insertions(+) diff --git a/vscode/launch.json b/vscode/launch.json index 7d5f4de..e7ba243 100644 --- a/vscode/launch.json +++ b/vscode/launch.json @@ -297,5 +297,129 @@ ] } }, + { + "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, + // Have to use exact address unfortunately. "auto" does not work for some reason.. + "address": "0x1fff8000", + "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, + // Have to use exact address unfortunately. "auto" does not work for some reason.. + "address": "0x1fff8004", + "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, + // Have to use exact address unfortunately. "auto" does not work for some reason.. + "address": "0x1fff8000", + "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": false, + // Have to use exact address unfortunately. "auto" does not work for some reason.. + "address": "0x1fff806c", + "decoders": [ + { + "port": 0, + "timestamp": true, + "type": "console" + } + ] + } + }, ] } \ No newline at end of file diff --git a/vscode/tasks.json b/vscode/tasks.json index bf7bbd9..a141443 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", @@ -56,6 +82,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 +147,18 @@ "kind": "build", } }, + { + "label": "dma-example", + "type": "shell", + "command": "~/.cargo/bin/cargo", // note: full path to the cargo + "args": [ + "build", + "--example", + "dma" + ], + "group": { + "kind": "build", + } + }, ] } \ No newline at end of file