From 84a17109915a016521654790641be4cd14cdfbc5 Mon Sep 17 00:00:00 2001
From: Karl Palsson <karlp@remake.is>
Date: Tue, 26 Mar 2013 15:00:08 +0000
Subject: [PATCH] [stlink2] Describe how to reset on connect

Update the commentary to describe how you can connect to stm32 devices
that are in lockup or asleep, by using the nRST line.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
---
 tcl/board/stm320518_eval_stlink.cfg | 7 ++++++-
 tcl/board/stm3220g_eval_stlink.cfg  | 7 ++++++-
 tcl/board/stm3241g_eval_stlink.cfg  | 7 ++++++-
 tcl/board/stm32f0discovery.cfg      | 7 ++++++-
 tcl/board/stm32f3discovery.cfg      | 7 ++++++-
 tcl/board/stm32f4discovery.cfg      | 7 ++++++-
 tcl/board/stm32ldiscovery.cfg       | 7 ++++++-
 7 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/tcl/board/stm320518_eval_stlink.cfg b/tcl/board/stm320518_eval_stlink.cfg
index 804ff2c..d005614 100644
--- a/tcl/board/stm320518_eval_stlink.cfg
+++ b/tcl/board/stm320518_eval_stlink.cfg
@@ -14,5 +14,10 @@ set CHIPNAME STM32F051R8T6
 
 source [find target/stm32f0x_stlink.cfg]
 
-# use hardware reset, connect under reset
+# Use _one_ of the following
+# Can connect under reset, can connect without interrupting a running target
 reset_config srst_only srst_nogate
+
+# Resets target while connecting, helpful for attaching to a target in
+# sleep modes or lockup states.
+#reset_config srst_only srst_nogate connect_assert_srst
diff --git a/tcl/board/stm3220g_eval_stlink.cfg b/tcl/board/stm3220g_eval_stlink.cfg
index 578a0e8..0b208e9 100644
--- a/tcl/board/stm3220g_eval_stlink.cfg
+++ b/tcl/board/stm3220g_eval_stlink.cfg
@@ -14,5 +14,10 @@ set CHIPNAME STM32F207IGH6
 
 source [find target/stm32f2x_stlink.cfg]
 
-# use hardware reset, connect under reset
+# Use _one_ of the following
+# Can connect under reset, can connect without interrupting a running target
 reset_config srst_only srst_nogate
+
+# Resets target while connecting, helpful for attaching to a target in
+# sleep modes or lockup states.
+#reset_config srst_only srst_nogate connect_assert_srst
diff --git a/tcl/board/stm3241g_eval_stlink.cfg b/tcl/board/stm3241g_eval_stlink.cfg
index 4e3beb9..90a2f1b 100644
--- a/tcl/board/stm3241g_eval_stlink.cfg
+++ b/tcl/board/stm3241g_eval_stlink.cfg
@@ -14,5 +14,10 @@ set CHIPNAME STM32F417IGH6
 
 source [find target/stm32f4x_stlink.cfg]
 
-# use hardware reset, connect under reset
+# Use _one_ of the following
+# Can connect under reset, can connect without interrupting a running target
 reset_config srst_only srst_nogate
+
+# Resets target while connecting, helpful for attaching to a target in
+# sleep modes or lockup states.
+#reset_config srst_only srst_nogate connect_assert_srst
diff --git a/tcl/board/stm32f0discovery.cfg b/tcl/board/stm32f0discovery.cfg
index 678eea6..0237ba3 100644
--- a/tcl/board/stm32f0discovery.cfg
+++ b/tcl/board/stm32f0discovery.cfg
@@ -6,5 +6,10 @@ source [find interface/stlink-v2.cfg]
 set WORKAREASIZE 0x2000
 source [find target/stm32f0x_stlink.cfg]
 
-# use hardware reset, connect under reset
+# Use _one_ of the following
+# Can connect under reset, can connect without interrupting a running target
 reset_config srst_only srst_nogate
+
+# Resets target while connecting, helpful for attaching to a target in
+# sleep modes or lockup states.
+#reset_config srst_only srst_nogate connect_assert_srst
diff --git a/tcl/board/stm32f3discovery.cfg b/tcl/board/stm32f3discovery.cfg
index 5fd5950..5839aee 100644
--- a/tcl/board/stm32f3discovery.cfg
+++ b/tcl/board/stm32f3discovery.cfg
@@ -5,5 +5,10 @@ source [find interface/stlink-v2.cfg]
 
 source [find target/stm32f3x_stlink.cfg]
 
-# use hardware reset, connect under reset
+# Use _one_ of the following
+# Can connect under reset, can connect without interrupting a running target
 reset_config srst_only srst_nogate
+
+# Resets target while connecting, helpful for attaching to a target in
+# sleep modes or lockup states.
+#reset_config srst_only srst_nogate connect_assert_srst
diff --git a/tcl/board/stm32f4discovery.cfg b/tcl/board/stm32f4discovery.cfg
index ae54e18..f61e613 100644
--- a/tcl/board/stm32f4discovery.cfg
+++ b/tcl/board/stm32f4discovery.cfg
@@ -5,5 +5,10 @@ source [find interface/stlink-v2.cfg]
 
 source [find target/stm32f4x_stlink.cfg]
 
-# use hardware reset, connect under reset
+# Use _one_ of the following
+# Can connect under reset, can connect without interrupting a running target
 reset_config srst_only srst_nogate
+
+# Resets target while connecting, helpful for attaching to a target in
+# sleep modes or lockup states.
+#reset_config srst_only srst_nogate connect_assert_srst
diff --git a/tcl/board/stm32ldiscovery.cfg b/tcl/board/stm32ldiscovery.cfg
index 3318119..4a8ca33 100644
--- a/tcl/board/stm32ldiscovery.cfg
+++ b/tcl/board/stm32ldiscovery.cfg
@@ -6,5 +6,10 @@ source [find interface/stlink-v2.cfg]
 set WORKAREASIZE 0x4000
 source [find target/stm32lx_stlink.cfg]
 
-# use hardware reset, connect under reset
+# Use _one_ of the following
+# Can connect under reset, can connect without interrupting a running target
 reset_config srst_only srst_nogate
+
+# Resets target while connecting, helpful for attaching to a target in
+# sleep modes or lockup states.
+#reset_config srst_only srst_nogate connect_assert_srst
-- 
1.7.11.7

