- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
As title, we are developing an application which can receive data from FPGA through sync_slave_FIFO to PC.
We use BulkInEpt->XferData(*) to receive data. It's working fine under USB 2.0 but stuck under USB 3.0.
Below is some code snippet we use to receive data.
And if we uncomment "printf("0x%p\n", cur_write_pos);", it's working fine under USB 3.0.
What's the possible problem here?
//-----------------------------------------------------------------------
#define BULK_IN_BUFFER_SIZE 16 * 1024
BulkInEpt->TimeOut = 0xFFFFFFFF;
// resdiual_bytes_wanted is the #byte desired
while (1)
{
if (resdiual_bytes_wanted > BULK_IN_BUFFER_SIZE)
len_actual = len_wanted = BULK_IN_BUFFER_SIZE;
else
len_actual = len_wanted = resdiual_bytes_wanted;
//printf("0x%p\n", cur_write_pos);
status = BulkInEpt->XferData(cur_write_pos, len_actual);
if (status)
{
cur_write_pos += len_actual;
total_received += len_actual;
resdiual_bytes_wanted -= len_actual;
if (resdiual_bytes_wanted == 0 || len_wanted != len_actual)
{
final_status = true;
break;
}
}
}
Thanks,
Wesley
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the very late reply and update. We finally found that if we disable low power mode through CyU3PUsbLPMDisable(), the bulk transfer through SuperSpeed doesn't stuck anymore. Thanks for your support !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like there should be a delay between Xferdata calls.
Since USB 3.0 streams the data at higher rate, there is possibility that the device is sending more NAK.
You may capture the USB trace with Wireshark and see the difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply.
Sorry that I am not very clear about USB protocol, what may happen if the device is sending more NAK?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When the host send IN_REQUEST for data from the device, the device responds with the data, if it has. Otherwise, it will send NAK (No data to send).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So.. how can I avoid this problem?
The specific situation is:
We are sending data from FPGA to PC through XferData(*), but the function returns TIMEOUT.
However, on the FPGA side, we received LOW on FLAGA and FLAGB which indicates FIFO full.
Is this possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>> We are sending data from FPGA to PC through XferData(*), but the function returns TIMEOUT.
It means the FX3 is not sending the data.
>> However, on the FPGA side, we received LOW on FLAGA and FLAGB which indicates FIFO full.
>> Is this possible?
It means FX3 has the data.
Can you please use default Streamer application provided with the SDK and check?
(C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\application\c_sharp\streamer)
You can also add a counter in the dmacallback and check whether the FX3 has received the data from the FPGA.
Regards,
Sridhar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the very late reply and update. We finally found that if we disable low power mode through CyU3PUsbLPMDisable(), the bulk transfer through SuperSpeed doesn't stuck anymore. Thanks for your support !