From: openocd-gerrit <ope...@us...> - 2025-10-13 07:57:03
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3fd975941537346c7a3c37aecc944b30305a8e1e (commit) from 1f5da25ed19f41499efdd482e522e016d0eb406c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3fd975941537346c7a3c37aecc944b30305a8e1e Author: Marc Schink <de...@za...> 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 <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/9161 Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: <nik...@gm...> Tested-by: jenkins diff --git a/src/jtag/drivers/cmsis_dap.c b/src/jtag/drivers/cmsis_dap.c index e5e82d13d..9f60a5ede 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; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/cmsis_dap.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |