FLAG takes too many time to go back to high

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,everyone!

I am developing FX3(CY3014) +FPGA(altera) to upload counter(do not stop ) data to PC。 FPGA logic consists of counter (1M CLOCK, 32bit BUS) +FIFO +USB interface module。My USB interface and FX3 firmware is  using the application notes AN65974 。I use the streamer mode 's  firmware and logic ( I added counter and FIFO ). PC software is the streamer application in the  SDK.

Now, I have a  serious problem  to upload counter data. I find that ,after one bulk transfer (16kB ), flagA (indicates the up Endpoint  DMA ready)   takes too many time (about several hundred microsecond )to go back to high . During the time , counter generate so many data that make the FIFO full ,thus the PC can not receive continuous  counter data, some time the software just stuck without writing any more data to file.

The software just use the streamer application in the SDK, I just modify it  to write to disk after transfer enough data.

The attachment is the code that I modified to write data to disk file. It is part of "XferLoop" function of streamer application.

How can I solve this problem?

  

  

Regards,

wjm@USTC

0 Likes
6 Replies
ManaskantD_51
Employee
Employee
Welcome! 25 solutions authored 10 solutions authored

There is a few micoseconds delay once the FX3 buffer is Full. That is why SlaveFIFO interface makes use of flags so that you dont lose data.

Also, Please create a separate thread for writing into a file. Keep this thread only to stream data.

0 Likes
Anonymous
Not applicable

In Fact, streamer app  creates a new thread for stream data.

But,in my  system , after  FX3 buffer  is full , it takes several hundred micoseconds delay  instead of  a few microseconds!

0 Likes

But you are writing data and streaming data in the same thread. Your data write process will be slow which will not allow the USB transfers to request fast because of which your FX3 buffers are not drained out.

Try commenting out the write part in your code and see whether your flags are still low for several hundreds of microseconds.

0 Likes
Anonymous
Not applicable

I  deleted  the write part.  but  flagA Still low for several hundreds of microseconds.

0 Likes

What is the throughput you are getting?

0 Likes
Anonymous
Not applicable

Theoretically , 32bit Counter @ 1Mhz CLOCK  will have a throughout of 4MB/s

But, the streamer just display a result of 2400KB/S , that's why I thought  the upload data is not continuous.

0 Likes