Skip to content

Commit

Permalink
riscv: dont enable interrupt with single stepping, also stop time and…
Browse files Browse the repository at this point in the history
… counter
  • Loading branch information
mean committed Nov 21, 2024
1 parent 3ad0283 commit 10ec2da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/target/riscv_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
#define RV_DCSR_CAUSE_MASK 0x000001c0U
#define RV_DCSR_STEPIE 0x00000800U
#define RV_DCSR_EBREAK_MACHINE 0x00008000U
#define RV_DCSR_STOP_TIME (1U << 9)
#define RV_DCSR_STOP_COUNT (1U << 10)
#define RV_DCSR_EBREAK_MACHINE 0x00008000U

#define RV_GPRS_COUNT 32U

Expand Down Expand Up @@ -1014,9 +1017,9 @@ static void riscv_halt_resume(target_s *target, const bool step)
if (!riscv_csr_read(hart, RV_DCSR | RV_CSR_FORCE_32_BIT, &stepping_config))
return;
if (step)
stepping_config |= RV_DCSR_STEP | RV_DCSR_STEPIE;
stepping_config |= RV_DCSR_STEP | RV_DCSR_STOP_TIME | RV_DCSR_STOP_COUNT;
else {
stepping_config &= ~(RV_DCSR_STEP | RV_DCSR_STEPIE);
stepping_config &= ~(RV_DCSR_STEP);
stepping_config |= RV_DCSR_EBREAK_MACHINE;
}
if (!riscv_csr_write(hart, RV_DCSR | RV_CSR_FORCE_32_BIT, &stepping_config))
Expand Down

0 comments on commit 10ec2da

Please sign in to comment.