aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/debug4
-rwxr-xr-xbin/flash-target5
-rwxr-xr-xbin/reset4
3 files changed, 9 insertions, 4 deletions
diff --git a/bin/debug b/bin/debug
index 9309e66..f87a3b5 100755
--- a/bin/debug
+++ b/bin/debug
@@ -5,7 +5,9 @@ PROJ="${1?'project'}"
OPENOCD=openocd
OPENOCD_BOARD_DIR=/usr/share/openocd/scripts/board
OPENOCD_PROC_FILE=stm32f4discovery.cfg
-#OPENOCD_PROC_FILE=st_nucleo_f4.cfg
+if [ "x`lsusb -d 0483:374b`" != "x" ]; then
+ OPENOCD_PROC_FILE=st_nucleo_f4.cfg
+fi
$OPENOCD -f $OPENOCD_BOARD_DIR/$OPENOCD_PROC_FILE &
GDB=arm-none-eabi-gdb
diff --git a/bin/flash-target b/bin/flash-target
index aa77a99..0d60c85 100755
--- a/bin/flash-target
+++ b/bin/flash-target
@@ -1,7 +1,6 @@
#!/bin/sh
PROJ="${1?'project'}"
-
OPENOCD=openocd
# location of OpenOCD Board .cfg files (only used with 'make flash-target')
@@ -22,6 +21,8 @@ OPENOCD_BOARD_DIR=/usr/share/openocd/scripts/board
# the OPENOCD_BOARD_DIR directory.
#
OPENOCD_PROC_FILE=stm32f4discovery.cfg
-#OPENOCD_PROC_FILE=st_nucleo_f4.cfg
+if [ "x`lsusb -d 0483:374b`" != "x" ]; then
+ OPENOCD_PROC_FILE=st_nucleo_f4.cfg
+fi
$OPENOCD -f $OPENOCD_BOARD_DIR/$OPENOCD_PROC_FILE -c "program $PROJ.elf verify reset exit"
diff --git a/bin/reset b/bin/reset
index 4461cf1..1c57f97 100755
--- a/bin/reset
+++ b/bin/reset
@@ -20,6 +20,8 @@ OPENOCD_BOARD_DIR=/usr/share/openocd/scripts/board
# the OPENOCD_BOARD_DIR directory.
#
OPENOCD_PROC_FILE=stm32f4discovery.cfg
-#OPENOCD_PROC_FILE=st_nucleo_f4.cfg
+if [ "x`lsusb -d 0483:374b`" != "x" ]; then
+ OPENOCD_PROC_FILE=st_nucleo_f4.cfg
+fi
$OPENOCD -f $OPENOCD_BOARD_DIR/$OPENOCD_PROC_FILE -c "init" -c "reset run" -c "exit"