dump_sram 362 B

1234567891011121314151617
  1. #!/bin/sh
  2. prg=$(basename "$0")
  3. port="$1"
  4. if [ -z "$port" -o "$port" = "-h" ]
  5. then
  6. echo "usage: $0 <port>" >&2
  7. echo "Connect to <port> and dump the content of the SRAM using D2 to stdout" >&2
  8. exit 1
  9. fi
  10. set -e
  11. tmp=$(mktemp)
  12. trap "rm -f \"$tmp\"" EXIT
  13. echo D2 > "$tmp"
  14. printcore -v "$port" "$tmp" 2>&1 | \
  15. sed -ne '/^RECV: D2 /,/RECV: ok$/s/^RECV: //p'