From e2b55da4895cf855ef3eb8ce7d0c0d373628e98f Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 4 May 2023 08:32:42 -0600 Subject: [PATCH] Improvement for flashing scripts --- flash-launch.sh | 8 +------- flash-virgo.sh | 8 +------- openocd.sh | 11 +++++++++++ 3 files changed, 13 insertions(+), 14 deletions(-) create mode 100755 openocd.sh diff --git a/flash-launch.sh b/flash-launch.sh index 96c0a1db457b..69441d5c17db 100755 --- a/flash-launch.sh +++ b/flash-launch.sh @@ -5,10 +5,4 @@ set -ex make system76/launch_3:default FIRMWARE="$(realpath .build/system76_launch_3_default.elf)" -cd openocd -sudo src/openocd \ - -f interface/cmsis-dap.cfg \ - -c "adapter speed 5000" \ - -f target/rp2040.cfg \ - -s tcl \ - -c "program ${FIRMWARE} verify reset exit" +./openocd.sh -c "program ${FIRMWARE} verify reset exit" diff --git a/flash-virgo.sh b/flash-virgo.sh index 2db3608ee22c..4bc2889eb413 100755 --- a/flash-virgo.sh +++ b/flash-virgo.sh @@ -5,10 +5,4 @@ set -ex make system76/virgo_keyboard_test_1:default FIRMWARE="$(realpath .build/system76_virgo_keyboard_test_1_default.elf)" -cd openocd -sudo src/openocd \ - -f interface/cmsis-dap.cfg \ - -c "adapter speed 5000" \ - -f target/rp2040.cfg \ - -s tcl \ - -c "program ${FIRMWARE} verify reset exit" +./openocd.sh -c "program ${FIRMWARE} verify reset exit" diff --git a/openocd.sh b/openocd.sh new file mode 100755 index 000000000000..a10e4ba5bd81 --- /dev/null +++ b/openocd.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -ex + +cd openocd +sudo src/openocd \ + -f interface/cmsis-dap.cfg \ + -c "adapter speed 1000" \ + -f target/rp2040.cfg \ + -s tcl \ + "$@"