ao-tools: Add ao-flash-samd21 script
[fw/altos] / ao-tools / ao-flash / ao-flash-samd21
1 #!/bin/sh
2 case "$#" in
3 1)
4     ;;
5 *)
6     echo "usage: $0 <filename> ..."
7     exit 1
8     ;;
9 esac
10
11 openocd \
12     -f interface/stlink.cfg \
13     -c 'transport select hla_swd' \
14     -c 'set CPUTAPID 0x0bc11477' \
15     -f target/at91samdXX.cfg \
16     -c 'adapter speed 10' \
17     -c init \
18     -c 'reset init' \
19     -c 'at91samd bootloader 0' \
20     -c 'reset init' \
21     -c "program $1" \
22     -c "shutdown"