Re: USB logic analyzer problem

From: Milan Obuch <freebsd-usb_at_dino.sk>
Date: Wed, 21 Dec 2022 12:09:50 UTC
On Wed, 21 Dec 2022 12:07:07 +0100 I wrote:

> On Wed, 21 Dec 2022 11:49:33 +0100
> Tomek CEDRO <tomek@cedro.info> wrote:
> 
> > On Wed, Dec 21, 2022 at 11:29 AM Tomek CEDRO wrote:
> > > 1. # vim /etc/devfs.rules:
> > >  [localrules=10]
> > >         add path 'ugen*' mode 0660 group operator
> > >         add path 'usb/*'  mode 0660 group operator
> > >         add path 'usb' mode 0770 group operator
> > >
> > > 2.  # vim /etc/rc.conf:
> > >         devfs_system_ruleset="localrules"
> > >
> > > 3. # pw groupmod operator -m <your_user_name_to_use_usb>
> > >
> > > 4. # service devfs restart
> > >
> > > 5. logout and login your local user to see if access right are
> > > correct now.  
> > 
> > With the above you should have (as my example Saleae logical
> > analyzer):
> > 
> > # ls -al /dev/ugen0.11
> > lrw-rw----  1 root  operator  10 21 gru 11:40 /dev/ugen0.11 ->
> > usb/0.11.0
> > 
> > # usbconfig -d 0.11 dump_all_desc
> > ugen0.11: <sigrok fx2lafw> at usbus0, cfg=0 md=HOST spd=HIGH
> > (480Mbps) pwr=ON (100mA)
> > 
> >   bLength = 0x0012
> >   bDescriptorType = 0x0001
> >   bcdUSB = 0x0200
> >   bDeviceClass = 0x00ff  <Vendor specific>
> >   bDeviceSubClass = 0x00ff
> >   bDeviceProtocol = 0x00ff
> >   bMaxPacketSize0 = 0x0040
> >   idVendor = 0x0925
> >   idProduct = 0x3881
> >   bcdDevice = 0x0001
> >   iManufacturer = 0x0001  <sigrok>
> >   iProduct = 0x0002  <fx2lafw>
> >   iSerialNumber = 0x0003  <Saleae Logic>
> >   bNumConfigurations = 0x0001
> > 
> >  Configuration index 0
> > 
> >     bLength = 0x0009
> >     bDescriptorType = 0x0002
> >     wTotalLength = 0x0019
> >     bNumInterfaces = 0x0001
> >     bConfigurationValue = 0x0001
> >     iConfiguration = 0x0000  <no string>
> >     bmAttributes = 0x0080
> >     bMaxPower = 0x0032
> > 
> >     Interface 0
> >       bLength = 0x0009
> >       bDescriptorType = 0x0004
> >       bInterfaceNumber = 0x0000
> >       bAlternateSetting = 0x0000
> >       bNumEndpoints = 0x0001
> >       bInterfaceClass = 0x00ff  <Vendor specific>
> >       bInterfaceSubClass = 0x00ff
> >       bInterfaceProtocol = 0x00ff
> >       iInterface = 0x0000  <no string>
> > 
> >      Endpoint 0
> >         bLength = 0x0007
> >         bDescriptorType = 0x0005
> >         bEndpointAddress = 0x0082  <IN>
> >         bmAttributes = 0x0002  <BULK>
> >         wMaxPacketSize = 0x0200
> >         bInterval = 0x0000
> >         bRefresh = 0x0000
> >         bSynchAddress = 0x0000
> 
> I have exactly the same output, just one difference - 'wMaxPacketSize
> = 0x0040'. Everything else matches. Maybe you have the same device
> (or a clone, Saleae analyzer looks like being cloned a lot).
>

With permissions corrected (I did it slightly different way originally,
so it did not work correctly) this difference went away. Also PulseView
now works as expected.

I checked the another device i've got, descriptors dumped are

ugen0.6: <sigrok fx2lafw> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps)
pwr=ON (100mA)

  bLength = 0x0012 
  bDescriptorType = 0x0001 
  bcdUSB = 0x0200 
  bDeviceClass = 0x00ff  <Vendor specific>
  bDeviceSubClass = 0x00ff 
  bDeviceProtocol = 0x00ff 
  bMaxPacketSize0 = 0x0040 
  idVendor = 0x08a9 
  idProduct = 0x0014 
  bcdDevice = 0x0001 
  iManufacturer = 0x0001  <sigrok>
  iProduct = 0x0002  <fx2lafw>
  iSerialNumber = 0x0003  <CWAV USBee AX>
  bNumConfigurations = 0x0001 

 Configuration index 0

    bLength = 0x0009 
    bDescriptorType = 0x0002 
    wTotalLength = 0x0019 
    bNumInterfaces = 0x0001 
    bConfigurationValue = 0x0001 
    iConfiguration = 0x0000  <no string>
    bmAttributes = 0x0080 
    bMaxPower = 0x0032 

    Interface 0
      bLength = 0x0009 
      bDescriptorType = 0x0004 
      bInterfaceNumber = 0x0000 
      bAlternateSetting = 0x0000 
      bNumEndpoints = 0x0001 
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x00ff 
      bInterfaceProtocol = 0x00ff 
      iInterface = 0x0000  <no string>

     Endpoint 0
        bLength = 0x0007 
        bDescriptorType = 0x0005 
        bEndpointAddress = 0x0082  <IN>
        bmAttributes = 0x0002  <BULK>
        wMaxPacketSize = 0x0200 
        bInterval = 0x0000 
        bRefresh = 0x0000 
        bSynchAddress = 0x0000 

Almost identical, just different vendor, product, serial. This one has
one additional analog channel (two, actually, hardware wise, just
current firmware does not work with them both).

Thanks for help. Now I need to play a bit with it to know how one works
with it :)

Regards,
Milan