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/+/9610
-- gerrit commit dbb58f1f83d516a00745b5d96ada240c76fecf6b Author: Marc Schink <[email protected]> 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 <[email protected]> diff --git a/doc/openocd.texi b/doc/openocd.texi index 29f585eeba..31c929c694 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2606,17 +2606,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} {cmsis-dap} diff --git a/src/jtag/drivers/ch347.c b/src/jtag/drivers/ch347.c index 31762eb475..0a33dbdf06 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 53a4098f0e..491fe533d1 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. --
