summaryrefslogtreecommitdiff
path: root/firmware/gdb.sh
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/gdb.sh')
-rwxr-xr-xfirmware/gdb.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/firmware/gdb.sh b/firmware/gdb.sh
new file mode 100755
index 0000000..45d36ab
--- /dev/null
+++ b/firmware/gdb.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+
+# Usage: bash 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'