Need help with XU208 bulk device and IO sampling
Posted: Mon May 22, 2017 9:11 am
I’ m using XU208 to implement a bulk transfer and IO sampling device, the simple block diagram is as following:
Test method
I use some FPGA codes to output sequence data to instead a real ADC chip, so that I can test the sampling clock easily.
App will save the bulk data as a binary file.
Then I use some C codes to verify the sequence data on PC side. If non-sequence data has been found, C code will tell.
How to implement this bulk transfer, IO sampling device?
There are 3 threads on XU208 device (not include USB device manager thread and Endpoint0 thread).
Thread A: USB bulk transfer thread (For bulk endpoint), transfer data to USB device manager thread.
Thread B: Data handling thread, transfer data to A by transferring movable pointer.
Thread C: IO sampling thread, IO sampling and transfer data to B (use unsafe pointer to share memory with B).
Summary for this issue
1. If I generate sequence data in Thread C but not sample IO from FPGA. I can get correct data back no matter what frequency the sampling clock is.
2. Or the max sampling clock only can be 6.25MHz.
3. I had tried using the channel type to exchange between Thread B and C, but no improvement, and after I used unsafe pointer to exchange data between
Thread B and C, I think it isn’t the bottleneck anymore, but I still can’t make the sampling clock > 6.25MHz.
I felt confused about this and I don’t know what to do next, also I’m not sure what I wrote is simple and clear enough but I really need some help.
Any idea will be appreciated.
Attached please find my project if you are interested in it.
But for now, the sampling clock can only up to 6.25MHz. Any clock > 6.25MHz will return wrong data from XU208.Test method
I use some FPGA codes to output sequence data to instead a real ADC chip, so that I can test the sampling clock easily.
App will save the bulk data as a binary file.
Then I use some C codes to verify the sequence data on PC side. If non-sequence data has been found, C code will tell.
How to implement this bulk transfer, IO sampling device?
There are 3 threads on XU208 device (not include USB device manager thread and Endpoint0 thread).
Thread A: USB bulk transfer thread (For bulk endpoint), transfer data to USB device manager thread.
Thread B: Data handling thread, transfer data to A by transferring movable pointer.
Thread C: IO sampling thread, IO sampling and transfer data to B (use unsafe pointer to share memory with B).
Summary for this issue
1. If I generate sequence data in Thread C but not sample IO from FPGA. I can get correct data back no matter what frequency the sampling clock is.
2. Or the max sampling clock only can be 6.25MHz.
3. I had tried using the channel type to exchange between Thread B and C, but no improvement, and after I used unsafe pointer to exchange data between
Thread B and C, I think it isn’t the bottleneck anymore, but I still can’t make the sampling clock > 6.25MHz.
I felt confused about this and I don’t know what to do next, also I’m not sure what I wrote is simple and clear enough but I really need some help.
Any idea will be appreciated.
Attached please find my project if you are interested in it.