aboutsummaryrefslogtreecommitdiff
path: root/src/target/startup.tcl
diff options
context:
space:
mode:
authorcgsfv <cgsfv@users.noreply.github.com>2024-02-13 18:00:52 -0800
committercgsfv <cgsfv@users.noreply.github.com>2024-05-06 09:44:55 -0700
commit0c748e52c05f1780a9f89fa0590c92813d102aa6 (patch)
treeb050fe83bb51b937d0336f8661a40b06db3e486d /src/target/startup.tcl
parent87331a82a29a5aeb222543b6876e0208be70ea41 (diff)
downloadriscv-openocd-examine_unavailable_harts_squash.zip
riscv-openocd-examine_unavailable_harts_squash.tar.gz
riscv-openocd-examine_unavailable_harts_squash.tar.bz2
Improved handling of unavailable hartsexamine_unavailable_harts_squash
Added more handling of unexamined harts Added even more handling of unexamined harts Added cleaner handling of unexamined harts Fixing halt_set_dcsr_ebreak not setting hart explicitly enough Adding riscv013_halt_current_hart function Handling harts becoming available when halted Extending handling of unavailable harts Ensuring target is selected when resuming it Making halt_set_dcsr_ebreak more robust OK if target is unavailble after waiting for halt Can also use progbuf only for dcsr_ebreak Using progbuf for set_dcsr_break now works Handle unavailability when deasserting reset
Diffstat (limited to 'src/target/startup.tcl')
-rw-r--r--src/target/startup.tcl13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/target/startup.tcl b/src/target/startup.tcl
index 75e0edc..8ddac0c 100644
--- a/src/target/startup.tcl
+++ b/src/target/startup.tcl
@@ -131,6 +131,11 @@ proc ocd_process_reset_inner { MODE } {
}
}
+ # no need to wait for a target that is unavailable anyway
+ if { [$t curstate] == "unavailable" } {
+ continue
+ }
+
# Wait up to 1 second for target to halt. Why 1sec? Cause
# the JTAG tap reset signal might be hooked to a slow
# resistor/capacitor circuit - and it might take a while
@@ -142,8 +147,11 @@ proc ocd_process_reset_inner { MODE } {
# Did we succeed?
set s [$t curstate]
+ if { $s == "unavailable" } {
+ continue
+ }
if { $s != "halted" } {
- return -code error [format "TARGET: %s - Not halted" $t]
+ return -code error [format "TARGET: %s - Not halted (%s)" $t $s]
}
}
}
@@ -160,6 +168,9 @@ proc ocd_process_reset_inner { MODE } {
if { ![$t was_examined] && [$t examine_deferred] } {
continue
}
+ if { [$t curstate] == "unavailable" } {
+ continue
+ }
set err [catch "$t arp_waitstate halted 5000"]
# Did it halt?