Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > maximum endpoint size for bulk transfer

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



maximum endpoint size for bulk transfer
Moderator:
RSKV

Post Reply
Follow this topic



maximum endpoint size for bulk transfer

mc posted on 24 Sep 2009 12:40 AM PST
Senior Member
13 Forum Posts
Hi,

I am using EZ-USB FX2LP Chip for bulk high speed transfers.
My IN endpoint EP2 is configured as follows:
EP2CFG = 0xEA; // EP2IN, bulk, size 1024, 2x buffered
Is this allowed for bulk transfer?

I know that wMaxPacketSize are limited to 512 bytes in USB-2 spec.
But can I have EP2 size 1024 with wMaxPacketSize set to 512.


Re: maximum endpoint size for bulk transfer

aasi posted on 24 Sep 2009 02:37 AM PST
Cypress Employee
1090 Forum Posts
wMaxPacketSize declared in the descriptor is just to inform the host the size... if you have going to override this in your firmware, when the host requests for data and the device is capable of responding with packets up to 1024 bytes... here the problem is if the device is gonna send a bulk packet of size greater than 512 bytes it will most likely crash the host i.e drivers don't try to catch all exceptions mainly under the assumption that the device at least follow the hard and fast rules set by the spec.... btw why do you want to do this???

Re: maximum endpoint size for bulk transfer

mc posted on 24 Sep 2009 09:32 AM PST
Senior Member
13 Forum Posts
Thanks for feedback.

I implemented cypress chip as slave fifo with EP2IN size 1024 and wMaxPacketSize set to 1024 because at that time I did not know that wMaxPacketSize is limited to 512 for BULK transfers.
This by the way worked perfectly for windows and linux (It seems they manage this case at kernel level).

But I have problems under Mac OS X and I discovered the wMaxPacketSize limitation to 512.
Setting EP2IN size to 512 in firmware like this:
EP2CFG = 0xE0; // EP2IN, bulk, size 512, 4x buffered
Did not work.
At hardware side (slave fifo side) I only use manual commit packets and no auto-commits.

For that reason I expected to keep mi EP2IN size 1024 but set wMaxPacketSize to 512.
But This does not work either.

To make it simpler, would you say wMaxPacketSize should always be the same size than size set in EP2CFG? That in fact will answer every thing!

Thanks

Re: maximum endpoint size for bulk transfer

aasi posted on 24 Sep 2009 07:17 PM PST
Cypress Employee
1090 Forum Posts
ya.... you got it....

Re: maximum endpoint size for bulk transfer

mc posted on 25 Sep 2009 01:37 AM PST
Senior Member
13 Forum Posts
Thanks
Everything is fine now.
My device (hardware, firmware and driver) works perfectly.

Cheers

Re: maximum endpoint size for bulk transfer

pascalschwartz posted on 03 Mar 2011 04:04 AM PST
Member
5 Forum Posts

Hi , i have small question about it
i also defined the EP2 1024 and wMaxPacketSize as 1024  using windows and it worked fine.
the question is using 1024 is better then 512 in performance despite that in the sepc of usb 2.0 it defined as 512? if it does not improve performance why use 1024? is it safe to use 1024?
Thanks
Pascal



Re: maximum endpoint size for bulk transfer

aasi posted on 03 Mar 2011 10:13 AM PST
Cypress Employee
1090 Forum Posts

It is not safe to use 1024. Some host controllers might take it lightly but not all host controllers do. You might run into BSOD on certain machines.

Taking the better bandwidth theory. why not take it more than 1024? The buffer required, error handling etc are gonna scale up accordingly. 4 types of transfers are given to work with these tradeoffs.

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: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20