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.

Improve C6748 bulk device throughput?



Hello,

My customer tests C6748 bulk device throughput with starterware usb_dev_bulk_c674x_c6748_evmC6748 demo on C6748 EVM, the throughput is very low.
Searched forum found many same request but did not found solid answer on how to improve.
We modified the demo tetentively according to pieces of advices from serveral posts as below:

change revision from 1.1 to 2.0 in usbdbulk.c:
unsigned char g_pBulkDeviceDescriptor[] =
{
    18,                         // Size of this structure.
    USB_DTYPE_DEVICE,           // Type of this structure.
    USBShort(0x200),            // USB version 1.1 (if we say 2.0, hosts assume
                                // high-speed - see USB 2.0 spec 9.2.6.6)
    USB_CLASS_VEND_SPECIFIC,    // USB Device Class
....

define endpoint
#define DATA_IN_ENDPOINT        USB_EP_1
#define DATA_OUT_ENDPOINT       USB_EP_1

Enable Cache and DMA:
CacheEnable(L1PCFG_L1PMODE_32K | L1DCFG_L1DMODE_32K | L2CFG_L2MODE_256K);
CacheEnableMAR((unsigned int)0xC0000000, (unsigned int)0x20000000);
USBEndpointDMAEnable(USB0_BASE,USB_EP_1,USB_EP_DEV_OUT);

Modify Buffer size:
D:\ti\C6748_StarterWare_1_20_04_01\examples\evmC6748\usb_dev_bulk\usb_bulk_structs.c
#define BULK_BUFFER_SIZE 1024       //256
D:\ti\C6748_StarterWare_1_20_04_01\examples\evmC6748\usb_dev_bulk\usb_bulk_structs.h
#define BULK_BUFFER_SIZE 1024     //256

Modfiy FIFO size
D:\ti\C6748_StarterWare_1_20_04_01\usblib\device\usbdbulk.c
#define DATA_IN_EP_FIFO_SIZE    USB_FIFO_SZ_512   //USB_FIFO_SZ_64
#define DATA_OUT_EP_FIFO_SIZE   USB_FIFO_SZ_512   //USB_FIFO_SZ_64

get the final throughput 2.837Mbyte/s vs 0.578Mbyte of original code.

But cusotmer used another Cypress USB controller extend on C5509A EMIF, it can acheive 5.132Mbyte/s, on both test code, we did not process the received data on DSP, more detail please refer

the attached modified usb_dev_bulk.c
we think the on-chip USB should be more efficent then the EMIF extended USB, need your advices on how to improve it, where is the bottle neck and what is the maximum throughput can achieve?

  • Is Starterware maintained continue?

  • Tony Tang said:
    Is Starterware maintained continue?

    Good question. My current feeling is it is still maintained but quality of support is quite poor. Sometimes you get better answers on stackoverflow.com, at least it worths a try.

    Any official statements regarding Tonys question?

  • Hi Tony,

    Yes, the starterware C6748 USB bulk device throughput was very slow.

    There was a detailed discussion already done in the forum ( refer the link below) and the throughput was improved by enabling the CPPI DMA as a mode of transfer in device bulk starterware code and the through put is increased to around 12-13MB/sec.

    http://e2e.ti.com/support/dsp/tms320c6000_high_performance_dsps/f/115/t/270083.aspx

    Please have a look at the above link and revert if there are any more questions.

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • I'm working with USB CDC device and found something strange in ringbuffer code of usblib: in usbringbuf.c there are all interrupts disabled by calling IntDisable() whenever data are written to and read from a ringbuffer. Afterwards the IRQs are reenabled by calling IntEnable().

    Apart from the fact that ringbuffer implementation is quite poor and every single byte (!!) is read/written separately out of/into ringbuffer, globally disabling the interrupts does not make any sense for me.

    I did not make detailed measurements yet but removing these IntDisable()/IntEnable() calls speeds up the whole thing a bit.

    Don't know if this is used for bulk transfers too but for CDC device this definitely helps.

  • Hi Hans,

    Thanks for updating your observation. We will also check in the bulk transfers code.

     

    Regards,

    Shankari