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

Commit 3b50115

Browse files
author
mean
committed
riscv: dont enable interrupt with single stepping, also stop time and counter
1 parent 3ad0283 commit 3b50115

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/target/riscv_debug.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132
#define RV_DCSR_CAUSE_MASK 0x000001c0U
133133
#define RV_DCSR_STEPIE 0x00000800U
134134
#define RV_DCSR_EBREAK_MACHINE 0x00008000U
135+
#define RV_DCSR_STOP_TIME (1U << 9)
136+
#define RV_DCSR_STOP_COUNT (1U << 10)
135137

136138
#define RV_GPRS_COUNT 32U
137139

@@ -1014,9 +1016,9 @@ static void riscv_halt_resume(target_s *target, const bool step)
10141016
if (!riscv_csr_read(hart, RV_DCSR | RV_CSR_FORCE_32_BIT, &stepping_config))
10151017
return;
10161018
if (step)
1017-
stepping_config |= RV_DCSR_STEP | RV_DCSR_STEPIE;
1019+
stepping_config |= RV_DCSR_STEP | RV_DCSR_STOP_TIME | RV_DCSR_STOP_COUNT;
10181020
else {
1019-
stepping_config &= ~(RV_DCSR_STEP | RV_DCSR_STEPIE);
1021+
stepping_config &= ~(RV_DCSR_STEP);
10201022
stepping_config |= RV_DCSR_EBREAK_MACHINE;
10211023
}
10221024
if (!riscv_csr_write(hart, RV_DCSR | RV_CSR_FORCE_32_BIT, &stepping_config))

0 commit comments

Comments
 (0)