From: openocd-gerrit <ope...@us...> - 2024-09-15 09:06:37
|
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 0efedd7bd7e1531a47028d9b32e9406502a59ca7 (commit) from f0bad430df8e9fe0ff5323756a19ad2baa52e9f6 (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 0efedd7bd7e1531a47028d9b32e9406502a59ca7 Author: Marcus Nilsson <bra...@gm...> Date: Wed Aug 7 11:24:04 2024 +0200 drivers/jlink: Print serial numbers when multiple devices are connected When multiple jlink programmers are connected and no specific serial or USB location is specified, print out the detected serial numbers. Signed-off-by: Marcus Nilsson <bra...@gm...> Change-Id: I280da2b85363f7054c5f466637120427cadcf7d1 Reviewed-on: https://review.openocd.org/c/openocd/+/8356 Reviewed-by: Mark Zhuang <mar...@sp...> Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c index a94f3a4ab..1b2fb4e30 100644 --- a/src/jtag/drivers/jlink.c +++ b/src/jtag/drivers/jlink.c @@ -564,6 +564,20 @@ static int jlink_open_device(uint32_t ifaces, bool *found_device) if (!use_serial_number && !use_usb_address && !use_usb_location && num_devices > 1) { LOG_ERROR("Multiple devices found, specify the desired device"); + LOG_INFO("Found devices:"); + for (size_t i = 0; devs[i]; i++) { + uint32_t serial; + ret = jaylink_device_get_serial_number(devs[i], &serial); + if (ret == JAYLINK_ERR_NOT_AVAILABLE) { + continue; + } else if (ret != JAYLINK_OK) { + LOG_WARNING("jaylink_device_get_serial_number() failed: %s", + jaylink_strerror(ret)); + continue; + } + LOG_INFO("Device %zu serial: %" PRIu32, i, serial); + } + jaylink_free_devices(devs, true); jaylink_exit(jayctx); return ERROR_JTAG_INIT_FAILED; ----------------------------------------------------------------------- Summary of changes: src/jtag/drivers/jlink.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) hooks/post-receive -- Main OpenOCD repository |