0

When running lattice diamond 3.11 the installation instructions to get the usb programmer to work are ineffective.

libusb couldn't open USB device /dev/bus/usb/003/023: Permission denied.
libusb requires write access to USB device nodes.

The permissions are supposed to be set by a udev rule.

The rule is supposed to be something like:

SUBSYSTEM=="usb",ATTRS{idVendor}=="1134",ATTRS{idProduct}=="8001",MODE="0666",SYMLINK+="lattice-%n"

But it's not actually getting set to 0666. What is wrong with lattice's instructions?

poleguy
  • 171

2 Answers2

1

The problem was likely that ATTRS was used when/where ATTR should be used, because the idVendor and idProduct attribute values used in the rule belongs to the USB device itself.

ATTRS can only be used to match attributes of one of the device's "parents" (i.e. upper-level devices). For a USB device, examples of "parents" would be a respective USB hub or host controller.

Tom Yan
  • 10,996
0

To fix it, I had to track down that the rule was firing.

How can I check if a udev rule fired?

It was, but then the default rule took precedent because lattice suggests putting the rule in /etc/udev/rules.d/10-lattice.rules which is lower priority than /usr/lib/udev/rules.d/50-udev-default.rules.

It can't be 10, it must be > 50 because of 50-udev-default.rules.

So I put it in 51-lattice.rules and now everything is working smoothly. The key command to debug this was something like:

udevadm test /devices/pci0000:00/0000:00:14.0/usb3/3-5/3-5.2

Which told me that this was the last rule applied, not mine!

MODE 0664 /usr/lib/udev/rules.d/50-udev-default.rules:38

It's now working as intended with no warning "Permission denied."

AJM
  • 500
poleguy
  • 171