diff options
Diffstat (limited to 'ao-tools/ao-flash/ao-flash-stm')
| -rw-r--r-- | ao-tools/ao-flash/ao-flash-stm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ao-tools/ao-flash/ao-flash-stm b/ao-tools/ao-flash/ao-flash-stm new file mode 100644 index 00000000..c5aeb7ae --- /dev/null +++ b/ao-tools/ao-flash/ao-flash-stm @@ -0,0 +1,21 @@ +#!/bin/sh +case "$#" in +0) + echo "usage: $0 <filename> ..." + exit 1 + ;; +esac +cmds=/tmp/flash$$ +trap "rm $cmds" 0 1 15 +for file in "$@"; do + echo "flash write_image $file" +done > $cmds +openocd \ + -f interface/stlink-v2.cfg \ + -f target/stm32lx_stlink.cfg \ + -c init \ + -c 'reset halt' \ + -f $cmds \ + -c 'reset init' \ + -c 'reset run' \ + -c shutdown |
