General Category > Discussion - Software

[FT4232] FT_GetQueueStatus returns non-expected number of bytes in receive queue

(1/1)

alexeiko:
Hi, all!

I'm using FT4232 for JTAG. I'm using opcodes 0x39 and 0x3B for data in.
I'm expecting 9216 bytes (9KB) of data but the number of bytes in receive queue FT_GetQueueStatus gives me varies each time.
Once it's 9100, other time it's 9180 etc. Rarely I get the expected value.

What may be the issue? I tried to use smaller chunks, but still get incorrect values...

Would be glad for any help!

Thanks,
Alexei

alexeiko:
Hi!

Found a solution by reading the buffer in loop until expected number of bytes is received.



--- Code: --- while (totbytesread < 1024 * 9) {
do {
ftStatus |= FT_GetQueueStatus(ftHandle_A, &dwNumOfBytestoRead); // get the number of bytes in the device input buffer
} while ((dwNumOfBytestoRead == 0) && (ftStatus == FT_OK));

ftStatus |= FT_Read(ftHandle_A, mf_buff, dwNumOfBytestoRead, &dwNumOfBytesRead);
mf_buff += dwNumOfBytesRead;
totbytesread += dwNumOfBytesRead;
}

--- End code ---

Navigation

[0] Message Index

Go to full version