This issue is rather related to libjaylink library but I was unable to find any public libjaylink bug tracker so I'm posting the issue here.
libjaylink is unable to find the probe by it's serial number when all network interfaces are down/disconnected. This makes it impossible to use OpenOCD on offline machines with several JLink probes connected.
Steps to reproduce:
Put you computer offline (disconnect all Ethernet cables and turn WiFi off)
Run the following script:
source [find interface/jlink.cfg]
jlink serial <your_serial_here>
source [find target/psoc6.cfg]
init
exit
Observe the following error:
Error: Failed to send discovery message.
Error: TCP/IP device discovery failed.
Error: jaylink_discovery_scan() failed: input/output error.
I've tracked the issue down to discovery_tcp_scan function which fails on offline machines (which is OK) but this error is treated as fatal in jaylink_discovery_scan so whole device discovery fails.
Bohdan
On Thu, Jan 21, 2021 at 9:36 PM Marc Schink dev@zapb.de wrote:
Marc,
it's a little tricky to say who is responsible for the issue, if the
caller (openocd) or the lib (libjaylink).
The call in openocd
ret = jaylink_discovery_scan(jayctx, JAYLINK_HIF_USB | JAYLINK_HIF_TCP);
for me means "look for a jlink everywhere, either on usb OR on tcp".
But looking at the implementation, it returns error if there is an
error opening libusb (respectively network), even if there is the
jlink on the network (respectively libusb).
Actually it depends on the API implementation, but without
documentation it's hard to guess.
If you think this is the expected behavior on the libjaylink side, we
can change the caller, by calling jaylink_discovery_scan() twice, once
for usb and once for network.
Would it make more sense for you?
Antonio
Related
Tickets:
#294Can you please check if this patch for OpenOCD fixes the issue
http://openocd.zylin.com/6024
Antonio
This ticket can be closed, issue fixed by http://openocd.zylin.com/#/c/6025/