USB3.0- How to configure the slave fifo in firmware?

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

cross mob
Anonymous
Not applicable

 Hi,

   

I have read the document"Designing with the EZ-USB® FX3 Slave FIFO Interface".

   

It writes"Flags may be configured by EZ-USB FX3 firmware as empty, full, partially empty, or partially full signals. These are not

   

controlled by GPIF II states, but, rather, by the DMA hardware engine internal to FX3."

   

But in the fireware's API,I can't find any apis to config that.

   

Could you tell me how to config that?thank you.

0 Likes
2 Replies
Anonymous
Not applicable

Hi,

   

You can configure the flags of slave FX3 to indicate one of the following:

   

Current_thread_DMA_ready/Thread_0_DMA_ready/Thread_1_DMA_ready/Thread_2_DMA_ready/Thread_3_DMA_ready

   

Current_thread_DMA_watermark/Thread_0_DMA_watermark/Thread_1_DMA_watermark/Thread_2_DMA_watermark/Thread_3_DMA_watermark.

   

Current_thread_DMA_ready usage is as follows:

   

Let say FPGA is writing data to FX3. Then it will select the socket/thread by driving address on address lines. Then this Current_thread_DMA_ready indicates the status of the slected socket. Here FPGA is writing data into a producer socket. So this flag indicates whether the socket is free to accept data or not.

   

In case if FPGA wants to read data from FX3 then the same flag indicates the readyness of the active socket. Here in this case a Consumer socket. So it will be asserted if consumer socket has some data in it.

   

Thread_0_DMA_ready/Thread_1_DMA_ready/Thread_2_DMA_ready/Thread_3_DMA_ready - these are dedicated flags for the corresponding sockets/threads irrespective of the address lines.

   

All watermark flags can be set by using the API - CyU3PGpifSocketConfigure.

   

Thanks,

   

sai krishna.

Hi Sai,

I saw your answer to this thread and I have some specific questions regarding this Thread_0_DMA_ready.

I just started with FX-3 which i need to get a 8 bits data from a ZC-706 for example and then forward that to the PC via USB3.  I am following "Designing with the EZ-USB® FX3 Slave FIFO Interface" doc and try to modify that. I have looked on the State Machines and maybe you (or someone else) could clarify something for me?

1) Suppose I set FLAGA to GPIO_21 and the "DMA flag to use" as Current_Thread_DMA_Ready. If I am only using FLAG, there will be 2 sockets correct? Does that mean that the FPGA FW has to toggle the address line for FLAGA every time it has to send a 8 bit data packet on the "Databus"?

2) Is there any  place on my FX-3 "eg: StartApplication() method" that I need to reference this Current_Thread_DMA_Ready like checking when it is ready or not and then do some extra action based on that?

3) I saw on the example that it creates a DMA AUTO channel for the GPIF to the USB transfer. How I decide the correct "prodSckId" and "consSckId" to choose? As part of this setup, i decided to use CY_U3P_DMA_TYPE_AUTO.

4) Next, I start the DMA Channel with a specific transfer size.

5) Finally, we load, configure and start the GPIF state  machine.

     I understood the steps for load, configure and start. But how the "IN_DATA" action inside for example a state named "SAVE" works? How the data from IN_DATA is transferred to the socket/thread? I saw that you can configure for example the "IN_DATA" action and select "Data Sink" being Socket and "Thread Number" set a Thread0. But i don't know how that connects to my application C code.

Sorry for the long questions.

Maybe you or someone else can clarify those points for me please.

Thanks

rgrds

Marcos

 

0 Likes