This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5515 USB DMA examples with packets > 64 bytes

Hi all,

I am reading the C5515 USB Controller Guide (SPRUGH9) and the Section 2.9.12 describes how to transfer 608 bytes of data over USB with minimal CPU intervention.

The CSL DMA examples only include 64-byte transfers, and I would like to be able to transfer larger packets (in my case the packets would be 528 bytes long). 

Has anyone succeeded in implementing DMA-based USB transfers where packets were larger than 64 bytes? Like the Section 2.9.12 describes? Ideally, we would only get one interrupt, which would occur after the entire packet has been transferred.

Thank you in advance,

Mladen Males 

  • Hi Mladen,

     

    By using these definitions on a modified csl_usb_dma_example we had 512 bytes bulk block size

    ====================================================

    Uint16    deviceDesc[9] = {0x0112, 0x0200, 0x0000, 0x4000, 0x0459,
                               0x9999, 0x0000, 0x0201, 0x0103};

    Uint16    cfgDesc[30] = {0x0209, 0x003C, 0x0101, 0xA000, 0x0900,
                             0x0004, 0x0600, 0x0000, 0x0000, 0x0507,
                             0x0281, 0x0200, 0x0700, 0x0105, 0x0002,
                             0x0002, 0x0507, 0x0282, 0x0200, 0x0700,
                             0x0205, 0x0002, 0x0002, 0x0507, 0x0283,
                             0x0200, 0x0700, 0x0305, 0x0002, 0x0002};

    Uint16    strDesc[4][10] = {{0x0304, 0x0409, 0x0000, 0x0000, 0x0000,
                                 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
                                {0x0324, 0x0000, 0x0000, 0x0000, 0x0000,
                                 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
                                {0x0318, 0x0000, 0x0000, 0x0000, 0x0000,
                                 0x0000, 0x0000, 0x0000, 0x0000, 0x0000},
                                {0x0310, 0x0000, 0x0000, 0x0000, 0x0000,
                                 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}};
    =====================================================

     

    And that was what we got in USBView

    ====================================

    Device Descriptor:
    bcdUSB:             0x0200
    bDeviceClass:         0x00
    bDeviceSubClass:      0x00
    bDeviceProtocol:      0x00
    bMaxPacketSize0:      0x40 (64)
    idVendor:           0x0459
    idProduct:          0x9999
    bcdDevice:          0x0000
    iManufacturer:        0x01
    iProduct:             0x02
    iSerialNumber:        0x03
    bNumConfigurations:   0x01

    ConnectionStatus: DeviceConnected
    Current Config Value: 0x01
    Device Bus Speed:     High
    Device Address:       0x02
    Open Pipes:              6

    Endpoint Descriptor:
    bEndpointAddress:     0x81  IN
    Transfer Type:        Bulk
    wMaxPacketSize:     0x0200 (512)
    bInterval:            0x00

    Endpoint Descriptor:
    bEndpointAddress:     0x01  OUT
    Transfer Type:        Bulk
    wMaxPacketSize:     0x0200 (512)
    bInterval:            0x00

    Endpoint Descriptor:
    bEndpointAddress:     0x82  IN
    Transfer Type:        Bulk
    wMaxPacketSize:     0x0200 (512)
    bInterval:            0x00

    Endpoint Descriptor:
    bEndpointAddress:     0x02  OUT
    Transfer Type:        Bulk
    wMaxPacketSize:     0x0200 (512)
    bInterval:            0x00

    Endpoint Descriptor:
    bEndpointAddress:     0x83  IN
    Transfer Type:        Bulk
    wMaxPacketSize:     0x0200 (512)
    bInterval:            0x00

    Endpoint Descriptor:
    bEndpointAddress:     0x03  OUT
    Transfer Type:        Bulk
    wMaxPacketSize:     0x0200 (512)
    bInterval:            0x00

    ==========================================

     

    Based on this endpoint scheme we performed a bandwidth test and our testbed was showing about 200MBps total (IN+OUT).

     

    Yet these are for bulk, for your case whereas you want 528bytes packet size meaning you will use interrupt or isochronous then you know that you need to do more changes in the descriptors.

    We didnt notice any problem in the dma utilization in CSL regarding this change (64->512), it was transparent but you need to give the proper params to USB_confDmaRx/USB_confDmaTx.

     

    Christos