Last active
September 14, 2024 11:05
-
-
Save sago35/fd1b23d4ac9ac689ae84dee0be8c13b1 to your computer and use it in GitHub Desktop.
TinyGo + VSCode + Cortex-Debug for Wio Terminal (ATSAMD51P19A)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "cortex-debug", | |
| "servertype": "openocd", | |
| "request": "launch", | |
| "name": "tinygo-debug", | |
| "runToEntryPoint": "main.main", | |
| "executable": "${workspaceRoot}/out.elf", | |
| "configFiles": [ | |
| "interface/cmsis-dap.cfg", | |
| "target/atsame5x.cfg" | |
| ], | |
| "preLaunchTask": "tinygo build task", | |
| "cwd": "${workspaceRoot}", | |
| "gdbpath": "C:/Program Files (x86)/GNU Arm Embedded Toolchain/10 2020-q4-major/bin/arm-none-eabi-gdb.exe", | |
| "svdFile": "${workspaceRoot}/lib/cmsis-svd/data/Atmel/ATSAMD51P19A.svd" | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "2.0.0", | |
| "tasks": [ | |
| { | |
| "label": "tinygo build task", | |
| "type": "shell", | |
| "command": "tinygo build -o out.elf -target wioterminal -size short -opt 1 ./src/examples/blinky1", | |
| "problemMatcher": [], | |
| "group": { | |
| "kind": "build", | |
| "isDefault": true | |
| } | |
| } | |
| ] | |
| } |
Author
Author
あと、 launch.json に svdFile を足しておいた。
Cortex-Debug の CORTEX PERIPHERALS から各レジスタ値を見たりできる。
Author
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


.vscode/tasks.jsonにtinygo build taskというのを作っておいて、それを.vscode/launch.json内のpreLaunchTaskに指定しておく。この状態だと、
F5を押すなどしてデバッグ開始すると、その直前にtasks.jsonのtinygo build taskが動きtinygo buildが実行される。今の所
tinygo buildの引数などは環境に合わせて設定が必要となり面倒ではあるが、それなりにうまく動きそう。