diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index ac48abd793..52514c05d2 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -1199,7 +1199,7 @@ static int riscv_add_breakpoint(struct target *target, struct breakpoint *breakp assert(breakpoint); if (breakpoint->type == BKPT_SOFT) { /** @todo check RVC for size/alignment */ - if (!(breakpoint->length == 4 || breakpoint->length == 2)) { + if (!(breakpoint->length == 4 || (breakpoint->length == 2 && riscv_supports_extension(target, 'C')))) { LOG_TARGET_ERROR(target, "Invalid breakpoint length %d", breakpoint->length); return ERROR_FAIL; }