This is an automated email from Gerrit.

"zapb <[email protected]>" just uploaded a new patch set to Gerrit, which you can 
find at https://review.openocd.org/c/openocd/+/9161

-- gerrit

commit eae61beebbb41e65bc7479adb61b5b92bdfcd2a1
Author: Marc Schink <[email protected]>
Date:   Wed Oct 8 07:40:44 2025 +0200

    adapters/cmsis-dap: Fix build without libusb
    
    The cmsis-dap core driver depends on libusb-related code which breaks
    the build when libusb is not available.
    
    Remove libusb dependency of the core driver to fix the build issue. For
    now, use an own timeout #define with the value of LIBUSB_TIMEOUT_MS but
    timeout handling should be better moved to the backends. However, this
    should be addressed in a dedicated patch.
    
    Change-Id: Ic5da392f8ab26b47466be199432432cdc08712ab
    Signed-off-by: Marc Schink <[email protected]>

diff --git a/src/jtag/drivers/cmsis_dap.c b/src/jtag/drivers/cmsis_dap.c
index e5e82d13d9..9f60a5ede4 100644
--- a/src/jtag/drivers/cmsis_dap.c
+++ b/src/jtag/drivers/cmsis_dap.c
@@ -37,7 +37,8 @@
 #include <target/cortex_m.h>
 
 #include "cmsis_dap.h"
-#include "libusb_helper.h"
+
+#define TIMEOUT_MS     6000
 
 /* Create a dummy backend for 'backend' command if real one does not build */
 #if BUILD_CMSIS_DAP_USB == 0
@@ -363,12 +364,12 @@ static int cmsis_dap_xfer(struct cmsis_dap *dap, int 
txlen)
        }
 
        uint8_t current_cmd = dap->command[0];
-       int retval = dap->backend->write(dap, txlen, LIBUSB_TIMEOUT_MS);
+       int retval = dap->backend->write(dap, txlen, TIMEOUT_MS);
        if (retval < 0)
                return retval;
 
        /* get reply */
-       retval = dap->backend->read(dap, LIBUSB_TIMEOUT_MS, CMSIS_DAP_BLOCKING);
+       retval = dap->backend->read(dap, TIMEOUT_MS, CMSIS_DAP_BLOCKING);
        if (retval < 0)
                return retval;
 
@@ -872,7 +873,7 @@ static void cmsis_dap_swd_write_from_queue(struct cmsis_dap 
*dap)
                }
        }
 
-       int retval = dap->backend->write(dap, idx, LIBUSB_TIMEOUT_MS);
+       int retval = dap->backend->write(dap, idx, TIMEOUT_MS);
        if (retval < 0) {
                queued_retval = retval;
                goto skip;
@@ -913,7 +914,7 @@ static void cmsis_dap_swd_read_process(struct cmsis_dap 
*dap, enum cmsis_dap_blo
        }
 
        /* get reply */
-       retval = dap->backend->read(dap, LIBUSB_TIMEOUT_MS, blocking);
+       retval = dap->backend->read(dap, TIMEOUT_MS, blocking);
        bool timeout = (retval == ERROR_TIMEOUT_REACHED || retval == 0);
        if (timeout && blocking == CMSIS_DAP_NON_BLOCKING)
                return;

-- 

Reply via email to