ao-tools: Add flash utility for stm32f1x chips
[fw/altos] / ao-tools / ao-flash / ao-flash-stm32f1
diff --git a/ao-tools/ao-flash/ao-flash-stm32f1 b/ao-tools/ao-flash/ao-flash-stm32f1
new file mode 100755 (executable)
index 0000000..536086e
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+case "$#" in
+0)
+       echo "usage: $0 <filename> ..."
+       exit 1
+       ;;
+esac
+openocd \
+       -f interface/stlink.cfg \
+       -c 'transport select hla_swd' \
+       -f target/stm32f1x.cfg \
+       -c init \
+       -c 'reset halt' \
+       -c "program $1 verify reset" \
+       -c 'shutdown'