aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-09-13 10:17:56 -0700
committerTim Newsome <tim@sifive.com>2022-09-13 10:18:39 -0700
commit8832d4be97ee4291f1f06ae06d69f35902305ab8 (patch)
treef5355b6a83462b04c149fecaa79cd19ab032f1a2
parent911d68ef25ab6996110cc618279b600fe82591e5 (diff)
downloadriscv-openocd-8832d4be97ee4291f1f06ae06d69f35902305ab8.zip
riscv-openocd-8832d4be97ee4291f1f06ae06d69f35902305ab8.tar.gz
riscv-openocd-8832d4be97ee4291f1f06ae06d69f35902305ab8.tar.bz2
Add error message when dmstatus read times out.
Otherwise OpenOCD simply doesn't work without giving any indication why. Change-Id: I21703fc1a0d9bed2f59da95f8a8395fe139484a4 Signed-off-by: Tim Newsome <tim@sifive.com>
-rw-r--r--src/target/riscv/riscv-013.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 24895e9..a2d887e 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -701,8 +701,14 @@ int dmstatus_read_timeout(struct target *target, uint32_t *dmstatus,
int dmstatus_read(struct target *target, uint32_t *dmstatus,
bool authenticated)
{
- return dmstatus_read_timeout(target, dmstatus, authenticated,
+ int result = dmstatus_read_timeout(target, dmstatus, authenticated,
riscv_command_timeout_sec);
+ if (result == ERROR_TIMEOUT_REACHED)
+ LOG_TARGET_ERROR(target, "DMSTATUS read didn't complete in %d seconds. The target is "
+ "either really slow or broken. You could increase the "
+ "timeout with `riscv set_command_timeout_sec`.",
+ riscv_command_timeout_sec);
+ return result;
}
static void increase_ac_busy_delay(struct target *target)