diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2016-05-26 13:27:04 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2016-05-26 13:27:04 +0200 |
commit | ea0c0ce7e1cee6d65e70ccd0723ea59e08662e19 (patch) | |
tree | c618dae03aa13716a66923c3b04b84514fb3ff88 /bin | |
parent | 684b0c04b0eb81a8b587fe89d093a4499d960c28 (diff) |
Figure out if the user (me) has a NUCLEO board.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/debug | 4 | ||||
-rwxr-xr-x | bin/flash-target | 5 | ||||
-rwxr-xr-x | bin/reset | 4 |
3 files changed, 9 insertions, 4 deletions
@@ -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" @@ -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" |