summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Fewell2018-06-18 13:06:35 -0500
committerEdward Fewell2018-06-18 13:06:35 -0500
commit9da1836923d9feb02355efb61fcc7743365dfcf8 (patch)
tree41d628359e4fd9e4fd183c8a689b52b019556972
parentff1d3713836383827cd61c91a54f8a94af32a81b (diff)
downloadopenocd-9da1836923d9feb02355efb61fcc7743365dfcf8.tar.gz
openocd-9da1836923d9feb02355efb61fcc7743365dfcf8.tar.xz
openocd-9da1836923d9feb02355efb61fcc7743365dfcf8.zip
Apply workarounds for reset issues
-rw-r--r--openocd/src/target/startup.tcl20
1 files changed, 19 insertions, 1 deletions
diff --git a/openocd/src/target/startup.tcl b/openocd/src/target/startup.tcl
index 9bbc6e3..6290b3a 100644
--- a/openocd/src/target/startup.tcl
+++ b/openocd/src/target/startup.tcl
@@ -80,7 +80,14 @@ proc ocd_process_reset_inner { MODE } {
80 foreach t $targets { 80 foreach t $targets {
81 # C code needs to know if we expect to 'halt' 81 # C code needs to know if we expect to 'halt'
82 if {![using_jtag] || [jtag tapisenabled [$t cget -chain-position]]} { 82 if {![using_jtag] || [jtag tapisenabled [$t cget -chain-position]]} {
83 $t arp_reset assert $halt 83 # TODO: Workaround for double nSRST pulse issue. The call to
84 # init_reset above will assert and deassert nSRST. But the
85 # steps to examine and restore debug connection only happen just
86 # after that point. This arp_reset call will assert nSRST again
87 # but examination will not happen again. Also, some of the events
88 # that fire need the target scan chain to be examined.
89 # So comment out this second nSRST assert as a quick workaround.
90 # $t arp_reset assert $halt
84 } 91 }
85 } 92 }
86 foreach t $targets { 93 foreach t $targets {
@@ -128,6 +135,17 @@ proc ocd_process_reset_inner { MODE } {
128 # Did we succeed? 135 # Did we succeed?
129 set s [$t curstate] 136 set s [$t curstate]
130 137
138 # TODO: Workaround for targets that cannot halt while reset is
139 # asserted. That halt during reset mechanism does not work for
140 # all target types, yet other scripts and commands assume that
141 # reset-halt always works. Added this bit so that failing to
142 # halt during reset is a warning and not fatal.
143 if { 0 != [string compare $s "halted" ] } {
144 echo "target did not halt at reset vector"
145 halt
146 set s [$t curstate]
147 }
148
131 if { 0 != [string compare $s "halted" ] } { 149 if { 0 != [string compare $s "halted" ] } {
132 return -code error [format "TARGET: %s - Not halted" $t] 150 return -code error [format "TARGET: %s - Not halted" $t]
133 } 151 }