We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cef432 commit de4fc3dCopy full SHA for de4fc3d
src/target/riscv_debug.c
@@ -747,10 +747,12 @@ static bool riscv_check_error(target_s *const target)
747
748
static bool riscv_dm_poll_state(riscv_dm_s *const dbg_module, const uint32_t state)
749
{
750
+ platform_timeout_s timeout;
751
+ platform_timeout_set(&timeout, 500U);
752
/* Poll for the requested state to become set */
753
uint32_t status = 0;
754
while (!(status & state)) {
- if (!riscv_dm_read(dbg_module, RV_DM_STATUS, &status))
755
+ if (!riscv_dm_read(dbg_module, RV_DM_STATUS, &status) || platform_timeout_is_expired(&timeout))
756
return false;
757
}
758
return true;
0 commit comments