diff options
Diffstat (limited to 'ao-tools')
-rwxr-xr-x | ao-tools/ao-flash/ao-flash-stm | 35 | ||||
-rw-r--r-- | ao-tools/ao-test-baro/ao-test-baro.c | 2 | ||||
-rw-r--r-- | ao-tools/lib/ao-selfload.c | 1 |
3 files changed, 11 insertions, 27 deletions
diff --git a/ao-tools/ao-flash/ao-flash-stm b/ao-tools/ao-flash/ao-flash-stm index 9eebf5d2..a20428f2 100755 --- a/ao-tools/ao-flash/ao-flash-stm +++ b/ao-tools/ao-flash/ao-flash-stm @@ -5,29 +5,12 @@ case "$#" in exit 1 ;; esac - -ST_FLASH=st-flash - -if which $ST_FLASH > /dev/null; then - : -else - echo "$0: $ST_FLASH not found. Check to see if the stlink package is installed" - exit 1 -fi - -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 +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 diff --git a/ao-tools/ao-test-baro/ao-test-baro.c b/ao-tools/ao-test-baro/ao-test-baro.c index d2b81e4f..36c805c2 100644 --- a/ao-tools/ao-test-baro/ao-test-baro.c +++ b/ao-tools/ao-test-baro/ao-test-baro.c @@ -164,7 +164,7 @@ do_baro(struct cc_usb *usb) { double temperature = strtod(temp[2], NULL) / 100.0; double altitude = strtod(alt[1], NULL); - if (altitude < -50 || 3000 < altitude) { + if (altitude < -100 || 3000 < altitude) { printf ("weird altitude %f\n", altitude); free_baro(b); return 0; diff --git a/ao-tools/lib/ao-selfload.c b/ao-tools/lib/ao-selfload.c index 0a23dfda..754cd784 100644 --- a/ao-tools/lib/ao-selfload.c +++ b/ao-tools/lib/ao-selfload.c @@ -110,6 +110,7 @@ ao_self_write(struct cc_usb *cc, struct ao_hex_image *image) start = image->address; if (stop > image->address + image->length) stop = image->address + image->length; + memset(block, 0xff, 0x100); memcpy(block + start - address, image->data + start - image->address, stop - start); ao_self_block_write(cc, address, block); ao_self_block_read(cc, address, check); |