I found the issue.
It appears to be line 247 of ftdi_stream.c
struct timeval timeout = { 0, ftdi->usb_read_timeout * 1000};
It appears that ftdi->usb_read_timeout has a value of 5000 on my
computer. The microsecond member of the timeval struct goes over 1
million as a result, which results in a invalid parameter error with
libusb.
The correct code is:
struct timeval timeout = { (ftdi->usb_read_timeout / 1000),
(ftdi->usb_read_timeout % 1000) * 1000};
After fixing this line, I have no errors when running stream_test.c
On 4/19/24 15:20, Board wrote:
Hi,
I am trying to connect a FT232H chip to my computer using the
stream_test.c file. I tried it on two different Linux machines (both
running Arch-based distributions). I get the same error, namely the
call err = ftdi_readstream(ftdi, readCallback, NULL, 4, 128); on line
216 fails with error -2.
My FT232H chip is being driven by an FPGA, and I verified the signals
on all the pins were correct with an oscilloscope. Just to be sure, I
also forced WR low, to force the chip to constantly get data. The TXE
pin is going high, which proves that the chip's buffer is filling up.
In the FT_PROG program, I configured my chip with the following settings:
Hardware: 245 FIFO
Driver: D2xx Direct (Selecting Virtual COM Port didn't help)
VID: 0403
PID: 6014 (I made sure to change the PID in the code from 6010 to 6014
to match)
Bus Powered, with 500mA current limit
Looking at the output of dmesg, it does not appear that there was any
power cycling or disconnects.
Any ideas as to what could be wrong?
Thanks
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|