diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 8d76c4aa4..24d633d87 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1067,6 +1067,7 @@ int riscv_openocd_poll(struct target *target) if (riscv_rtos_enabled(target)) { target->rtos->current_threadid = halted_hart + 1; target->rtos->current_thread = halted_hart + 1; + riscv_set_rtos_hartid(target, halted_hart); } target->state = TARGET_HALTED;