ao-tools: Add ao-flash-stm32f0x
[fw/altos] / ao-tools / ao-flash / ao-flash-stm32f0x
diff --git a/ao-tools/ao-flash/ao-flash-stm32f0x b/ao-tools/ao-flash/ao-flash-stm32f0x
new file mode 100755 (executable)
index 0000000..45643a4
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+case "$#" in
+0)
+       echo "usage: $0 <filename> ..."
+       exit 1
+       ;;
+esac
+cmds=/tmp/flash$$
+trap "rm $cmds" 0 1 15
+file="$1"
+echo "program $file verify reset" > $cmds
+openocd \
+       -f interface/stlink-v2.cfg \
+       -f target/stm32f0x_stlink.cfg \
+       -f $cmds \
+       -c shutdown