Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

debug_swd.sh 561B

123456789101112131415161718192021
  1. #!/bin/bash
  2. set -euo pipefail
  3. echo Starting OpenOCD in background
  4. ./openocd/src/openocd -s openocd/tcl -f interface/cmsis-dap.cfg -f target/rp2040.cfg -c "adapter speed 5000" -c "cmsis_dap_vid_pid 0x2e8a 0x000c" &
  5. OPENOCD_PID=$!
  6. # give OpenOCD some time to output stuff
  7. sleep 1
  8. echo -n Waiting for debugger to appear
  9. while ! netstat -tna | grep 'LISTEN\>' | grep -q ':3333\>'; do
  10. echo -n .
  11. sleep 1
  12. done
  13. echo Starting GDB
  14. arm-none-eabi-gdb -ex "target extended-remote localhost:3333" $1
  15. echo Killing OpenOCD instance in background
  16. kill $OPENOCD_PID