cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

JaRo_4664191
New Contributor II

Hi,

I have an FX3 with a U2P DMA bulk channel with 2 buffers (16KB) each. The FX3 is used as a bridge between the host (PC) and an FPGA.

For this test, I'm sending packets of 2KB and I would like the FX3 to forward the data to the FPGA as soon as this packet arrives (it may take some time until a new packet arrives). However, I see that I need to fill the buffer (send 8 packets) before any data is moved to the FPGA.

I'm using usblib as the driver for the USB interface, and I'm wondering if there is anything at the FX3 side to achieve this functionality. It seems that with non-multiples of the packet size (1KB) this does not happen.

Any suggestion is welcome.

Kind regards

0 Likes
1 Solution
wuHa_1344001
New Contributor II

Because the DMA buffer is 16KB, you send 2KB from Host to FX3, FX3's DMA engine consider the data is not enough to push to P-port, so DMA engine wait the dma buffer is full as you see "8-package data" was need additionaly.

You could send a zero-package after 2KB, and DMA engine consider the data is a-short package, and not wait DMA buffer is full, push the data to p-port immediately.

^_^

View solution in original post

0 Likes
3 Replies
wuHa_1344001
New Contributor II

Because the DMA buffer is 16KB, you send 2KB from Host to FX3, FX3's DMA engine consider the data is not enough to push to P-port, so DMA engine wait the dma buffer is full as you see "8-package data" was need additionaly.

You could send a zero-package after 2KB, and DMA engine consider the data is a-short package, and not wait DMA buffer is full, push the data to p-port immediately.

^_^

View solution in original post

0 Likes
JaRo_4664191
New Contributor II

hi,

Thanks for the reply and to confirm the behaviour. I'm looking at libusb to see if that's something known. Your second suggestion does not work for us unfortunately since that would drop the USB throughput too much (I've followed the AN to optimize the USB data bandwidth for the current configuration).

Kind regards

0 Likes
wuHa_1344001
New Contributor II

A effective way to solve the problem is set DMA_Size is 1KB (equal a standard package of USB3.0), and DMA's Buffer count is 16.

The effectiveness of transfer is not high as your current setting. But can avoid the problem.

The second way to avoid your problem is "set DMA_Size is 2KB" and "DMA's Buffer count is 8".

0 Likes