2020-02-15 22:25:41 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-04-18 01:37:50 +02:00
|
|
|
if [[ -z $1 ]]; then
|
|
|
|
echo "Usage: $0 <ELF-file>"
|
|
|
|
exit -1
|
|
|
|
fi
|
|
|
|
|
2020-02-15 22:25:41 +01:00
|
|
|
JLinkGDBServer -if SWD -device STM32F407VE &
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
# Check if GDB server is still running
|
|
|
|
gdbpid=`pidof JLinkGDBServer`
|
|
|
|
|
|
|
|
if [[ $gdbpid == "" ]]; then
|
|
|
|
echo ""
|
|
|
|
echo "GDB Server not running! Check target connection."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2020-04-18 01:37:50 +02:00
|
|
|
arm-none-eabi-gdb -x program-device.gdb $1
|
2020-02-15 23:09:23 +01:00
|
|
|
sleep 2
|
2020-02-15 22:25:41 +01:00
|
|
|
|
|
|
|
kill $gdbpid
|