summaryrefslogtreecommitdiff
path: root/ao-tools/ao-flash/ao-flash-stm32f0x
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-03-02 21:08:44 -0800
committerKeith Packard <keithp@keithp.com>2015-03-02 21:08:44 -0800
commit112f528755b6c8a2f6eef3bfec21fac981ffb44f (patch)
treefd2d85d31ab2e0ce6fcac1efbeb519f197fa0f81 /ao-tools/ao-flash/ao-flash-stm32f0x
parentff3c27e3b842107680dc48084f71eb8c63f1bcab (diff)
ao-tools: Add ao-flash-stm32f0x
This new script uses openocd to flash stm32f0x parts Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/ao-flash/ao-flash-stm32f0x')
-rwxr-xr-xao-tools/ao-flash/ao-flash-stm32f0x16
1 files changed, 16 insertions, 0 deletions
diff --git a/ao-tools/ao-flash/ao-flash-stm32f0x b/ao-tools/ao-flash/ao-flash-stm32f0x
new file mode 100755
index 00000000..45643a4f
--- /dev/null
+++ b/ao-tools/ao-flash/ao-flash-stm32f0x
@@ -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