Skip to content

Commit c3f1566

Browse files
authored
Merge pull request riscv-collab#1238 from en-sc/en-sc/abits-zero
src/target/riscv: error out of the `examine()` in case `abits` is zero
2 parents 6708282 + 4523111 commit c3f1566

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/target/riscv/riscv-013.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,11 @@ static int examine(struct target *target)
19561956
return ERROR_FAIL;
19571957
}
19581958

1959+
if (info->abits == 0) {
1960+
LOG_TARGET_ERROR(target,
1961+
"dtmcs.abits is zero. Check JTAG connectivity/board power");
1962+
return ERROR_FAIL;
1963+
}
19591964
if (info->abits < RISCV013_DTMCS_ABITS_MIN) {
19601965
/* The requirement for minimum DMI address width of 7 bits is part of
19611966
* the RISC-V Debug spec since Jan-20-2017 (commit 03df6ee7). However,

0 commit comments

Comments
 (0)