aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/libboard/common/resources/sam3s_ek_flash.gdb
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/libboard/common/resources/sam3s_ek_flash.gdb')
-rw-r--r--firmware/libboard/common/resources/sam3s_ek_flash.gdb31
1 files changed, 31 insertions, 0 deletions
diff --git a/firmware/libboard/common/resources/sam3s_ek_flash.gdb b/firmware/libboard/common/resources/sam3s_ek_flash.gdb
new file mode 100644
index 0000000..7d79615
--- /dev/null
+++ b/firmware/libboard/common/resources/sam3s_ek_flash.gdb
@@ -0,0 +1,31 @@
+#*******************************************************
+#
+# Connect to J-Link and debug application in flash.
+#
+
+# define 'reset' command
+define reset
+
+# Connect to the J-Link gdb server
+target remote localhost:2331
+# Reset the chip to get to a known state
+monitor reset
+
+# Select flash device
+monitor flash device = AT91SAM3S4C
+# Enable flash download and flash breakpoints
+monitor flash download = 1
+# Load the program
+load
+
+# Reset peripheral (RSTC_CR)
+set *0x400e1400 = 0xA5000004
+
+# Initializing PC and stack pointer
+mon reg sp=(0x400000)
+set *0x400004 = *0x400004 & 0xFFFFFFFE
+mon reg pc=(0x400004)
+info reg
+
+# end of 'reset' command
+end