Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > GPIF state machine DMA_RDY_THx, DMA_WM_THx flags not correct during buffer switching or after commit?

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



GPIF state machine DMA_RDY_THx, DMA_WM_THx flags not correct during buffer switching or after commit?
Moderator:
RSKV

Post Reply
Follow this topic



GPIF state machine DMA_RDY_THx, DMA_WM_THx flags not correct during buffer switching or after commit?

PicoPete posted on 19 Oct 2012 7:00 AM PST
Member
8 Forum Posts

I have a state machine transferring GPIF to USB. The transition from my wait state is defined as DMA_RDY_THx&!BUSY where busy is a pin on the external interface to indicate if there is data ready, I then read this data until WM, read the rest of the packet and then transfer back to the wait state, the usb packet is sent.

If I get back to the wait state and there is no data ready on my external interface then it waits a while and transitions when !BUSY and everything works fine. If it gets back to the wait state and the interface is already !BUSY then some data is lost (transferred over the GPIF but not transferred over the USB). The only conclusion I can draw from this is that the DMA_RDY and DMA _WM flags are not correct when I am in my wait state? AN65974 indicates that there is a 3 cycle latency of the DMA _RDY flag but insertting a dummy state with considerably more wait than this does not fix the problem. This also seems to be true if I do a commit of a shorter packet and then transfer to the wait state.

I can only think that this might be that the DMA flags are not valid during DMA buffer switching? Is there a way that I can detect the buffers are switching from my state machine?




Re: GPIF state machine DMA_RDY_THx, DMA_WM_THx flags not correct during buffer switching or after commit?

RSKV posted on 20 Oct 2012 02:31 AM PST
Cypress Employee
655 Forum Posts

I think you can know the end of the buffer using two actions:

LD_DATA_COUNT and COUNT_DATA.

You can load the count as your buffer size and you can look for DATA_CNT_HIT.

Thanks,

sai krishna.



Re: GPIF state machine DMA_RDY_THx, DMA_WM_THx flags not correct during buffer switching or after commit?

PicoPete posted on 20 Oct 2012 01:38 PM PST
Member
8 Forum Posts

Hi Sai,

My issue is not finding the end of a buffer, I can do this happily with WM or Count as you suggest, the problem is that not all of the data transferred over the GPIF is transferred over USB (I am transferring packet at a time over GPIF). The only explanation I can come up with at the moment is that the DMA buffer is not ready to receive data and so the data transferred over the GPIF is not read into a buffer, the only way this can happen from my state machine is if the DMA _RDY and DMA _WM flags are incorrect directly after a buffer is commited to USB. So, are there any conditions under which the RDY or WM flags are incorrect or invalid?

Pete



Re: GPIF state machine DMA_RDY_THx, DMA_WM_THx flags not correct during buffer switching or after commit?

AssemblyRequired posted on 22 Oct 2012 06:09 AM PST
Top Contributor
37 Forum Posts

By any chance are your USB transfers high-bandwidth isochronous? 



Re: GPIF state machine DMA_RDY_THx, DMA_WM_THx flags not correct during buffer switching or after commit?

PicoPete posted on 22 Oct 2012 07:46 AM PST
Member
8 Forum Posts

Hi Steve, my'n are all bulk transfers and actually on some more work today the problem doesn't seem to be as bad, it just seems that the WM flag is not ready directly after starting my GPIF waveform which seems to be solved by inserting a dummy state that repeats 30 times?! I'd still like to understand all of the conditions that these flags might not be valid as I can see this problem rearing its head in the future.






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.