Merge pull request #726 from riscv/timeout_msg

Add error message when dmstatus read times out.
This commit is contained in:
Tim Newsome 2022-09-14 09:47:28 -07:00 committed by GitHub
commit b3d64741c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -701,8 +701,14 @@ int dmstatus_read_timeout(struct target *target, uint32_t *dmstatus,
int dmstatus_read(struct target *target, uint32_t *dmstatus, int dmstatus_read(struct target *target, uint32_t *dmstatus,
bool authenticated) bool authenticated)
{ {
return dmstatus_read_timeout(target, dmstatus, authenticated, int result = dmstatus_read_timeout(target, dmstatus, authenticated,
riscv_command_timeout_sec); 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) static void increase_ac_busy_delay(struct target *target)