From 159a47e027dc9a43349affab959f2211e0cff635 Mon Sep 17 00:00:00 2001 From: ALTracer Date: Sun, 5 Nov 2023 06:58:00 +0300 Subject: [PATCH] hosted/jlink: Query and log extended capabilities --- src/platforms/hosted/jlink.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/platforms/hosted/jlink.c b/src/platforms/hosted/jlink.c index 258f5534fd9..98cf3423449 100644 --- a/src/platforms/hosted/jlink.c +++ b/src/platforms/hosted/jlink.c @@ -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]; @@ -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; }