CYUSB3014 - How to speed up operate control endpoint IN for USB highspeed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
VlSh_3188636
Level 1
Level 1

My application uses a vendor request to periodically set parameters. I noticed that requests are processed very slowly, on the order of 30 ms. On another processor (CY7C68013A), these same requests are processed 3 ms. How to change request processing speed.

0 Likes
1 Solution

Hello,

As described in FX3_SDK_TroubleShooting_Guide provided with the FX3 SDK, Section 2.3, Part IV.

The low performance of the CyU3PUsbSendEP0Data() is because, the other IN (BULK,ISO, INTERRUPT) endpoints need to be suspended so that the the data over the control endpoint doesn't get corrupted due to premature data fetching from the DMA channel and was included from SDK version 1.3.2 onwards.

As a workaround you could implement the following snippet of code instead of CyU3PUsbSendEP0Data():

               extern CyU3PDmaChannel glUibChHandle;                    /* In channel handle for ep0 */

                    extern CyU3PReturnStatus_t                                       /* declaration of DmaChannelSendData */

                    CyU3PDmaChannelSendData (

                                 CyU3PDmaChannel *handle,

                                 uint8_t         *buffer,

                                 uint16_t         count);

In the vendor command that you are using, replace CyU3PUsbSendEP0Data() with the below two lines:

               CyU3PDmaChannelSendData (&glUibChHandle, glEp0Buffer, wLength);               /* use instead of CyU3PUsbSendEP0Data*/

               CyU3PUsbAckSetup ();                                                                                              /*important to ack the request from host*/

NOTE: The above workaround is a way to match the control endpoint performance to that of SDK 1.3.1 but it should be taken care in the firmware that there is no BULK-IN transaction while EP0-IN transaction is going on as it will lead to the control read data getting corrupted.

Also, the above workaround is only provided to you and will not be added to the future releases of SDK as there are the above mentioned problems with it. So, in future releases, you will have to take care of the workaround in the application by yourself.

Regards,
Yashwant

View solution in original post

0 Likes
12 Replies