FTDI Community

General Category => Discussion - Software => Topic started by: cwryu on July 09, 2022, 01:38:08 AM

Title: FT4222 use mode 2 and FT_OPEN_BY_LOCATION
Post by: cwryu on July 09, 2022, 01:38:08 AM
I connect four FT4222H chips to one ARM Linux board and use the mode 2 method. When I check the device connection using the libft4222 Library, it is recognized as normal. However, if I reboot the ARM Linux board or disconnect FT4222H and reconnect it, the LocId returned from FT_DEVICE_LIST_INFO_NODE changes every time, and I want to know if there is a way to fix LocId.
Because the equipment I am developing needs to control the SPI Slave Device according to the order of FT4222H connected to the USB port of the ARM Linux board, so I need fixed LocId information.
Or, I would like to know if there is a way to match LocId with Linux's /sys/bus/usb/devices/ information.
Title: Re: FT4222 use mode 2 and FT_OPEN_BY_LOCATION
Post by: FTDI Community on July 11, 2022, 04:56:29 PM
Hi,

The location IDs on Linux are just an estimate of where the USB device is. it is not like windows where it is the exact location. there is no way to have it fixed. Although it shouldn't change when you reconnect, there is no guarantee that it won't. i would suggest that you would be better opening the device by description or serial number. Or you could even check where the device is on the USB tree before opening it.   

Best Regards

FTDI Community