The proper way to get FLAGA status (SlaveFifoSync) in controller's firmware code

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

cross mob
DeSa_1285516
Level 1
Level 1
5 replies posted 5 sign-ins 5 likes given

In our project we use CYUSB3014 to transfer data from DAQ through FPGA to PC.

For this purpose we use SlaveFifoSync mode (as described in AN65974).

Before reading data from usb controller I would like to check if the DMA buffer is full.

I would like to check it by getting the value of FLAGA (which is GPIO21 according to AN65974). I intend to do this with the special setup (control) request from the PC. This request will be processed in CyFxSlFifoApplnUSBSetupCB function of cyfxslfifosync.c

But how can I get the status of FPGA (GPIO21) in the controller's firmware C code?

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

From the description, I understand that you want to check if the status of DMA buffers on receiving a control request from the host. Is my understanding correct?

If MANUAL DMA channel is used, you can check the status of the DMA buffer (using input->buffer_p.count)  in the CyFxSlFifoPtoUDmaCallback before committing the DMA buffer to USB socket.

 

Please let me know if any queries on this.

Regards,
Rashi

View solution in original post

5 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello,

From the description, I understand that you want to check if the status of DMA buffers on receiving a control request from the host. Is my understanding correct?

If MANUAL DMA channel is used, you can check the status of the DMA buffer (using input->buffer_p.count)  in the CyFxSlFifoPtoUDmaCallback before committing the DMA buffer to USB socket.

 

Please let me know if any queries on this.

Regards,
Rashi

Rashi, I would like to check the status (full or not) of DMA buffer from PC (!), not from controller.

So, I would like to fill the control endpoint of the controller when it receive the special control

command from PC and then read this endpoint from PC.

PC program need this information to get ready to receive the data from DAQ.

0 Likes

Hello,

Understood.

As mentioned in previous response, you can store the status of DMA buffer ((using input->buffer_p.count in DMA callback) in a global variable.

On receiving the request from host, the value of the global variable can be sent via control endpoint.

Regards,
Rashi

Thank you.

In FX2 we have EP2468STAT register which contains the status of the full buffer flag.

I believed that FX3 has a similar register.

0 Likes

Hello,

Please let us know if the suggestion was helpful

Regards,
Rashi
0 Likes