Can't reach 13MBps with USB3.0 on Windows 10 and Pentium

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

cross mob
MaFa_974161
Level 5
Level 5
100 sign-ins 50 replies posted 50 questions asked

Hello.

I'm using FX3 and I firmware that setup Bulk EP.

I write c# software from

CyUSB.NET dll that get data from this Bulk EP via async method (beginXfer)

I test this software on differents machine and it's OK

but

when I use Intel(R) Penitum(R) CPU N3710 @ 1.6GHz with 4.00GB RAM

and Windows 10 Enterprise LTSC

I cant' reach 13MBps stable.

Data are 1024Byte packets generated at 13MBps from FPGA connected to FX3 via GPIF II

and

FX3 DMA is setup as 200 buffers capable of 1024Byte.

What I notice is that internal FX3 buffer sometimes overflows.

The problem is serious when I overload Pentium CPU.

Can someone help me ?

I watch CyUSB.NET sources from github

and I see that BeginXfer uses

IOCTL_ADAPT_SEND_NON_EP0_DIRECT

control code for DIRECT transfer (non buffered).

But the driver uses DMA when receive this IO control code ?

Greetings.

0 Likes
1 Solution
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

To increase the throughput, it is recommended to use larger and less DMA buffers than using multiple small DMA buffers.

Please refer to the section 7: Bulk Transfers in AN86947: optimizing USB 3.0 throughput with FX3.

Please use streamer application which is present in the FX3 SDK for checking the throughput. The streamer application will continuously stream IN/OUT data from the corresponding end point and measured the throughput.

Thanks,

Yatheesh

View solution in original post

0 Likes
15 Replies
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

To increase the throughput, it is recommended to use larger and less DMA buffers than using multiple small DMA buffers.

Please refer to the section 7: Bulk Transfers in AN86947: optimizing USB 3.0 throughput with FX3.

Please use streamer application which is present in the FX3 SDK for checking the throughput. The streamer application will continuously stream IN/OUT data from the corresponding end point and measured the throughput.

Thanks,

Yatheesh

0 Likes

Thankyou very much ...

but another question.

I have a situation where MBps can change from 2KBps to 20MBps by setting a register in the device.

The register set the pulse rate (PRF) and device outputs 1K per pulse, so MBps = PRF x 1kB.

Register's value can changed real-time and so MBps can change real-time.

The solution to Xfer large buffers works perfectly in high MBps

but when MBps decreases this mechanism fails ...

I don't know how to solve this problem.

0 Likes

Hello,

Can you please let me know to which register you are referring to in FX3? and are you referring to the USB bandwidth when you say Kbps to MBps?

Thanks,

Yatheesh

0 Likes

It's not a FX3 register.

I clarify my situation:

FX3 is connected to the FPGA by GPIFII.

FPGA acquire about 1024 samples (simplifying at 200MSps) periodically and sends this samples in a packet to the FX3 via GPIFII.

The period can vary from 640ms to 50us.

To change period the PC send command to FPGA by an EP that is mapped to a specific GPIF thread.

With 50us period I'm agree to use BeginXfer with large buffers to avoid lack of data,

but when period reduce to 640ms it's not good idea to use large buffers because I obtain big latency.

The problem is that user can varying this period real-time and I don't know how to match the two problems:

* low latency

* no lack of data

0 Likes

Hello,

If you are configuring FX3 as slave and FGPA as a master, you can use multiple DMA channels  through multiple sockets between the P-port and U-port whose access is controlled by the address lines.

When the period is changed, you can select a different socket on FX3 from the FGPA using the address lines and send the data to a different endpoint configured to your application requirements.

You can use the SlaveFifoSync5Bit example from the FX3 SDK as a reference.

Thanks,

Yatheesh

Ok, it's a solution that we will evaluate with the FPGA specialist.

But my colleague observed that when WaitForXfer timeouts (because transfer rate is slower than timeout)

if you call FinishDataXfer you read always 0 as LEN even if some packets are really transferred to xBuf.

Is there a way to retrieve LEN in this case ?

This will solve our problem because we can read how many packets are transferred.

0 Likes

Hello,

Please try using the recommended synchronous XferData API in place of Begin, Wait and FinishDataXfer , and also set the same timeout for the endpoint before calling the Xferdata function.

The len parameter of the Xferdata API will hold the actual data transmitted or received after the API returns. You can check the value of len if the Xferdata returns timeout error.

Thanks,

Yatheesh

0 Likes

OK...but there is no way to do this with Asynchronous method ?

0 Likes

Hello,

You can use the asynchronous method as well,  but it is better to use the synchronous method as mentioned in the CyUSB.NET.pdf  document. Also the actual number of transferred bytes can be obtained.

Thanks,

Yatheesh

0 Likes

OK.... but I want to use the same method for high MBps an Low MBps. In Low MBps Wait timeouts and FinishDataXfer returns LEN=0 even if some packets transferred

0 Likes

Hello,

You can confirm with the XferData if that also produces the same results?

Also, are you using a MANUAL or an AUTO DMA channel?

Best Regards,

Yatheesh

0 Likes

Yes, with synchronous XferData with 256x1024bytes the result is Len = Zero.

In FX3 I set DMA as 200 buffers large 1024bytes

"ADDED ..."

I use AUTO DMA, no CPU intervention

0 Likes

Hello,

Can you please check the return status of the XferData. You can check this using the UsbdStatus() and  UsbdStatusString () methods.

Refer to the C# example under the UsbdStatusString () method from the CyUSB.NET.pdf in FX3 SDK.

Alternatively you can capture Wireshark traces for the transfer.

Thanks,

Yatheesh

0 Likes

UsbdStatus in XferData is 0xC0010000

(0xC0010000 is USBD_STATUS_CANCELED,

The USB stack reports this error whenever it completed a transfer because of an AbortPipe request from the client driver)

I remember that FX3 DMA is configured as 200buffers x 1Kbyte (1 packet is 1Kbyte).

And I have this problem if I set Up Large Transfer buffers (for example 256 x 1Kbyte) in "BeginXfer" with 2000ms for TIMEOUT when packet rate is low (for example 2 packets per second).

I have to setup Large Buffer because when packet rate is High (1 packet every 50us) you can lost packets.

0 Likes

Hello,

Can you please send the snippet of the application code which includes the xferdata data call.

Also, please share the wireshark traces for the transfer.

Thanks,

Yatheesh

0 Likes