Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 9b8f7ea

Browse files
committed
riscv_debug: Unconditionally disable triggers during attach
1 parent efecf9d commit 9b8f7ea

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/target/riscv_debug.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,12 @@ bool riscv_attach(target_s *const target)
10521052
/* We then also need to select the Hart again so we're poking with the right one on the target */
10531053
if (!riscv_dm_write(hart->dbg_module, RV_DM_CONTROL, hart->hartsel))
10541054
return false;
1055+
/* Clear any stale triggers */
1056+
for (size_t trigger = 0U; trigger < hart->triggers; trigger++) {
1057+
const uint32_t tdata1 = 0U;
1058+
const uint32_t tdata2 = 0U;
1059+
riscv_config_trigger(hart, trigger, RISCV_TRIGGER_MODE_UNUSED, &tdata1, &tdata2);
1060+
}
10551061
/* We then need to halt the hart so the attach process can function */
10561062
riscv_halt_request(target);
10571063
return true;

0 commit comments

Comments
 (0)