Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Get DMA status,busy or idle

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



Get DMA status,busy or idle
Moderator:
RSKV

Post Reply
Follow this topic



Get DMA status,busy or idle

Ayi posted on 22 Nov 2012 1:10 AM PST
Top Contributor
23 Forum Posts

 Hello everyone 

The issue as follows:

Develop with SDKv1.2. 

I want to transfer data by USB3.0 with DMA mode. I create 3 DMA chanels.and two for data transfer the third for command transfer.

As we know just one DMA channel can work at the same time.But I want to transfer command during data transfer.Data transfer is not continue.So I want to transfer command in data transmission interval. So the DMA for command transfer must be CY_U3P_DMA_TYPE_MANUAL mode .Before command transfer I should check if other two DMA channels are busy or idle.

Is there any function to get the DMA status .Does somebody get me an sample .And does my scheme word?

thanks

ayi 




Re: Get DMA status,busy or idle

Lumpi6 posted on 22 Nov 2012 06:20 AM PST
Top Contributor
183 Forum Posts

Hi Ayi,

check the function "CyU3PDmaChannelGetStatus" and compare the producer and consumer counts. If they are eqal, no data is in  progress.

 

Why are you no using the control channel EP0? There you do not have to check if data is in progress. I think you also do not have to check if any data is in progress while you like to send control transfers. The dma should be connected to different sockets and they are connected to different endpoints. So the endpoint work for user like parallel.

If I may not understand you right then I am sorry, please try a exactlier explanation.

regards,

lumpi



Re: Get DMA status,busy or idle

Ayi posted on 22 Nov 2012 05:55 PM PST
Top Contributor
23 Forum Posts

 Hi lumpi 

Thanks for your replay.

>check the function "CyU3PDmaChannelGetStatus" and compare the producer and consumer counts. If they are >eqal, no data is in  progress.

 I know the function "CyU3PDmaChannelGetStatus".But I think there is no "IDLE" with return value .And what the mean "compare the producer and consumer counts"? And how to compare?

 

 

>Why are you no using the control channel EP0? There you do not have to check if data is in progress. I think you >also do not have to check if any data is in progress while you like to send control transfers. The dma should be >connected to different sockets and they are connected to different endpoints. So the endpoint work for user like >parallel.

I use 3 DMA channel :U1-->P1  P1-->U1 and U2-->P2.And after the channels is created the socket address is fixed . So I think  the endpoint work for user not like parallel. When  the" U1-->P1 "channel is used  I want to send command(the command shouled be send by GPIF to external device :FPGA ,the command is not like the vender request,the command can be understand as data transfer ) by "U2-->P2"channel .I just think of the GPIF interface can't be share.

 

Besr regard

ayi

 

 



Re: Get DMA status,busy or idle

Lumpi6 posted on 23 Nov 2012 05:01 AM PST
Top Contributor
183 Forum Posts

Hi Ayi

>check the function "CyU3PDmaChannelGetStatus" and compare the producer and consumer counts. If they are >eqal, no data is in  progress.

 I know the function "CyU3PDmaChannelGetStatus".But I think there is no "IDLE" with return value .And what the mean "compare the producer and consumer counts"? And how to compare?

 

If you compare these counts you can see if any data is in progress. If producer count is higher than consumer count, then consumer has data left to transmit. If both counts are the same, then no data is in progress and there is no transmission ongoing.

 

>Why are you no using the control channel EP0? There you do not have to check if data is in progress. I think you >also do not have to check if any data is in progress while you like to send control transfers. The dma should be >connected to different sockets and they are connected to different endpoints. So the endpoint work for user like >parallel.

I use 3 DMA channel :U1-->P1  P1-->U1 and U2-->P2.And after the channels is created the socket address is fixed . So I think  the endpoint work for user not like parallel. When  the" U1-->P1 "channel is used  I want to send command(the command shouled be send by GPIF to external device :FPGA ,the command is not like the vender request,the command can be understand as data transfer ) by "U2-->P2"channel .I just think of the GPIF interface can't be share.

Ok, in this the interface truely can not be shared. You may also can check the DMA callback functions. They notify may be some DMA event you need to do y

 

regards,

 

lumpi



Re: Get DMA status,busy or idle

cityhunterlyf posted on 25 Nov 2012 06:05 PM PST

1 Forum Post

 Can I use uart or i2c  port  to communicate with FPGA? FX3 receive control data from ep0,and translate control data,then communicate with fpga through uart or i2c port?



Re: Get DMA status,busy or idle

Ayi posted on 25 Nov 2012 07:02 PM PST
Top Contributor
23 Forum Posts

Hi cityhunterlyf 

I2C should be work .Othe project used before ,But if I use I2C to transfer command the FPGA GPIF  RTL must be rewrite.  

 

regaed

ayi



Re: Get DMA status,busy or idle

Lumpi6 posted on 26 Nov 2012 10:58 PM PST
Top Contributor
183 Forum Posts

Hi cityhunterlyf,

you can also use the UART port to communicate with the FPGA. That is a bit faster than the I2C port. It is a pitty that you can not use the really fast SPI port while you are using GPIF II in 32-bit mode.

regards,

lumpi






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.