FX3 Bulk XferData stuck when receiving data from FPGA through sync_slave_FIFO under SuperSpeed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
WeCh_3849696
Level 1
Level 1
First solution authored

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

0 Likes
1 Solution

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 !

View solution in original post

0 Likes
6 Replies
KandlaguntaR_36
Moderator
Moderator
Moderator
25 solutions authored 10 solutions authored 5 solutions authored

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.

0 Likes

Thanks for the reply.

Sorry that I am not very clear about USB protocol, what may happen if the device is sending more NAK?

0 Likes

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).

0 Likes

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?

0 Likes

>> 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

0 Likes

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 !

0 Likes