|
From: openocd-gerrit <ope...@us...> - 2026-05-17 20:56:27
|
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 3a7635f4472fd293d22c4d6973161270a7679090 (commit)
from e4941a039789227666d5fa2799613db0ca1c7d74 (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 3a7635f4472fd293d22c4d6973161270a7679090
Author: Marc Schink <de...@za...>
Date: Mon Apr 27 08:23:00 2026 +0200
adapter/ch347: Use adapter core USB product name handling
Use the USB product name handling provided by the adapter core instead
of having it in the driver code itself.
Change-Id: I5ba8ed11adbfe9b9e2d54b5d77a9255046809401
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9610
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/doc/openocd.texi b/doc/openocd.texi
index 361a024f3..aa2c256eb 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -2609,17 +2609,6 @@ mitigates the problem.
The driver supports activity LED through the generic
command @ref{adapter gpio, @command{adapter gpio led}}.
-
-This driver has these driver-specific command:
-
-@deffn {Config Command} {ch347 device_desc} description
-If specified connect to a device which exactly has this product description
-string. If not specified the first found device with the correct vendor
-and product ID will be connected.
-@example
-ch347 device_desc "EasyDevKit"
-@end example
-@end deffn
@end deffn
@deffn {Interface Driver} {cklink}
diff --git a/src/jtag/drivers/ch347.c b/src/jtag/drivers/ch347.c
index 31762eb47..0a33dbdf0 100644
--- a/src/jtag/drivers/ch347.c
+++ b/src/jtag/drivers/ch347.c
@@ -255,7 +255,6 @@ static bool swd_mode;
static uint16_t default_ch347_vids[] = {DEFAULT_VENDOR_ID, DEFAULT_VENDOR_ID, DEFAULT_VENDOR_ID, 0};
static uint16_t default_ch347_pids[] = {DEFAULT_CH347T_PRODUCT_ID,
DEFAULT_CH347F_PRODUCT_ID, DEFAULT_OTHER_PRODUCT_ID, 0};
-static char *ch347_device_desc;
static uint8_t ch347_activity_led_gpio_pin = 0xFF;
static bool ch347_activity_led_active_high;
static struct ch347_info ch347;
@@ -1426,7 +1425,8 @@ static int ch347_open_device(void)
ch347_pids = adapter_usb_get_pids();
}
- int retval = jtag_libusb_open(ch347_vids, ch347_pids, ch347_device_desc, &ch347_handle, NULL);
+ int retval = jtag_libusb_open(ch347_vids, ch347_pids,
+ adapter_usb_get_product_name(), &ch347_handle, NULL);
if (retval != ERROR_OK) {
char error_message[256];
snprintf(error_message, sizeof(error_message), "CH347 not found. Tried VID/PID pairs: ");
@@ -1776,38 +1776,11 @@ static int ch347_speed_get_index(int khz, int *speed_idx)
return ERROR_OK;
}
-/**
- * @brief The command handler for setting the device description that should be found
- *
- * @return ERROR_OK at success; ERROR_COMMAND_SYNTAX_ERROR otherwise
- */
-COMMAND_HANDLER(ch347_handle_device_desc_command)
-{
- if (CMD_ARGC != 1)
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- free(ch347_device_desc);
- ch347_device_desc = strdup(CMD_ARGV[0]);
- return ERROR_OK;
-}
-
-static const struct command_registration ch347_subcommand_handlers[] = {
- {
- .name = "device_desc",
- .handler = &ch347_handle_device_desc_command,
- .mode = COMMAND_CONFIG,
- .help = "set the USB device description of the CH347 device",
- .usage = "description_string",
- },
- COMMAND_REGISTRATION_DONE
-};
-
static const struct command_registration ch347_command_handlers[] = {
{
.name = "ch347",
.mode = COMMAND_ANY,
.help = "perform ch347 management",
- .chain = ch347_subcommand_handlers,
.usage = "",
},
COMMAND_REGISTRATION_DONE
diff --git a/tcl/board/easydevkits/esp32-wrover-e-wch-jtag-devkit.cfg b/tcl/board/easydevkits/esp32-wrover-e-wch-jtag-devkit.cfg
index 53a4098f0..491fe533d 100644
--- a/tcl/board/easydevkits/esp32-wrover-e-wch-jtag-devkit.cfg
+++ b/tcl/board/easydevkits/esp32-wrover-e-wch-jtag-devkit.cfg
@@ -12,7 +12,7 @@ adapter driver ch347
# Identify the device
adapter usb vid_pid 0x1a86 0x55dd
-ch347 device_desc "EasyDevKit"
+adapter usb product_name "EasyDevKit"
# Configure activity LED
# Note: The LED is active-low on GPIO4.
-----------------------------------------------------------------------
Summary of changes:
doc/openocd.texi | 11 --------
src/jtag/drivers/ch347.c | 31 ++--------------------
.../easydevkits/esp32-wrover-e-wch-jtag-devkit.cfg | 2 +-
3 files changed, 3 insertions(+), 41 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|