eblot / pyftdi

FTDI device driver written in pure Python
Other
509 stars 212 forks source link

UART lock up with FT4232H #366

Open rakeshhegde opened 10 months ago

rakeshhegde commented 10 months ago

The 4 ports of FT4232H are configured as below and the configuration is saved to EEPROM, Port A: VCP Port B: D2XX Port C: VCP Port D: VCP

Next, port B is configured as I2C master using pyFTDI. However, doing so makes the other UART ports (port A, C & D) unresponsive. The chip needs to be powered cycled to get back the UART ports.

Below is the code used to configure port B as I2C master,

Instantiate an I2C controller

i2c = I2cController()

Configure the first interface (IF/2) of the FTDI device as an I2C master

i2c.configure('ftdi://ftdi:4232/2')

What could be the issue?

eblot commented 10 months ago

I think I never tried to share the same device across the kernel boundary, i.e. one interface being handle by user-side libusb and the other interfaces still being handled by the kernel-side serial drivers. There may be several issues such as:

i.e. I never exercised this use case, there maybe some invalid USB call somewhere. I do share the serial port and I2C/SPI port of FT4432H, but only from user-side libusb calls (i.e. several pyftdi instances at once using the same FT4232 device)

Side note: except maybe on Windows, there is no need to configure the EEPROM to enable MPSSE mode along with serial mode, e.g. I2C + "VCP".