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.

C6748's USB 2.0 Port : Very low data transfer rate

Dear All,
I've a question about the data transfer rate of the USB 2.0 port on C6748. Based on Starterware's USB example code usb_dev_serial, I've written a simple FW which does nothing but generates and sends 1MByte of data to a Windows 7 Host. It is surprise that the average data rate is only around 127 KByte/s. As that piece of code is rather simple, I'm wondering if this symptom is cuased by the performance limitation of Starterware USB library? If not, could anyone kindly provide any suggestion?

Regards,

Oliver

  • Dear Titus,

    First thank you for you prompt reply and information. :)

    The following performance looks nice:

    Examples

                                                                            EVM-AM335x

    Read (DMA Mode - Raw read) Write (DMA Mode - Raw write)
    usb_host_msc 16.6 MB/Sec 17.0 MB/Sec
    usb_dev_msc 14.2 MB/Sec 17.6 MB/Sec

    It's a good reference for the performance of Starterware's USB library. However, it's just for USB MSC on AM335X, not for USB CDC on C6748. Anyway, what I expect is to know how to improve the performance of USB CDC on C6748. For example, I noticed that the Maximum Packet Size of CDC is only 64 Byte (for Bulk enpoint):

    bEndpointAddress: 0x01 -> Direction: OUT - EndpointID: 1
    bmAttributes: 0x02 -> Bulk Transfer Type
    wMaxPacketSize: 0x0040 = 0x40 max bytes


    bEndpointAddress: 0x81 -> Direction: IN - EndpointID: 1
    bmAttributes: 0x03 -> Interrupt Transfer Type
    wMaxPacketSize: 0x0010 = 1 transactions per microframe, 0x10


    bEndpointAddress: 0x82 -> Direction: IN - EndpointID: 2
    bmAttributes: 0x02 -> Bulk Transfer Type
    wMaxPacketSize: 0x0040 = 0x40 max bytes

    If it is possible to increase this to, e.g., 256 Byte, maybe the performance would be drastically increased?  I'm wondering if anyone in TI who is familiar with Startware's USB library could advise?

    Regards,

    Oliver

  • StarterWares poor USB speed has been noted on this forum. Some threads:

    http://e2e.ti.com/support/embedded/starterware/f/790/t/316923.aspx
    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/270083.aspx
    http://e2e.ti.com/support/embedded/starterware/f/790/t/180217.aspx

  • Dear Norman,

    Thanks for your prompt reply and helpful information. According to the threads you provide, it seems that Starterware USB library intends to be a working library instead of being a high performance one. If this guess is true, then I can understand since in embedded system performance is normally highly hardware-dependent. I'll try the suggestions in those threads. Thanks again! :)

    Regards,

    Oliver

  • Dear Norman,

    It's just like a magic: the transfer speed increased from 127 KB/s to 1,869 KB/s! Here is what I've done:

    1. Increase both of the DATA_IN_EP_FIFO_SIZE & DATA_OUT_EP_FIFO_SIZE in usbdcdc.c from 64 Byte to 512 Byte

    2. Locate all program and data to L2 

    Since it's not practical to reserve all the precious L2 memory to USB function, I think I've to enable DMA to transfer data. In the thread you mentioned:

       http://e2e.ti.com/support/embedded/starterware/f/790/t/316923.aspx

    there is a line enabling USB DMA:

      USBEndpointDMAEnable(USB0_BASE,USB_EP_1,USB_EP_DEV_OUT);

    However, in my code simply calling this function with appropriate (I think) arguments will not work: PC fails to enumerate my USB device. I'm wondering if you happen to know where I can find any information about how to enable the USB DMA feature in Starterware?

    Regards,

    Oliver

  • Good to hear. I've always wondered if increasing the packet size would actually work. I guess the USB packet overhead is quite significant.

    It has been a while, I vaguely remember that StarterWare uses DMA only in the Mass Storage example. Passing different arguments or enabling flags is not sufficient to enable DMA. The StarterWare USB driver is generic enough. There is DMA speciifc code is also in the USB Class portion as well. The DMA code is surrounded with #ifdef DMA_CODE. Look for that when porting. All other examples do not use DMA. I did eventually port the DMA changes from the Mass Storage to the Bulk Example. DMA uses a huge amount of memory (will not fit in L2 or L3) and I could not see any performance improvement. I might have done the port incorrectly. Others on this forum have also ported the DMA code. Search around. They might have had better luck.

    Another thing to try is the interval attribute on the endpoint descriptor. You might be able to get the Host to poll your Device at a higher rate.

  • Dear Norman,

    Thanks to your advice, I've found those files including DMA_MODE in Starterware's USB library. And, unfortunately, decreasing the interval from 10 to 1 doesn't improve performance. So, maybe I got to find some other way.

    Anyway, thanks for your advice again! :)

    Regards,

    Oliver

  • Oliver,

    Have you had any success getting the USB driver to run faster?

    Thank you.