New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eeprom.dump_config() cannot dump EEPROM configuration when two devices are attached #335
Comments
Hi, Windows USB stack is a gigantic pile of crap, and I'm always amazed that some great devs managed to plug libusb on top of this... I would definitely -not- recommend to use pyftdi eeprom management on Windows. You really want to use the native FT_PROG application from FTDI chip manufacturer to mess with the EEPROM content. It is definitely more reliable, and far more fitted to this sh.tty OS. About URLs (
Unfortunately, Windows does not expose any bus/address concept, and if you do not have a serial number or a corrupted EEPROM, you are out of luck. In this case the only remaining solution is to keep a single device plug to your computer so you can be sure which device is addressed. I would definitely not trust any USB device selection through libusb on Windows, as you might end up accessing the wrong device otherwise... Again, on Windows, I'd really recommend to use FT_PROG. Do not use PyFTDI to update your EEPROM, you might really corrupt it. Do not use it with FT232R or FT230X device that use internal EEPROMs, as you might brick your FTDI chip. |
Hi thanks for your answer,
And in windows (with WSL installed) running
Is there a way to retrieve the BTW is there a way to generate signals on the GPIOs with a period in the range between 10us and 200us using the pyftdi library?
However the period is way higher (in the ms range) than what I was expecting. |
In Linux, it should match the current bus/device values. The only reliable way to select a specific device if multiple similar ones are connected to a host is to identify them with their serial number.
I have really no idea on Windows, but I would be surprised that Windows is able to enumerate the same device in the same way each time, at it has never been able to do so since USB has been implemented several decades ago.
No, as it depends on when and where you plug your USB devices, and how the USB stack enumerates them.
Remember that your FTDI device is connected over a USB bus, which is typically using 1 ms cycle. I.e. it is likely that two FTDI packets are sent in two distinct USB frame, that is at best 1ms appart from each other. Worse scenario is that the USB SW stack may take time to forward the packet (pyftdi->pyusb (+python interpreter) -> libusb -> kernel -> usb driver -> usb host HW (+FIFOs) -> USB device (+FIFO) -> FTDI engine -> FTDI GPIO ....) so you might even miss a dummy USB frame and get a 2 ms delay for example. Most of the FTDI features are definitely not designed to support real time application, i.e. there is no way to guarantee a reproducible delay between two commands.
Yes, this is due to the USB protocol, and PyFtdi do not implement mitigations for this. There is no plan to do so (that would require a lot of work, and FTDI MPSEE is really a legacy hardware. There are very cheap micro controller or even FGPA boards available that could much better than an expensive FTDI... :-) |
I have two devices with a FT232H chip (Adafruit FT232H and Digilent Usb Device ) attached to my computer (Win10).
The available interfaces are listed as follow
I use the following code to try to access the EEPROM of the Adafruit board
I use the URL
ftdi://ftdi:232h:1/1
since it was the one reported for the Adafruit board. However, when I run this piece of code, I get the EEPROM content of the Digilent device. The only way I can get the content of the Adafruit is by disconnecting the Digilent Device.I guess there is something I am missing regarding the usage of URL.
The text was updated successfully, but these errors were encountered: