summaryrefslogtreecommitdiff
path: root/ao-tools/ao-flash
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-12-18 11:07:55 -0800
committerKeith Packard <keithp@keithp.com>2013-12-18 11:07:55 -0800
commit8fdbdebdbb4d1579fd2af47430807d0d2a78105b (patch)
treeb92f893406d15bea671f45493917e9ca73ec05ff /ao-tools/ao-flash
parent8f529633cd4be8a0edb1b067bbf5d7cc055dcc1b (diff)
ao-tools: complain if st-flash is not available
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/ao-flash')
-rw-r--r--ao-tools/ao-flash/ao-flash-stm11
1 files changed, 10 insertions, 1 deletions
diff --git a/ao-tools/ao-flash/ao-flash-stm b/ao-tools/ao-flash/ao-flash-stm
index 993258e5..9eebf5d2 100644
--- a/ao-tools/ao-flash/ao-flash-stm
+++ b/ao-tools/ao-flash/ao-flash-stm
@@ -6,6 +6,15 @@ case "$#" in
;;
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
@@ -21,4 +30,4 @@ esac
arm-none-eabi-objcopy -O binary $file $bin
-st-flash --reset write $bin $base \ No newline at end of file
+$ST_FLASH --reset write $bin $base