Skip to content
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

UART lock up with FT4232H #366

Open
rakeshhegde opened this issue Jan 16, 2024 · 1 comment
Open

UART lock up with FT4232H #366

rakeshhegde opened this issue Jan 16, 2024 · 1 comment

Comments

@rakeshhegde
Copy link

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
Copy link
Owner

eblot commented Jan 17, 2024

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:

  • being sure that neither of pyftdi, pyusb, libusb claims more than one interface, and the kernel being able to only releasing one interface of a device and keeping its serial driver to manage the other interfaces (I'm not sure if it is even safe as some features are actually shared across the different interfaces)
  • being sure that pyftdi does not perform a full device reset, only an interface reset
  • tracking if selecting a USB device configuration from pyftdi/pyusb does not impact the other interfaces of the same device (no idea about this one to be honest)

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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants