On Thu, Jan 21, 2021 at 9:36 PM Marc Schink <[email protected]> wrote:
>
> Hi Bohdan,
>
> thank you for your report. I'm aware of this issue but I don't consider
> this as bug in libjaylink. We ask libjaylink to discover TCP devices
> but there are no ethernet devices available.
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
>
> Maybe I will introduce a special check for "network not available" but
> I'm not sure if and when. We could introduction a switch to disable TCP
> discovery in openocd but this would be a bit ugly IMO. For the moment,
> I would suggest to use a dummy ethernet device as workaround:
>
> $ ip link add eth23 type dummy
> $ ip address change dev eth23 10.0.0.1
> $ ip link set eth23 up
> $ route add default gw 10.0.0.1 dev eth23
>
> I hope this solves your problem for the moment. Anyway, I'm open for
> input if you have a proper solution for this issue.
>
> Best regards,
> Marc
>
> On Mon, 2021-01-18 at 12:26 +0000, Bohdan Tymkiv via OpenOCD-devel
> wrote:
> > [tickets:#294] libjaylink fails to discover devices when network is
> > down and J-Link S/N is specified
> >
> > Status: new
> > Milestone: 0.10.0
> > Created: Mon Jan 18, 2021 12:26 PM UTC by Bohdan Tymkiv
> > Last Updated: Mon Jan 18, 2021 12:26 PM UTC
> > Owner: nobody
> >
> > 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
> >
> > Sent from sourceforge.net because [email protected]
> > is subscribed to https://sourceforge.net/p/openocd/tickets/
> >
> > To unsubscribe from further messages, a project admin can change
> > settings at https://sourceforge.net/p/openocd/admin/tickets/options.
> > Or, if this is a mailing list, you can unsubscribe from the mailing
> > list.
> >
> > _______________________________________________
> > OpenOCD-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/openocd-devel
>
>
>
> _______________________________________________
> OpenOCD-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/openocd-devel
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel