- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I deleted the write part. but flagA Still low for several hundreds of microseconds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the throughput you are getting?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.