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?