summaryrefslogtreecommitdiff
path: root/firmware/gdb.sh
blob: 233e4158de603d205a80b82139d07fd6cc075211 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh


# Usage: ./gdb.sh path/to/my/firmware.elf  # call ocd.sh script before this


ELF_FILE=$1


# disable confirmation messages, connect to MCU via openocd server, reset MCU
# and instantly stop execution
arm-none-eabi-gdb "${ELF_FILE}" \
	-ex 'set confirm off' \
	-ex 'target extended-remote localhost:3333' \
	-ex 'monitor reset halt'

# now you can flash the firmware with 'load' and run it with 'run'