2014-06-11 14:59:24 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -L "$0" ]; then
|
|
|
|
FILE=$(readlink "$0")
|
|
|
|
else
|
|
|
|
FILE="$0"
|
|
|
|
fi
|
|
|
|
|
|
|
|
BIN_FOLDER=$(dirname "${FILE}")
|
|
|
|
|
|
|
|
openocd -f "${BIN_FOLDER}/${BOARD}_jtag.cfg" \
|
2014-09-02 10:33:04 +02:00
|
|
|
-f "target/stm32f1x.cfg" \
|
|
|
|
-c "tcl_port 6333" \
|
|
|
|
-c "telnet_port 4444" \
|
|
|
|
-c "init" \
|
|
|
|
-c "targets" \
|
|
|
|
-c "reset halt" \
|
|
|
|
-l /dev/null &
|
|
|
|
|
2014-09-02 11:41:41 +02:00
|
|
|
# save pid to terminate afterwards
|
|
|
|
OCD_PID=$?
|
|
|
|
|
2014-09-02 10:33:04 +02:00
|
|
|
# needed for openocd to set up
|
|
|
|
sleep 5
|
|
|
|
|
|
|
|
arm-none-eabi-gdb -tui --command=${1} ${2}
|
|
|
|
|
2014-09-02 11:41:41 +02:00
|
|
|
kill ${OCD_PID}
|