4 Replies Latest reply on Sep 19, 2019 1:57 AM by WeCh_3849696

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

    WeCh_3849696

      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