7 Replies Latest reply on Jan 28, 2015 10:22 PM by john.christian.delos.reyes

    maximum endpoint size for bulk transfer

    malik.cisse
              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.   
        • 1. Re: maximum endpoint size for bulk transfer
          anand.srinivasan.asokan
                  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???   
          • 2. Re: maximum endpoint size for bulk transfer
            malik.cisse
                    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   
            • 3. Re: maximum endpoint size for bulk transfer
              anand.srinivasan.asokan
                      ya.... you got it....   
              • 4. Re: maximum endpoint size for bulk transfer
                malik.cisse
                        Thanks   
                Everything is fine now.   
                My device (hardware, firmware and driver) works perfectly.   
                   
                Cheers   
                • 5. Re: maximum endpoint size for bulk transfer
                  pascal.schwartz

                  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

                  • 6. Re: maximum endpoint size for bulk transfer
                    anand.srinivasan.asokan

                    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

                    • 7. Re: maximum endpoint size for bulk transfer
                      john.christian.delos.reyes

                       What if i want to transfer a large file? For example a picture. Because I am encountering a problem that is the buffer cannot store all of the data of the picture instead it only captures a segment of it.

                         

                      Please see the attachments.