diff --git a/motor-control/firmware/.vscode/tasks.json b/motor-control/firmware/.vscode/tasks.json index 2622e00..47585f2 100644 --- a/motor-control/firmware/.vscode/tasks.json +++ b/motor-control/firmware/.vscode/tasks.json @@ -102,6 +102,64 @@ "cwd": "${workspaceRoot}" }, "problemMatcher": [] - } + }, + + { + "type": "shell", + "label": "Pico Remote: Launch OpenOCD", + "command": [ + "scripts/remote/run_openocd.exp", + "gobot-rpi", + ], + "options": { + "cwd": "${workspaceRoot}" + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "dedicated", + "showReuseMessage": true, + "clear": true + }, + "isBackground": true + }, + { + "type": "shell", + "label": "Pico Remote: flash main", + "command": [ + "scripts/remote/flash.sh", + "${workspaceRoot}/build/bin/main.elf", + "gobot-rpi", + ], + "options": { + "cwd": "${workspaceRoot}" + }, + "group": "test", + "dependsOn": [ + "CMake: build main" + ], + "presentation": { + "echo": true, + "reveal": "always", + "focus": true, + "panel": "dedicated", + "showReuseMessage": true, + "clear": true + } + }, + { + "type": "shell", + "label": "Pico Remote: Reset Device", + "command": [ + "scripts/remote/reset.exp", + "gobot-rpi" + ], + "options": { + "cwd": "${workspaceRoot}" + }, + "isBackground": true, + "problemMatcher": [] + }, ] } \ No newline at end of file diff --git a/motor-control/firmware/lib/picotool b/motor-control/firmware/lib/picotool new file mode 160000 index 0000000..bf33c6d --- /dev/null +++ b/motor-control/firmware/lib/picotool @@ -0,0 +1 @@ +Subproject commit bf33c6ddd756c3961c7a13b000859b71e825ee74 diff --git a/motor-control/firmware/scripts/remote/run_openocd.exp b/motor-control/firmware/scripts/remote/run_openocd.exp old mode 100644 new mode 100755 index 10b1ab5..a700b55 --- a/motor-control/firmware/scripts/remote/run_openocd.exp +++ b/motor-control/firmware/scripts/remote/run_openocd.exp @@ -4,17 +4,18 @@ set timeout 30 spawn ssh [lindex $argv 0] -expect "# " -send "cd ~/gobot/" -expect "# " +expect "$ " +send "cd ~/gobot/\n" +expect "$ " -send "git fetch" -expect "# " +send "git fetch\n" +expect "$ " -send "git checkout motor-ctrl-firmware" -expect "# " +send "git checkout motor-ctrl-firmware\n" +expect "$ " -send "cd motor-control/firmware/scripts/remote" -expect "# " +send "cd motor-control/firmware/scripts/remote\n" +expect "$ " -send "./run_openocd.sh" +send "./run_openocd.sh\n" +expect eof diff --git a/motor-control/firmware/scripts/remote/run_openocd.sh b/motor-control/firmware/scripts/remote/run_openocd.sh old mode 100644 new mode 100755 index a4e88dd..e8f523d --- a/motor-control/firmware/scripts/remote/run_openocd.sh +++ b/motor-control/firmware/scripts/remote/run_openocd.sh @@ -1,3 +1,3 @@ #!/usr/bin/bash -src/openocd -f interface/cmsis-dap.cfg -c "bindto 0.0.0.0" -c "adapter speed 5000" -f target/rp2040.cfg -s tcl \ No newline at end of file +openocd -f interface/cmsis-dap.cfg -c "bindto 0.0.0.0" -c "adapter speed 5000" -f target/rp2040.cfg -s tcl \ No newline at end of file