Skip to content

Commit 1d62381

Browse files
authored
Merge pull request #1193 from en-sc/en-sc/not-busy
target/riscv: clear `abstract_cmd_maybe_busy` after commands
2 parents 058891a + 83dc8a6 commit 1d62381

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/target/riscv/riscv-013.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,15 @@ static int abstract_cmd_batch_check_and_clear_cmderr(struct target *target,
630630
if (res != ERROR_OK)
631631
goto clear_cmderr;
632632
}
633+
634+
dm013_info_t * const dm = get_dm(target);
635+
if (!dm) {
636+
LOG_ERROR("BUG: Target %s is not assigned to any RISC-V debug module",
637+
target_name(target));
638+
return ERROR_FAIL;
639+
}
640+
dm->abstract_cmd_maybe_busy = false;
641+
633642
*cmderr = get_field32(abstractcs, DM_ABSTRACTCS_CMDERR);
634643
if (*cmderr == CMDERR_NONE)
635644
return ERROR_OK;

0 commit comments

Comments
 (0)