aboutsummaryrefslogtreecommitdiff
path: root/buildroot/share/PlatformIO/variants/archim/debug_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'buildroot/share/PlatformIO/variants/archim/debug_scripts')
-rw-r--r--buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_flash.gdb37
-rw-r--r--buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_sram.gdb37
-rw-r--r--buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_flash.mac44
-rw-r--r--buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_sram.mac44
4 files changed, 162 insertions, 0 deletions
diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_flash.gdb b/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_flash.gdb
new file mode 100644
index 0000000..4e8375b
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_flash.gdb
@@ -0,0 +1,37 @@
+#*******************************************************
+#
+# Connect to J-Link and debug application in flash on SAM3X.
+#
+
+# 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 = AT91SAM3X8E
+
+# Enable flash download and flash breakpoints
+monitor flash download = 1
+
+# Load the program
+load
+
+# Reset peripheral (RSTC_CR)
+set *0x400e1a00 = 0xA5000004
+
+# Initialize PC and stack pointer
+mon reg sp=(0x80000)
+#set *0x80004 = *0x80004 & 0xFFFFFFFE
+mon reg pc=(0x80004)
+
+info reg
+
+break main
+
+# End of 'reset' command
+end
diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_sram.gdb b/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_sram.gdb
new file mode 100644
index 0000000..15a1792
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/archim/debug_scripts/gcc/arduino_due_x_sram.gdb
@@ -0,0 +1,37 @@
+#*******************************************************
+#
+# Connect to J-Link and debug application in sram on SAM3X.
+#
+
+# 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 = AT91SAM3X8E
+
+# Enable flash download and flash breakpoints
+monitor flash download = 1
+
+# Load the program
+load
+
+# Reset peripheral (RSTC_CR)
+set *0x400e1a00 = 0xA5000004
+
+# Initialize PC and stack pointer
+mon reg sp=(0x20000000)
+#set *0x20000004 = *0x20000004 & 0xFFFFFFFE
+mon reg pc=(0x20000004)
+
+info reg
+
+break main
+
+# End of 'reset' command
+end
diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_flash.mac b/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_flash.mac
new file mode 100644
index 0000000..9595835
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_flash.mac
@@ -0,0 +1,44 @@
+// ---------------------------------------------------------
+// ATMEL Microcontroller Software Support - ROUSSET -
+// ---------------------------------------------------------
+// The software is delivered "AS IS" without warranty or
+// condition of any kind, either express, implied or
+// statutory. This includes without limitation any warranty
+// or condition with respect to merchantability or fitness
+// for any particular purpose, or against the infringements of
+// intellectual property rights of others.
+// ---------------------------------------------------------
+// File: at91sam3u-ek-flash.mac
+// User setup file for CSPY debugger.
+// ---------------------------------------------------------
+__var __mac_i;
+__var __mac_pt;
+
+/*********************************************************************
+*
+* execUserReset()
+*/
+execUserReset()
+{
+ __message "------------------------------ execUserReset ---------------------------------";
+ __message "-------------------------------Set PC Reset ----------------------------------";
+
+ __hwReset(0);
+
+ // perpheral reset RSTC_CR
+ __writeMemory32(0xA5000004,0x400e1200,"Memory");
+}
+
+/*********************************************************************
+*
+* execUserPreload()
+*/
+execUserPreload()
+{
+ __message "------------------------------ execUserPreload ---------------------------------";
+
+ __hwReset(0); //* Hardware Reset: CPU is automatically halted after the reset
+
+ // perpheral reset RSTC_CR
+ __writeMemory32(0xA5000004,0x400e1200,"Memory");
+}
diff --git a/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_sram.mac b/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_sram.mac
new file mode 100644
index 0000000..d97a4ab
--- /dev/null
+++ b/buildroot/share/PlatformIO/variants/archim/debug_scripts/iar/arduino_due_sram.mac
@@ -0,0 +1,44 @@
+// ---------------------------------------------------------
+// ATMEL Microcontroller Software Support - ROUSSET -
+// ---------------------------------------------------------
+// The software is delivered "AS IS" without warranty or
+// condition of any kind, either express, implied or
+// statutory. This includes without limitation any warranty
+// or condition with respect to merchantability or fitness
+// for any particular purpose, or against the infringements of
+// intellectual property rights of others.
+// ---------------------------------------------------------
+// File: at91sam3u-ek-sram.mac
+// User setup file for CSPY debugger.
+// ---------------------------------------------------------
+__var __mac_i;
+__var __mac_pt;
+
+/*********************************************************************
+*
+* execUserReset()
+*/
+execUserReset()
+{
+ __message "------------------------------ execUserReset ---------------------------------";
+ __message "-------------------------------Set PC Reset ----------------------------------";
+
+ //__hwReset(50);
+
+ // perpheral reset RSTC_CR
+ __writeMemory32(0xA5000004,0x400e1200,"Memory");
+}
+
+/*********************************************************************
+*
+* execUserPreload()
+*/
+execUserPreload()
+{
+ __message "------------------------------ execUserPreload ---------------------------------";
+
+ __hwReset(0); //* Hardware Reset: CPU is automatically halted after the reset
+
+ // perpheral reset RSTC_CR
+ __writeMemory32(0xA5000004,0x400e1200,"Memory");
+}