Electronics > FPGA

Lattice Diamond v 3.11 on Linux: problem with ftdio_sio

(1/4) > >>

gregoireg:
On Linux, since v3.11, it seems that Lattice Diamond can only detect a FTDI cable if the kernel driver ftdio_sio has been removed.

On v3.10 and before, it was possible to just unbind the ftdi tty (ttyUSB*) with a udev rule (many blogs which explain how to install Diamond on Ubuntu mention such procedure - https://ycnrg.org/lattice-diamond-on-ubuntu-16-04/) and not to have to remove the ftdio_sio driver.

Does anyone know a way to still run the Lattice programmer without having to remove the ftdio_sio driver since v3.11?

SiliconWizard:
I don't use Diamond on Linux, but I do use devices with FTDI chips and I know you need to unbind them from ftdi_sio to be able to access them with libusb, which the Linux FTDI drivers are based on.

The udev rule given in your link looks like the ones I use as well, so that should do?
Are you sure the problem is new with Diamond 3.11, and not that it comes from a recent change in the Linux kernel or something? If you are, maybe they changed something in the way they access FTDI parts in version 3.11, so that previous versions didn't actually show you that the udev rule you used was actually not working quite right.

I think I remember having to slightly modify those udev rules after some kernel update (can't remember which...). The following:
--- Code: ---basename $(dirname $(realpath /sys%p/device))
--- End code ---
may not be correct anymore, something to check.

To check (maybe you already did): plug your device in, then check that the corresponding ttyUSB* devices are not there. If they are, well, the udev rule doesn't work anymore, and it's not a problem with Diamond. AFAIK, in somes cases, the devices may be names like ttyACM* instead of ttyUSB*? So check that as well. Also check the output of 'dmesg'.

Try issuing the unbind (... >  /sys/bus/usb/drivers/ftdi_sio/unbind) manually with the correct device on the left.

gregoireg:
Yes, I'm sure that v3.11 is the culprit. On the same system, I have both v3.10 and v3.11 installed. It works with v3.10. I do see that ttyUSB0 is removed, the udev rule works correctly. Yes, sometimes, udev rules are a pain but here it's working fine.

It seems that v3.11 wants "full access" to the FTDI chip and is not happy that another driver such as ftdi_sio is loaded. It would be great to have an official comment from Lattice about that.

SiliconWizard:
This is odd. The unbinding should be enough to "release" the FTDI device and make it available to libusb.

Maybe Lattice added some stupid check about ftdi_sio being loaded even though the FTDI device is not held by it. This would be mind-bogglingly stupid, all the more that you may have other FTDI-based devices plugged at the same time, that you want to be used with ftdi_sio...

Maybe this is not Lattice's fault but FTDI's: maybe it comes from the Linux FTDI drivers that came updated in Diamond 3.11 (they are purely userland drivers since they use libusb, so they are probably part of Lattice Diamond's install...)

If you don't intend on using any other FTDI-based device than the programming cable at the same time, you could probably just add a 'rmmod ftdi_sio' after the unbind in the udev rule and call it a day...?
(Not ideal but it could work for you...)

gregoireg:
That's exactly my problem. I'm using the ftdi driver for another application at the same time I'm flashing the Lattice chip. It's why I need a solution (doing rmmod / modprobe before/after flashing is painful and it seems to do bad things in my other application).

At least, if someone could confirm what I'm seeing that would be a first step. v3.11 has been released in June, so it's quite recent.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod