2010-09-22 15:10:42 +02:00
|
|
|
#/bin/bash
|
|
|
|
|
|
|
|
if [ $# -le 0 ]; then
|
2015-05-19 12:25:10 +02:00
|
|
|
echo "usage: $0 [openocd interface name] [openocd args]" >&2
|
|
|
|
echo " common interfaces: olimex-arm-usb-ocd olimex-jtag-tiny olimex-jtag-tiny-a"
|
|
|
|
echo ""
|
|
|
|
echo "using default olimex-jtag-tiny-a"
|
|
|
|
INTERFACE=olimex-jtag-tiny-a
|
2010-09-22 15:10:42 +02:00
|
|
|
else
|
2015-05-19 12:25:10 +02:00
|
|
|
INTERFACE=$1
|
|
|
|
shift
|
2010-09-22 15:10:42 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $# -ge 1 ]; then
|
2015-05-19 12:25:10 +02:00
|
|
|
COMMAND=$@
|
2010-09-22 15:10:42 +02:00
|
|
|
else
|
2015-05-19 12:25:10 +02:00
|
|
|
COMMAND="debug_level 1"
|
2010-09-22 15:10:42 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${OS}" = "Windows_NT" ]; then
|
2015-05-19 12:25:10 +02:00
|
|
|
WINDOWS=1
|
2010-09-22 15:10:42 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x${WINDOWS}x" = "xx" ]; then
|
2015-05-19 12:25:10 +02:00
|
|
|
xterm -e "openocd -s ../../.. -f interface/${INTERFACE}.cfg -f board/pttu/tools/openocd-pttu.cfg -c \"${COMMAND}\"|| read" &
|
2010-09-22 15:10:42 +02:00
|
|
|
else
|
2015-05-19 12:25:10 +02:00
|
|
|
echo ${COMMAND}
|
|
|
|
#cmd /C start "OpenOCD PTTU using ${INTERFACE}"
|
|
|
|
openocd-ftd2xx.exe -s ../../.. -f interface/${INTERFACE}.cfg -f board/pttu/tools/openocd-pttu.cfg -c "${COMMAND}"
|
2010-09-22 15:10:42 +02:00
|
|
|
fi
|