USB CDC transfert limit ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB CDC transfert limit ?

271 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tgiacomelli on Thu Sep 15 04:59:22 MST 2011
Hello,

I have a little problem with a usb tranfert. I'm using a LPC1768.
So, i want to do a transfert in usb port. I started with the usbserial example, i custom it to do a librairy project, and it's works. But when i want to do a transfert with 16384 or more bytes, the transfert stop at 16384 bytes.
For information, i use an bulk endpoint IN to do this transfert, 64 data bytes by packet, so the transfert is stoped when 256 packets are send (16384 bytes).
I wonder if an endpoint has a maximum number of packet by transfert, or if i need to ré-init it.
I tryed to use a second endpoint, but i have already a BULK IN endpoint and BULK OUT endpoint, and I could never install third endpoint. I have to use the BULK OUT, so i don't how resolve this problem.

Best regards.
0 Kudos
1 Reply

247 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tgiacomelli on Thu Sep 15 07:12:26 MST 2011
I add my descriptor, if somebody think that is the problem

// device descriptor
    0x12,
    DESC_DEVICE,
    LE_WORD(0x0101),            // bcdUSB
    0x02,                        // bDeviceClass
    0x00,                        // bDeviceSubClass
    0x00,                        // bDeviceProtocol
    MAX_PACKET_SIZE0,            // bMaxPacketSize
    LE_WORD(0xFFFF),            // idVendor
    LE_WORD(0x0005),            // idProduct
    LE_WORD(0x0100),            // bcdDevice
    0x01,                        // iManufacturer
    0x02,                        // iProduct
    0x03,                        // iSerialNumber
    0x01,                        // bNumConfigurations

// configuration descriptor
    0x09,
    DESC_CONFIGURATION,
    LE_WORD(67),                // wTotalLength
    0x02,                        // bNumInterfaces
    0x01,                        // bConfigurationValue
    0x00,                        // iConfiguration
    0xC0,                        // bmAttributes
    0x32,                        // bMaxPower
// control class interface
    0x09,
    DESC_INTERFACE,
    0x00,                        // bInterfaceNumber
    0x00,                        // bAlternateSetting
    0x01,                        // bNumEndPoints
    0x02,                        // bInterfaceClass
    0x02,                        // bInterfaceSubClass
    0x01,                        // bInterfaceProtocol, linux requires value of 1 for the cdc_acm module
    0x00,                        // iInterface
// header functional descriptor
    0x05,
    CS_INTERFACE,
    0x00,
    LE_WORD(0x0110),
// call management functional descriptor
    0x05,
    CS_INTERFACE,
    0x01,
    0x01,                        // bmCapabilities = device handles call management
    0x01,                        // bDataInterface
// ACM functional descriptor
    0x04,
    CS_INTERFACE,
    0x02,
    0x02,                        // bmCapabilities
// union functional descriptor
    0x05,
    CS_INTERFACE,
    0x06,
    0x00,                        // bMasterInterface
    0x01,                        // bSlaveInterface0
// notification EP
    0x07,
    DESC_ENDPOINT,
    INT_IN_EP,                    // bEndpointAddress
    0x03,                        // bmAttributes = intr
    LE_WORD(8),                    // wMaxPacketSize
    0x0A,                        // bInterval
// data class interface descriptor
    0x09,
    DESC_INTERFACE,
    0x01,                        // bInterfaceNumber
    0x00,                        // bAlternateSetting
    0x02,                        // bNumEndPoints
    0x0A,                        // bInterfaceClass = data
    0x00,                        // bInterfaceSubClass
    0x00,                        // bInterfaceProtocol
    0x00,                        // iInterface
// data EP OUT
    0x07,
    DESC_ENDPOINT,
    BULK_OUT_EP,                // bEndpointAddress
    0x02,                        // bmAttributes = bulk
    LE_WORD(MAX_PACKET_SIZE),    // wMaxPacketSize
    0x00,                        // bInterval
// data EP in
    0x07,
    DESC_ENDPOINT,
    BULK_IN_EP,                    // bEndpointAddress
    0x02,                        // bmAttributes = bulk
    LE_WORD(MAX_PACKET_SIZE),    // wMaxPacketSize
    0x00,                        // bInterval
// data EP in THIS IS MY NEW DESCRIPTOR : i change bNumEndPoints = 0x03 but not works
/*    0x07,
    DESC_ENDPOINT,
    BULK_IN_EP_2,                // bEndpointAddress
    0x02,                        // bmAttributes = bulk
    LE_WORD(MAX_PACKET_SIZE),    // wMaxPacketSize
    0x00,                        // bInterval
*/
    // string descriptors
    0x04,
    DESC_STRING,
    LE_WORD(0x0409),

    0x0E,
    DESC_STRING,
    'L', 0, 'P', 0, 'C', 0, 'U', 0, 'S', 0, 'B', 0,

    0x14,
    DESC_STRING,
    'U', 0, 'S', 0, 'B', 0, 'S', 0, 'e', 0, 'r', 0, 'i', 0, 'a', 0, 'l', 0,

    0x12,
    DESC_STRING,
    'D', 0, 'E', 0, 'A', 0, 'D', 0, 'C', 0, '0', 0, 'D', 0, 'E', 0,
0 Kudos