cmsis_dap: Detect CMSIS-DAP before STLINK

Debugger may be realized with the ST USB Vendor ID.
This commit is contained in:
Uwe Bonnes 2020-08-16 13:02:25 +02:00 committed by UweBonnes
parent 998a9747f8
commit e75eb19d78
2 changed files with 3 additions and 2 deletions

View File

@ -51,6 +51,7 @@ static int report_size = 512 + 1; // TODO: read actual report size
/* LPC845 Breakout Board Rev. 0 report invalid response with > 65 bytes */
int dap_init(bmp_info_t *info)
{
printf("dap_init\n");
if (hid_init())
return -1;
int size = strlen(info->serial);

View File

@ -162,6 +162,8 @@ static int find_debuggers( BMP_CL_OPTIONS_t *cl_opts,bmp_info_t *info)
if ((desc.idVendor == VENDOR_ID_BMP) &&
(desc.idProduct == PRODUCT_ID_BMP)) {
type = BMP_TYPE_BMP;
} else if ((strstr(manufacturer, "CMSIS")) || (strstr(product, "CMSIS"))) {
type = BMP_TYPE_CMSIS_DAP;
} else if (desc.idVendor == VENDOR_ID_STLINK) {
if ((desc.idProduct == PRODUCT_ID_STLINKV2) ||
(desc.idProduct == PRODUCT_ID_STLINKV21) ||
@ -174,8 +176,6 @@ static int find_debuggers( BMP_CL_OPTIONS_t *cl_opts,bmp_info_t *info)
DEBUG_WARN( "INFO: STLINKV1 not supported\n");
continue;
}
} else if ((strstr(manufacturer, "CMSIS")) || (strstr(product, "CMSIS"))) {
type = BMP_TYPE_CMSIS_DAP;
} else if (desc.idVendor == VENDOR_ID_SEGGER) {
type = BMP_TYPE_JLINK;
} else{