Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Slave fifo interface gets stuck

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Slave fifo interface gets stuck
Moderator:
RSKV

Post Reply
Follow this topic



Slave fifo interface gets stuck

Sil posted on 02 Nov 2011 8:07 AM PST
Top Contributor
93 Forum Posts

Hello

I am using the 16 Bit slave fifo interface and set the fifo full flag of the writing tread fixed to flag B. The DMA channel is set to auto between slave fifo and usb interface, using 2048 byte buffer size with 8 packets.

I am using the BulkLoop C++ application example to send and receive data. To the slave fifo interface an FPGA is attached, that loops the data back.

Now it happens sometimes that the FX3 reports fifo full on the writing thread (flag B stays low forever), and as a result, the FPGA stops writing data to the slave fifo. If I reset the FX3 it works again flawless, but after a few seconds gets stuck once more with the same behavior. Has anybody encountered similar issues? Thx.

Silvio




Re: Slave fifo interface gets stuck

aasi posted on 02 Nov 2011 08:18 AM PST
Cypress Employee
1073 Forum Posts

Can you explain your setup a little more?

Once the full flag asserts did you try reading the data from the USB side to get the data and clear the internal buffers?

Regards,

Anand



Re: Slave fifo interface gets stuck

Sil posted on 03 Nov 2011 03:40 AM PST
Top Contributor
93 Forum Posts

Yes, I can read out the data but for some reason I have to call XferData() many times until the buffer is empty. As an example, if I write 1 MByte data, each XferData() call to the in port only returns around 27'076 Bytes, sometimes more, sometimes less. During this time, no further data is sent to the out port.

Once the buffer is empty, the loopback test is working fine, but gets stuck again after some seconds.

 

-Silvio



Re: Slave fifo interface gets stuck

aasi posted on 03 Nov 2011 05:21 AM PST
Cypress Employee
1073 Forum Posts

This seems like a manifestation of the rate of IN packets not being equal to rate of OUT packets. So at some point all the buffers are filled and the full flag is asserted.

The fact that you are able to read packets and get the loop working again means that the firmware is good. It is just that data is not being read fast enough. What is the freqeuncy at which you're operating the slave FIFO interface. What is the timeout you're specifying for Xferdata?

Regards,

Anand



Re: Slave fifo interface gets stuck

Sil posted on 03 Nov 2011 07:12 AM PST
Top Contributor
93 Forum Posts

In the C++ BulkLoop example it is set to 2s (timeout check box is disabled):

OutEndpt->TimeOut = 2000

InEndpt->TimeOut = 2000

 

I set a breakpoint if "inlen != outlen". This breakpoint triggers excatly when the reported problem occurs. In my case I got inlen=5118 and outlen=0.  This is already very interesting because how can we receive 5118 bytes if no data could be sent?

After that I manually stepped trough the code and executed the DataXfer() function on the in endpoint until no further data was available. After receiving 484152 bytes and calling DataXfer() many times, no further data was available and the BulkLoop example continued normally.

The slave fifo interface is working at 50 Mhz and 16 Bit.

 

-Silvio

 



Re: Slave fifo interface gets stuck

Sil posted on 03 Nov 2011 08:13 AM PST
Top Contributor
93 Forum Posts

Just figured out that if I set the FX3 to MANUAL DMA mode the problem does not occur. Obviously the data transfer rate is much lower (one fifth).

-Silvio






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.