Accept dmstatus.version==3 (0.14) (#489)

Fixes #485.

Change-Id: I60b3d68827ca726558bc28035c0b74c5cf0d9754
This commit is contained in:
Tim Newsome 2020-06-25 15:34:48 -07:00 committed by GitHub
parent 4579dd9358
commit 0b1b9e2034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -686,8 +686,9 @@ int dmstatus_read_timeout(struct target *target, uint32_t *dmstatus,
DMI_DMSTATUS, 0, timeout_sec, false, true); DMI_DMSTATUS, 0, timeout_sec, false, true);
if (result != ERROR_OK) if (result != ERROR_OK)
return result; return result;
if (get_field(*dmstatus, DMI_DMSTATUS_VERSION) != 2) { int dmstatus_version = get_field(*dmstatus, DMI_DMSTATUS_VERSION);
LOG_ERROR("OpenOCD only supports Debug Module version 2 (0.13), not " if (dmstatus_version != 2 && dmstatus_version != 3) {
LOG_ERROR("OpenOCD only supports Debug Module version 2 (0.13) and 3 (0.14), not "
"%d (dmstatus=0x%x). This error might be caused by a JTAG " "%d (dmstatus=0x%x). This error might be caused by a JTAG "
"signal issue. Try reducing the JTAG clock speed.", "signal issue. Try reducing the JTAG clock speed.",
get_field(*dmstatus, DMI_DMSTATUS_VERSION), *dmstatus); get_field(*dmstatus, DMI_DMSTATUS_VERSION), *dmstatus);
@ -1613,7 +1614,8 @@ static int examine(struct target *target)
if (dmstatus_read(target, &dmstatus, false) != ERROR_OK) if (dmstatus_read(target, &dmstatus, false) != ERROR_OK)
return ERROR_FAIL; return ERROR_FAIL;
LOG_DEBUG("dmstatus: 0x%08x", dmstatus); LOG_DEBUG("dmstatus: 0x%08x", dmstatus);
if (get_field(dmstatus, DMI_DMSTATUS_VERSION) != 2) { int dmstatus_version = get_field(dmstatus, DMI_DMSTATUS_VERSION);
if (dmstatus_version != 2 && dmstatus_version != 3) {
/* Error was already printed out in dmstatus_read(). */ /* Error was already printed out in dmstatus_read(). */
return ERROR_FAIL; return ERROR_FAIL;
} }