Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > BeginDataXfer, WaitForXfer, and FinishDataXfer approach

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



BeginDataXfer, WaitForXfer, and FinishDataXfer approach
Moderator:
RSKV

Post Reply
Follow this topic



BeginDataXfer, WaitForXfer, and FinishDataXfer approach

IRod posted on 22 Jun 2012 12:24 AM PST
Senior Member
11 Forum Posts

 Hi all,

I'm using these functions to transfer data from a FPGA to PC using slaveFIFO approach and it works but I have some doubts about the actual mode it works and its limitations. I'm using a single bursty BULK endpoint.

If I don't understand bad as said in USB3.0 specification only 1 IN transfer can be active at a time.

So BeginDataXfer sets-up a bunch of transfers (1 per call) but only initiates the first one. Then, WaitForXfer waits for the transfer to complete or the specified timeout expires and FinishDataXfer finishes the transfer (I don't know what FinishDataXfer exactly does).

Is it the right behaviour?. I ask it because some doubts arise me at this point.

1. Is there any limitation regarding the maximum number of BeginDataXfer functions that can be called in a row?.

2. Does the endpoint timeout start counting down when BeginDataXfer is call?. If so, If I configure a big number of transfers and I'm not able to call all of them before the endpoint timeout expires, are those transfers aborted?.

The problem is that I have a very variable throughput (from 1,48Gbps to 0,15Gps) so I have to configure queue size and transfer size depending on that the current throughput provided by the FPGA and I need to know the limitations of the above approach.

Best regards,

Israel




Re: BeginDataXfer, WaitForXfer, and FinishDataXfer approach

aasi posted on 22 Jun 2012 01:59 AM PST
Cypress Employee
1073 Forum Posts

To give a high level description,

BeginDataXfer queues up the request i.e. gives the buffer and its location to the USB stack

Waitforxfer waits for the transfer to complete, it'll wait for the timeout value specified if the transfer doesn't complete by then it'll timeout the reqeust

Finishdataxfer retrieves the data that was received. If only part of the data was received and a timeout happened it'll release the rest of the buffer

 

The limitation in number of BeginDataXfer has to do with the amount of buffer that can be queued on the host controller driver Please look at http://msdn.microsoft.com/en-us/library/ff538112.aspx for details.

The more transfers you queue the faster the data rate i.e. by the time one transfer is complete the next is already queued up so it'll start.

Xferdata uses the above 3 API but there is a performance difference because only after one Xferdata returns we'll queue up the next so there is latency between 2 transfers are the application level.

Regards,

Anand






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.