Tuesday, September 26, 2017

Re: libusb device name other than ugen

mcmer-openbsd@tor.at (Marcus MERIGHI), 2017.09.25 (Mon) 15:32 (CEST):
> robert.dazi@yahoo.fr (Robert Dazi), 2017.09.24 (Sun) 22:28 (CEST):
> > Hi,I have a software (openocd) that needs to serially communicate
> > with a board, but it can't because libusb throws
> > LIBUSB_ERROR_NOT_SUPPORTED.
> > To access a usb device using libusb, libusb provides a function
> > returning a list of devices. But this function fills a field of the
> > device structure only if the device pathname starts with "ugen",
> > otherwise the field is set to NULL.But a NULL field leads to the
> > _sync_gen_transfer to return "LIBUSB_ERROR_NOT_SUPPORTED".
> > But my device is bound to cuaU1, and not to any ugen.
> > This assumption of a "ugen" name is also in _access_endpoint.
> >
> > Do I need to patch libusb, or is it simply a mistake of mine
>
> You might try to tell the kernel *not* to attach the device to ucom(4).
>
> For a quick test whether that helps, do
> a) reboot.
> b) at the boot prompt type "-c", enter.
> c) you will find yourself at a ukc> prompt.
> d) type "disable ucom", enter.

this should be "disable uftdi" with my device. see below...

> e) type "quit", enter.
> f) boot will continue.
> g) when plugging your ucom(4) device you should see your device *not*
> attaching as ucom(4).
> h) use the device as ugen(4).
>
> For a permanent solution, run config -o /bsd.new -e /bsd, do the
> changes as above, then move /bsd /bsd.ori and /bsd.new to /bsd.

mihscu@gmail.com (Mihai Popescu), 2017.09.25 (Mon) 21:51 (CEST):
> > You might try to tell the kernel *not* to attach the device to ucom(4).
> It will attach like uftdi or other * found in ucom man page.
> Dmesg is really needed!

Mihai, you are correct.
See below what happens with my uftdi(4) based device.

1) normal, without disabling:
uftdi0 at uhub3 port 2 configuration 1 interface 0 "FTDI USB Serial
Converter" rev 2.00/6.00 addr 3
ucom0 at uftdi0 portno 1

2) with ucom disabled:
uftdi0 at uhub3 port 2 configuration 1 interface 0 "FTDI USB Serial
Converter" rev 2.00/6.00 addr 3
ucom at uftdi0 portno 1 not configured

3) with uftdi disabled:
ugen0 at uhub3 port 2 "FTDI USB Serial Converter" rev 2.00/6.00 addr 3

Robert, what you want is 3) ?

Marcus

No comments:

Post a Comment