Skip to content

Commit 962c33d

Browse files
committed
hosted/cmsis_dap: Special-case and deal with the MCU-Link firmware version string issues.
1 parent 86704be commit 962c33d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/platforms/hosted/cmsis_dap.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,19 @@ dap_version_s dap_adaptor_version(const dap_info_e version_kind)
393393
/* If that failed, return just the major */
394394
if (!end)
395395
return version;
396+
397+
/* Special-case the MCU-Link firmware to correct some version numbering mistakes they've made */
398+
if (strncmp(bmda_probe_info.product, "MCU-Link", 8U) == 0) {
399+
/* If this is a v1.10+ MCU-Link */
400+
if (minor > 9U) {
401+
/* Then unpack the version number - CMSIS-DAP v1.1.0 is (wrongly) encoded as v1.10 on these adaptors */
402+
version.minor = minor / 10U;
403+
version.revision = minor % 10U;
404+
/* Now return early as we're now done */
405+
return version;
406+
}
407+
}
408+
396409
version.minor = minor;
397410
/* Check if it's worth trying to convert anything more */
398411
if ((size_t)(end - version_str) >= version_length || end[0] != '.')

0 commit comments

Comments
 (0)