Merge branch 'master'
[fw/altos] / ao-tools / ao-flash / ao-flash-samd21
diff --git a/ao-tools/ao-flash/ao-flash-samd21 b/ao-tools/ao-flash/ao-flash-samd21
new file mode 100755 (executable)
index 0000000..f20d526
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+case "$#" in
+1)
+    ;;
+*)
+    echo "usage: $0 <filename> ..."
+    exit 1
+    ;;
+esac
+openocd -f interface/stlink.cfg \
+        -c 'transport select hla_swd' \
+       -c 'set CHIPNAME at91samd21g18' \
+       -c 'set CPUTAPID 0x0bc11477' \
+       -f target/at91samdXX.cfg \
+       -c init \
+       -c 'reset halt' \
+       -c 'at91samd bootloader 0' \
+       -c "flash write_image erase unlock $1" \
+       -c "shutdown"