Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > what's the implication of the setxfersize() on earth?

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



what's the implication of the setxfersize() on earth?
Moderator:
RSKV

Post Reply
Follow this topic



what's the implication of the setxfersize() on earth?

西门吹牛奶 posted on 25 Feb 2012 4:06 AM PST
Top Contributor
34 Forum Posts

Hi,everyone,

In my test programme, when I write   "BulkInEpt1->SetXferSize(1048576);  "  the programme transfer 4MB data in about 120ms . But when I write  "BulkInEpt1->SetXferSize(1048576*4);  " the  programme transfer 4MB data in 1000 ms, note that i write also "BulkInEpt1->WaitForXfer(&inOvLap1,1000);" in my programme. the 1000ms means time out.

Furthermore, to enhance the transferring speed, I once used four endpoints. the code is below:

BulkInEpt1->SetXferSize(1048576);
 BulkInEpt2->SetXferSize(1048576);
 BulkInEpt3->SetXferSize(1048576);
 BulkInEpt4->SetXferSize(1048576);

UCHAR  *inContext1 = BulkInEpt1->BeginDataXfer(m_pImageBuffer1, length, &inOvLap1);
 UCHAR  *inContext2 = BulkInEpt2->BeginDataXfer(m_pImageBuffer2, length, &inOvLap2);
 UCHAR  *inContext3 = BulkInEpt3->BeginDataXfer(m_pImageBuffer3, length, &inOvLap3);
 UCHAR  *inContext4 = BulkInEpt4->BeginDataXfer(m_pImageBuffer4, length, &inOvLap4);

    BulkInEpt1->WaitForXfer(&inOvLap1,1000);
 BulkInEpt2->WaitForXfer(&inOvLap2,1000);
 BulkInEpt3->WaitForXfer(&inOvLap3,1000);
 BulkInEpt4->WaitForXfer(&inOvLap4,1000);

    BulkInEpt1->FinishDataXfer(m_pImageBuffer1, length, &inOvLap1,inContext1);
 BulkInEpt2->FinishDataXfer(m_pImageBuffer2, length, &inOvLap2,inContext2);
 BulkInEpt3->FinishDataXfer(m_pImageBuffer3, length, &inOvLap3,inContext3);
 BulkInEpt4->FinishDataXfer(m_pImageBuffer4, length, &inOvLap4,inContext4);

I transferred 1MB in each endpoint, but it cost 4s to finish the transferring, it's so incredible, what's the matter? and how to use multiple endpoints?

so what's the implication of the setxfersize() on earth? Does this code set the buffer size of  the USB2.0 host controller to be 1048576 bytes? or the driver transfer the data to application software's memmory when it receives 1048576 bytes data one time?




Re: what's the implication of the setxfersize() on earth?

aasi posted on 29 Feb 2012 10:02 PM PST
Cypress Employee
1090 Forum Posts

SetXferSize() sets the size of buffer to be used by the host controller driver for a particular endpoint. http://msdn.microsoft.com/en-us/library/ms790486.aspx documents the limitation on the value that can be used for the buffer size.

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.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20