esac
cmds=/tmp/flash$$
trap "rm $cmds" 0 1 15
-for file in "$@"; do
- echo "flash write_image $file"
-done > $cmds
+file="$1"
+echo "program $file reset" > $cmds
openocd \
-f interface/stlink-v2.cfg \
- -f target/stm32lx_stlink.cfg \
- -c init \
- -c 'reset halt' \
+ -f target/stm32l1.cfg \
-f $cmds \
- -c 'reset init' \
- -c 'reset run' \
-c shutdown