Hi everybody,
I'm trying to get started in development on the FX3 board by learning from the firmware examples provided. I want the FX3 to generate some data and to send it via USB to my computer. I don't care about what to do with this data, for now my interest is to see the transfer bitrate. In the CyFxBulkSrcSink example a pair of IN/OUT endpoint is set (EP1 default, but I switched to EP6 in order to have higher bandwith), then a DMA MANUAL IN channel is created for data sink and a DMA MANUAL OUT channel is created for data source. A constant data pattern is continuously loaded into the DMA MANUAL OUT channel and sent to the host.
The code to set the parameters to create the DMA MANUAL channel is the following:
CyU3PDmaChannelConfig_t dmaCfg;
dmaCfg.size = (usbSpeed == CY_U3P_SUPER_SPEED) ? (size * CY_FX_EP_BURST_LENGTH) : (size);
dmaCfg.count = CY_FX_BULKSRCSINK_DMA_BUF_COUNT;
dmaCfg.prodSckId = CY_FX_EP_PRODUCER_SOCKET;
dmaCfg.consSckId = CY_U3P_CPU_SOCKET_CONS;
dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT;
dmaCfg.cb = CyFxBulkSrcSinkDmaCallback;
As you can see, I can manipulate the size (where the "size" identifier in the compact "if" statement is the packet size chosen according to the USB speed) and count fields to obtain different performances. Here on the forum I read that the size of DMA buffer can grow up to 64k, but any value I replace the right side of dmaCfg.size assignment with doesn't work (it lets me compile but fails programming the device by the control center). The default value of CY_FX_BULKSRCSINK_DMA_BUF_COUNT is 8, with which I obtain a transfer rate of about 10MBps. Raising it to 252 (but not any further, cause it doesn't work) changes the transfer rate to about 14MBps.
Using the CyFxBulkLpAuto example I could reach a transfer rate of 40MBps. Can you tell me why it goes so slow, even if the transfer is one-side only?
p.s. as software application I'm using the default visual studio cpp application provided.
Thanks,
mrain
|