ao-tools/ao-flash/ao-flash-lpc
raw| 1 | #!/bin/sh |
| 2 | case "$#" in |
| 3 | 0) |
| 4 | echo "usage: $0 <filename> ..." |
| 5 | exit 1 |
| 6 | ;; |
| 7 | esac |
| 8 | cmds=/tmp/flash$$ |
| 9 | trap "rm $cmds" 0 1 15 |
| 10 | file="$1" |
| 11 | echo "program $file reset" > $cmds |
| 12 | openocd \ |
| 13 | -f interface/stlink-v2.cfg \ |
| 14 | -f target/lpc11xx.cfg \ |
| 15 | -c 'adapter speed 1000' \ |
| 16 | -f $cmds \ |
| 17 | -c shutdown |