AN65974 firmware image not working with USB 2.0

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

cross mob
Anonymous
Not applicable

Hi,

   

I've been doing some testing with the "SlaveFifoSync.img" firmware image included in "AN65974 - Designing with the EZ-USB FX3 Slave FIFO Interface".  The firmware is recognized and loads as "Cypress USB StreamerExample" when connected to a USB 3.0 port.  However, the firmware does not load when connected to a USB 2.0 port.  I am using SDK 1.2.3 and have seen this issue on multiple machines.  Any ideas on how to fix this problem?

   

 

   

Thank you

0 Likes
3 Replies
Anonymous
Not applicable

Hi Mike,

   

I had the same problem. USB3 was fine but USB2 enumeration was unreliable. Are you using the serial port to output messages to a terminal or do you have a debugger??? I use the serial port and needed to add delays so the Cypress xilprintf's would get outputted. When I did this I discovered that the setup for the EP sending data up to the host was failing because the burst len was 16 for USB3. I had to change it to 1 for USB2. At that point in the app you know if the enumeration was for 2 or 3 so I put an if() statement in there. I also had to upgrade from SDK 1.2.1 to 1.2 3 but you have already done this.

   

 

   

Tim

0 Likes
Anonymous
Not applicable

Hi Timmy-Bear,

   

 

   

Thanks for the response.  I was able to fix my issue.  From your suggestion in regards to the setup for the EP burst len being 16 for USB3 and 1 for USB2, I noticed a problem in the header file.

   

 

   

#ifdef USB_2_0
#define BURST_LEN 1 //for USB2.0
#else
#define BURST_LEN 16 //for USB3.0
#endif

   

 

   

The code was included in the header, however a previous line of code that defined USB_2_0 was commented out

   

 

   

//#define USB_2_0

   

 

   

Removing this comment allowed the BURST_LEN to be set corretly for USB 2.0 and the firmware now runs when connected to a 2.0 port.

   

 

   

Thanks for the help

   

 

   


 

0 Likes
Anonymous
Not applicable
        Hi, Yes. The epCfg.burstLen has been set to 0x10 and this causes the CyU3PSetEpConfig() request to fail on USB 2.0. epCfg.burstLen should be set to 1, whenever epCfg.pcktSize is less than 1024 and that is what is causing the failure. Changing the code to something like if(size < 1024) epCfg.burstLen = 1; else epCfg.burstLen = BURST_LEN; should allow it to work on both USB 2.0 and USB 3.0. Thanks, sai krishna.   
0 Likes