How to empty GPIF FIFOs from CY chip?

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

cross mob
Anonymous
Not applicable

Hi,

   

I am using slave fifo GPIF II. I would like to be able to discard (delete) the content of the GPIF FIFOs from CYUSB3014.  I am using the "CyU3PUsbFlushEp" for both the producer and consumer. But the FIFOs stay unempty! How can I do this?

   

Thanks,

   

Nazila

0 Likes
6 Replies
Anonymous
Not applicable

Hi Nazila,

Try the DMA API, i.e. CyU3PDmaChannelReset() or CyU3PDmaChannelDestroy().

Regards,
Steve

0 Likes
Anonymous
Not applicable

Hi Steve,

   

Thanks, I did but it makes the Cy go to hault. I have four endpoints (two interrupts and two bulks) and I want to reset the GPIF 's FIFOs (bulk endpoints). After executing the reset channel commands, if I send a bulk data to the producer of the GPIF, then I cannot send or receive anymore data through any of the endpoints (even the interrupt ones).

   

Thanks,

   

Nazila

0 Likes
LiMa_282146
Level 4
Level 4
First like given

Nazila,

   

If you reset or destroy the channels you have to create them again before they can be used. Have you tried this?

   

Sodafarl

0 Likes
Anonymous
Not applicable

Hi Sodafarl,

   

I used the "Start" and "Stop" functions which is being used to create all endpoints, channels,... at the begining of the downloading the firmware. Still it goes to hault!

   

After the "Stop" and "Start" functions I immediately send an acknowlegement through the interrupt endpoint IN. Should i put a wait before doing that?Can this be the problem?

   

Thanks,

   

Nazila

0 Likes
LiMa_282146
Level 4
Level 4
First like given

Hi Nazila,

   

I clear the data out of the endpoints by reseting the DMA channels then creating the DMA channels and finish by flushing the endpoints. I have a seperate function for creating the channels but I can't see anything wrong with using the 'Stop' and 'Start' functions provided in the fimrware. Maybe you can't reconfigure endpoints if they are being used - that is the only difference I can see between the 'Stop' and 'Start' function and my code for creating the DMA channels.

   

Sodafarl

0 Likes
Anonymous
Not applicable

Hi,

   

You were right! I called the stop and start functions from one of the DMA's call back funtions. I wrote another function which only reset/destroy and then create the GPIF related endpoints/channels and now it is working! 🙂

   

Thanks,

   

Nazila

0 Likes