Author Topic: Max packet size for full speed bulk transaction  (Read 11663 times)

vision

  • Member
  • ***
  • Posts: 2
Max packet size for full speed bulk transaction
« on: March 12, 2013, 11:58:56 am »
Embedded Usb host : Full speed only
USB Device : High speed.  Has two high speed bulk endpoints with max packet size 512.

When this device is connect to the full speed host, is the host'sr the device'sesponbility to make sure the max packet size for bulk transaction is 64? In another word, if the host need to read a block of data bigger than 64 byte using bulk transaction, is the host's or the device's responbility to break it down to 64 byte packets?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Max packet size for full speed bulk transaction
« Reply #1 on: March 12, 2013, 12:16:51 pm »
The host's USB driver sends IN packets to the endpoint to request data.

For each transaction, the device returns data up to its max packet size.



vision

  • Member
  • ***
  • Posts: 2
Re: Max packet size for full speed bulk transaction
« Reply #2 on: March 12, 2013, 05:13:35 pm »
Jan,

Thanks for the reply.

Below is the USB device configuration info. Does that mean when this USB device is connected to a Full speed only host, it could still returns data up to its max packet size -- 512.

          ---===>Device Information<===---
English product name: "USB Flash Disk                "

ConnectionStatus:                 
Current Config Value:              0x01  -> Device Bus Speed: High
Device Address:                    0x1F
Open Pipes:                           2

          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x82  -> Direction: IN - EndpointID: 2
bmAttributes:                      0x02  -> Bulk Transfer Type
wMaxPacketSize:                  0x0200 = 0x200 max bytes
bInterval:                         0x00

          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x01  -> Direction: OUT - EndpointID: 1
bmAttributes:                      0x02  -> Bulk Transfer Type
wMaxPacketSize:                  0x0200 = 0x200 max bytes
bInterval:                         0x00

          ===>Device Descriptor<===
bLength:                           0x12
bDescriptorType:                   0x01
bcdUSB:                          0x0200
bDeviceClass:                      0x00  -> This is an Interface Class Defined Device
bDeviceSubClass:                   0x00
bDeviceProtocol:                   0x00
bMaxPacketSize0:                   0x40 = (64) Bytes
idVendor:                        0x**** = Vendor ID not listed with USB.org as of 03-19-2008
idProduct:                       0x****
bcdDevice:                       0x0100
iManufacturer:                     0x01
     English (United States)  "****                       "
iProduct:                          0x02
     English (United States)  "USB Flash Disk                "
iSerialNumber:                     0x03
     English (United States)  "****"
bNumConfigurations:                0x01

          ===>Configuration Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x02
wTotalLength:                    0x0020  -> Validated
bNumInterfaces:                    0x01
bConfigurationValue:               0x01
iConfiguration:                    0x00
bmAttributes:                      0x80  -> Bus Powered
MaxPower:                          0xFA = 500 mA

          ===>Interface Descriptor<===
bLength:                           0x09
bDescriptorType:                   0x04
bInterfaceNumber:                  0x00
bAlternateSetting:                 0x00
bNumEndpoints:                     0x02
bInterfaceClass:                   0x08  -> This is a Mass Storage USB Device Interface Class
bInterfaceSubClass:                0x06
bInterfaceProtocol:                0x50
iInterface:                        0x00

          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x82  -> Direction: IN - EndpointID: 2
bmAttributes:                      0x02  -> Bulk Transfer Type
wMaxPacketSize:                  0x0200 = 0x200 max bytes
bInterval:                         0x00

          ===>Endpoint Descriptor<===
bLength:                           0x07
bDescriptorType:                   0x05
bEndpointAddress:                  0x01  -> Direction: OUT - EndpointID: 1
bmAttributes:                      0x02  -> Bulk Transfer Type
wMaxPacketSize:                  0x0200 = 0x200 max bytes
bInterval:                         0x00

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Max packet size for full speed bulk transaction
« Reply #3 on: March 12, 2013, 06:19:11 pm »
No. The device should have an other_speed_configuration_descriptor and subordinate descriptors that define the interface and endpoint when operating at full speed.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: Max packet size for full speed bulk transaction
« Reply #4 on: March 12, 2013, 08:19:59 pm »
The largest allowed bulk max packet at full speed is 64 bytes. When the device is plugged into full speed its descriptor should only expose bulk endpoints which have 64 byte max packets (or 32, 16, or 8 which are also allowed, but 64 is most common.).