mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 23:11:19 +01:00
29 lines
445 B
Bash
Executable File
29 lines
445 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ ! -f "$2" ]; then
|
|
echo "ELF-file $2 does not exist"
|
|
exit 1
|
|
fi
|
|
|
|
echo "##"
|
|
echo "## Debugging $2"
|
|
echo "##"
|
|
|
|
openocd -f "board/stm32f3discovery.cfg" \
|
|
-c "tcl_port 6333" \
|
|
-c "telnet_port 4444" \
|
|
-c "init" \
|
|
-c "targets" \
|
|
-c "reset halt" \
|
|
-l /dev/null &
|
|
|
|
# save pid to terminate afterwards
|
|
OCD_PID=$?
|
|
|
|
# needed for openocd to set up
|
|
sleep 2
|
|
|
|
arm-none-eabi-gdb -tui -command=$1 $2
|
|
|
|
kill ${OCD_PID}
|