1
Discussion - Drivers / Reading data from FT232h via FT2XX driver - data loss on Raspberry Pi
« on: December 05, 2017, 09:22:15 AM »
Hi there,
I am new to this community so I hope I chose the right subforum to post.
I have an FTDI USB device that sends a huge amount of (known) data via the FTD2XX driver in 245-FIFO-mode. I wrote a little C code that reads the data and checks it for correctness. With every call of FT_Read(), an array of 256 bytes is processed.
When I run this code on my Windows desktop, it works fine. However, when I cross compile and run the executable on a Raspberry Pi, it results in data loss. I built a delay of 2 seconds in my code after the device starts sending data and before the first call of FT_Read(). Since that, the fault in the read data always occurs at the same byte.
What is the reason of this data loss (buffer overflow?) and how can I prevent it?
I use a Raspberry Pi 3 with the latest version of Raspbian OS Lite. The code is cross compiled on a Windows 32bit workstation with GCC. The libraries used are those packed with the libftd2xx-arm-v6-hf-1.4.6 driver I downloaded from the official FTDI website.
Thank you for any ideas.
I am new to this community so I hope I chose the right subforum to post.
I have an FTDI USB device that sends a huge amount of (known) data via the FTD2XX driver in 245-FIFO-mode. I wrote a little C code that reads the data and checks it for correctness. With every call of FT_Read(), an array of 256 bytes is processed.
When I run this code on my Windows desktop, it works fine. However, when I cross compile and run the executable on a Raspberry Pi, it results in data loss. I built a delay of 2 seconds in my code after the device starts sending data and before the first call of FT_Read(). Since that, the fault in the read data always occurs at the same byte.
What is the reason of this data loss (buffer overflow?) and how can I prevent it?
I use a Raspberry Pi 3 with the latest version of Raspbian OS Lite. The code is cross compiled on a Windows 32bit workstation with GCC. The libraries used are those packed with the libftd2xx-arm-v6-hf-1.4.6 driver I downloaded from the official FTDI website.
Thank you for any ideas.