From 6d658033a4e2b0d2cce4d3ada5c89e5ed5bfd3cb Mon Sep 17 00:00:00 2001
From: batt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Date: Thu, 27 Aug 2009 14:52:38 +0000
Subject: [PATCH] Add Openocd debug configuration and gdb init script.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2801 38d2e660-2303-0410-9eaa-f027e97ec537
---
 bertos/cpu/arm/scripts/openocd/debug.cfg    | 23 +++++++++++++++++++++
 bertos/cpu/arm/scripts/openocd/gdbinit-sam7 |  2 ++
 2 files changed, 25 insertions(+)
 create mode 100644 bertos/cpu/arm/scripts/openocd/debug.cfg
 create mode 100644 bertos/cpu/arm/scripts/openocd/gdbinit-sam7

diff --git a/bertos/cpu/arm/scripts/openocd/debug.cfg b/bertos/cpu/arm/scripts/openocd/debug.cfg
new file mode 100644
index 00000000..70e33c09
--- /dev/null
+++ b/bertos/cpu/arm/scripts/openocd/debug.cfg
@@ -0,0 +1,23 @@
+# Change the default telnet port...
+telnet_port 4444
+
+# Port for TCL connection.
+tcl_port 6666
+
+# GDB connects here
+gdb_port 3333
+
+source [find PROGRAMMER_TYPE]
+
+source [find PROGRAMMER_CPU]
+
+$_TARGETNAME configure -event reset-start {
+	cpu_setup
+}
+
+$_TARGETNAME configure -event gdb-detach {
+	shutdown
+}
+
+init
+reset run
diff --git a/bertos/cpu/arm/scripts/openocd/gdbinit-sam7 b/bertos/cpu/arm/scripts/openocd/gdbinit-sam7
new file mode 100644
index 00000000..3f8067dc
--- /dev/null
+++ b/bertos/cpu/arm/scripts/openocd/gdbinit-sam7
@@ -0,0 +1,2 @@
+monitor soft_reset_halt
+thbreak main
-- 
2.34.1