Skip to content

Commit

Permalink
hosted/jlink: Query and log extended capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
ALTracer committed Nov 5, 2023
1 parent a9697dd commit 159a47e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/platforms/hosted/jlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,24 @@ static bool jlink_get_version(void)
return true;
}

static bool jlink_get_extended_capabilities(void)
{
uint8_t buffer[32U];

if (!jlink_simple_query(JLINK_CMD_INFO_GET_PROBE_EXTENDED_CAPABILITIES, buffer, sizeof(buffer)))
return false;

uint32_t ext_caps[4];
ext_caps[0] = read_le4(buffer, 0);
ext_caps[1] = read_le4(buffer, 4);
ext_caps[2] = read_le4(buffer, 8);
ext_caps[3] = read_le4(buffer, 12);
DEBUG_INFO("Extended capabilities: 0x%08" PRIx32, ext_caps[0]);
DEBUG_INFO(" 0x%08" PRIx32 " 0x%08" PRIx32 " 0x%08" PRIx32 "\n", ext_caps[1], ext_caps[2], ext_caps[3]);

return true;
}

static bool jlink_get_capabilities(void)
{
uint8_t buffer[4U];
Expand All @@ -326,6 +344,9 @@ static bool jlink_get_capabilities(void)
jlink.capabilities = read_le4(buffer, 0);
DEBUG_INFO("Capabilities: 0x%08" PRIx32 "\n", jlink.capabilities);

if (jlink.capabilities & JLINK_CAPABILITY_EXTENDED_CAPABILITIES)
jlink_get_extended_capabilities();

return true;
}

Expand Down

0 comments on commit 159a47e

Please sign in to comment.