This is an automated email from Gerrit.

"Marcus Nilsson (1002225)" just uploaded a new patch set to Gerrit, which you 
can find at https://review.openocd.org/c/openocd/+/8356

-- gerrit

commit f8c75d4093323108b10f19522911a5ffa744fad0
Author: Marcus Nilsson <brainb...@gmail.com>
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 found serial numbers.
    
    Signed-off-by: Marcus Nilsson <brainb...@gmail.com>
    Change-Id: I280da2b85363f7054c5f466637120427cadcf7d1

diff --git a/src/jtag/drivers/jlink.c b/src/jtag/drivers/jlink.c
index a94f3a4aba..614ee8ed56 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 %lu serial: %u", i, serial);
+       }
+
                jaylink_free_devices(devs, true);
                jaylink_exit(jayctx);
                return ERROR_JTAG_INIT_FAILED;

-- 

Reply via email to