openFPGALoader: unable to open ftdi device: -4 (usb_open() failed)
Problem:
$ openFPGALoader -b arty_a7_35t /home/foo/git/external/f4pga-examples/xc7/counter_test/build/arty_35/top.bit
unable to open ftdi device: -4 (usb_open() failed)
JTAG init failed with: unable to open ftdi device
More info:
$ uname -a
Linux baz 5.10.0-16-amd64 #1 SMP Debian 5.10.127-2 (2022-07-23) x86_64 GNU/Linux
$ openFPGALoader -V
openFPGALoader v0.8.0
$ lsusb
Bus 004 Device 007: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC
...
$ sudo dmesg |grep -i usb
...
usb 4-6: Detected FT2232H
usb 4-6: FTDI USB Serial Device converter now attached to ttyUSB1
$ ls -l /dev/ttyUSB1
crw-rw---- 1 root dialout 188, 1 Aug 12 13:38 /dev/ttyUSB1
$ getent group dialout
dialout:x:20:foo
$ picocom -b 115200 --imap lfcrlf /dev/ttyUSB1
...
** Avnet/Digilent Arty Evaluation Board **
** LEDs and switches GPIO Demonstration **
********************************************************
********************************************************
**
Choose Task:
BTN0: Print PWM value.
BTN1: 'Cylon' LED display.
...
$ openFPGALoader -b arty_a7_35t --detect
unable to open ftdi device: -4 (usb_open() failed)
JTAG init failed with: unable to open ftdi device
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 2
- Comments: 15 (7 by maintainers)
I fixed it. I had to add the following udev rule:
File:
/etc/udev/rules.d/99-ftdi.rulesFor others who arrive here with different boards, change the vendor and product to match the hex values produced by lsusb. For example here is mine:
Bus 002 Device 004: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC@infinitesteps - slight modification (does not grant access to ‘others’). Oddly, the apparent permissions were exactly the same for me before and after adding this udev rule but it does indeed work 😃
Managed to workaround this, as mentioned here: https://esp32.com/viewtopic.php?t=15469
Using this tool: https://zadig.akeo.ie/
Replacing driver for Sipeed-JTAG from FTDIBUS to WinUSB seems to solve the issue. openFTDILoader starts to correctly detect device and flush it.
Not sure, what this tool really does, cause of lack of knowledge about USB stack.
Couple of notes…
ftdi_usb_open()is called but I don’t think it uses the error message provided by libftdi - that might be helpful.Thanks! A udev rule is provided with openFPGALoader (https://trabucayre.github.io/openFPGALoader/guide/install.html#udev-rules) but maybe this note is not correctly highlity and maybe with the binary version this file is not available.