Skip to content

Commit

Permalink
hosted/cmsis_dap: Use the new option to retry HID interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ALTracer committed Sep 29, 2024
1 parent cece044 commit 5bf7d6e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/platforms/hosted/cmsis_dap.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,15 @@ bool dap_init(bool allow_fallback)
/* Windows hosts may not have the winusb driver associated with v2, handle that by degrading to v1 */
if (type == CMSIS_TYPE_BULK) {
if (!dap_init_bulk()) {
DEBUG_WARN("Could not setup a CMSIS-DAP v2 device in Bulk mode (no drivers?), retrying HID mode\n");
type = CMSIS_TYPE_HID;
if (allow_fallback) {
DEBUG_WARN("Could not setup a CMSIS-DAP v2 device in Bulk mode (no drivers?), retrying HID mode\n");
type = CMSIS_TYPE_HID;
} else {
DEBUG_ERROR("Could not setup a CMSIS-DAP device over Bulk interface, failing. Hint: pass %s to retry "
"HID interface\n",
"--allow-fallback");
return false;
}
}
}
if (type == CMSIS_TYPE_HID) {
Expand Down

0 comments on commit 5bf7d6e

Please sign in to comment.