X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-flash%2Fao-flash-stm;h=a20428f29240484dfa55f9ddd47946e5479f9e27;hp=993258e5f0be2a9b37b9db1dceabcac768a17e0e;hb=7bb4dbab45f98dd5fd85d9daf12d27b153c0ef3a;hpb=1562affc4951e147eba20380ea5be2e9f7152789 diff --git a/ao-tools/ao-flash/ao-flash-stm b/ao-tools/ao-flash/ao-flash-stm old mode 100644 new mode 100755 index 993258e5..a20428f2 --- a/ao-tools/ao-flash/ao-flash-stm +++ b/ao-tools/ao-flash/ao-flash-stm @@ -5,20 +5,12 @@ case "$#" in exit 1 ;; esac - -file=$1 - -bin=/tmp/flash$$.bin -trap "rm $bin" 0 1 15 - -base=`arm-none-eabi-nm $file | awk '/interrupt_vector/ { print $1 }'` -case x"$base" in -x) - echo "$file: No interrupt vector address found" - exit 1 - ;; -esac - -arm-none-eabi-objcopy -O binary $file $bin - -st-flash --reset write $bin $base \ No newline at end of file +cmds=/tmp/flash$$ +trap "rm $cmds" 0 1 15 +file="$1" +echo "program $file reset" > $cmds +openocd \ + -f interface/stlink-v2.cfg \ + -f target/stm32l1.cfg \ + -f $cmds \ + -c shutdown