diff options
Diffstat (limited to 'nuttx/configs/olimex-strp711/scripts/oocd.sh')
-rwxr-xr-x | nuttx/configs/olimex-strp711/scripts/oocd.sh | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/nuttx/configs/olimex-strp711/scripts/oocd.sh b/nuttx/configs/olimex-strp711/scripts/oocd.sh index 44ff4fa6f..556d97798 100755 --- a/nuttx/configs/olimex-strp711/scripts/oocd.sh +++ b/nuttx/configs/olimex-strp711/scripts/oocd.sh @@ -2,8 +2,17 @@ # Set up pathes to binaries, scripts, configuration files -installdir=/usr/local/bin -openocd=$installdir/openocd +hostos=`uname -o` +if [ "X${hostos}" = "XCygwin" ]; then + installdir=/cygdrive/c/gccfd/openocd/bin + ft2exe=$installdir/openocd-ftd2xx.exe + ppexe=$installdir/openocd-ppdev.exe +else + installdir=/usr/local/bin + ft2exe=$installdir/openocd + ppexe=$installdir/openocd + SUDO=sudo +fi # The root to the top-level NuttX directory should be in an environment variable @@ -15,7 +24,7 @@ if [ -z $STR41XSCRIPTS ]; then fi # Check that at least one configuration file exists at that point -if [ ! -f $STR41XSCRIPTS/oocd_wiggler.cfg ]; then +if [ ! -f $STR41XSCRIPTS/oocd_ft2xx.cfg ]; then echo "No configuration files found at $STR41XSCRIPTS" echo "Path to configuration files unknown" exit 1 @@ -23,11 +32,11 @@ fi # Parse command line inputs -usage="USAGE: $0 [-h] [-d] [-pp] [-ftdi]" +usage="USAGE: $0 [-h] [-d] [-pp] [-ft2xx]" debug=no -interface=pp -oocdcfg=$STR41XSCRIPTS/oocd_wiggler.cfg +oocdcfg=$STR41XSCRIPTS/oocd_ft2xx.cfg +openocd=$ft2exe while [ ! -z "$1" ]; do case $1 in -d ) @@ -35,12 +44,12 @@ while [ ! -z "$1" ]; do set -x ;; -pp ) - interface=pp oocdcfg=$STR41XSCRIPTS/oocd_wiggler.cfg + openocd=$ppexe ;; - -ftdi ) - interface=ftdi - oocdcfg=$STR41XSCRIPTS/oocd_ftdi.cfg + -ft2xx ) + oocdcfg=$STR41XSCRIPTS/oocd_ft2xx.cfg + openocd=$ft2exe ;; -h ) echo $usage @@ -62,4 +71,9 @@ export options="-d 1" # Run OpenOCD -- here it is assumed (1) that you must have root priveleges to # execute OpenOCD and (2) that your user is listed in the /etc/sudoers file. -sudo $openocd $options -f $oocdcfg +$SUDO $openocd $options -f $oocdcfg +if [ "X${hostos}" = "XCygwin" ]; then + $openocd $options -f `cygpath -w $oocdcfg` +else + sudo $openocd $options -f $oocdcfg +fi |