Re: USB logic analyzer problem

From: Milan Obuch <freebsd-usb_at_dino.sk>
Date: Wed, 21 Dec 2022 11:01:41 UTC
On Wed, 21 Dec 2022 11:29:02 +0100
Tomek CEDRO <tomek@cedro.info> wrote:

> On Wed, Dec 21, 2022 at 8:44 AM Milan Obuch wrote:
> > recently I've got two simple USB logic analyzers (one with analog
> > channel as well), and I am trying to get them working under FreeBSD.
> > They are
> >
> > ugen0.x: <vendor 0x08a9 product 0x0014> at usbus0
> > ugen0.y: <vendor 0x0925 product 0x3881> at usbus0
> >
> > as seen on plugging in USB port (x, y varies on attempts). These
> > should be handled by sigrok and pulseview (science/sigrok* and
> > science/pulseview ports). While building and installing ports was
> > relatively easy, I did not managed them to work correctly.  
> 
> 1. Do you perform firmware update before using the device? If so
> device may reboot and change descriptors / reenumerate after firmware
> update, please verify the parameters before and after the update.

Well, I don't do anything specifically, but I am sure pulseview (using
some of sigrok* modules) does. I just don't know details :)

> 2. # usbconfig list; note your device ugenX.Y; # usbconfig -d X.Y
> dump_all_desc; see device configurations interfaces and serial number.
> Maybe you will be able to provide serial number to the software as the
> analyzer id?

Later...

> > At first, I thought problem is access rights, as all devices are
> > created with mode crw-------, uid root. I did not succeed to change
> > this, trying devd and/or devfs, even manually chmod. As a simple
> > test, I started pulseview as root, still, no success - I can see my
> > devices listed and selectable for data acquisition, but trying to
> > get data yields  
> 
> 
> 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.

I think I did it already, I am just going to repeat and verify. This
takes some time (logout on my main workstation is no go at the moment,
as closing everything is required before... but I have another box for
test, just some time is required to end all running there), not too
long, hopefully.

Regards,
Milan