Fx3 hid example speed

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

cross mob
nich_4061921
Level 1
Level 1

Hi guys! Thanks a ton for your previous help, I have one more question.

Im currently sitting with the hid example, and are trying to reverse engineer it for a specific purpose, but have ran in to a brickwall.

Basically what I want is to decrease the time it takes between packages sent, in this example the curse rotation on the pc.

Trying to formulate the question in a few different ways to be as precise as possible:

Currently it sends the information at ca 400 packages (polls) per second, how do I increase that?

The mouse pointer rotation on a desktop is just under one second, how do I decrease that?

That is basically the same question but with different examples, mainly I need to tweak it to 2000 per second (known as polling rate in usb2) for what I'm trying to create

Hope you understand my point and thanks in advance  

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

In your firmware, the following API establishes USB connection to the Host:

CyU3PConnectState(CyTrue, CyFalse);

The second parameter when CyFalse, tells that the connection is going to be High Speed

If this is the case in your firmware, then you are operating in USB High Speed

The maximum bandwidth that you can get in High Speed over interrupt endpoint is 24MBps. (If in the Bits 11 and 12 of wMaxPacketSize, you mention that 2 additional packets are needed to be transferred in one microframe - please check Endpoint Descriptor Section of USB 2.0 Spec)

When the Host gets to know that Device can operate in Super Speed (from the BOS Descriptors), it displays the message showing - 'your device can operate at Higher Speeds'

I do not understand your comment - ' i get 1600-1900. thats only a marginal increase over usb2'

Please check the following:

1. As mentioned in the above comments - if CyU3PBusyWait(2000) is called in the firmware you can reduce it and test.

2. a. You can increase the payload size mentioned in wMaxPacketSize (if you are not already using 1024 bytes - max is 1024) and correspondingly change the value of the bytes committed using CyU3PDmaChannelCommitBuffer()

   b. Please also check what are the Bit 11 and 12 of wMaxPacketSize field in Endpoint Descriptor.

Please let me know if you have any questions.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
10 Replies
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

The last field of the Endpoint descriptor reports the servicing interval to the Host. For example, the endpoint descriptor in Mouse Demo example of FX3 SDK is as below:

pastedImage_0.png

As mentioned in the comments, 5 implies the servicing interval to be 2^(5-1): every 16 micro-frame period (which is 125uS), Host polls the endpoint. So, it would be 16*125uS = 2mS which means for one second it polls 500 times.

In your case, you can make the field as 3 which means servicing interval: 2^(3-1): every 4 micro-frames: every 4*125uS: 500uS. Host polls 2000 times for one second.

Is this what is required?

Regards,

Hemanth

Hemanth
0 Likes

That completely made sense! Thank you!

Though I'm still having a little issue in doing a "stress test"

The sample data, the data set that moves the mouse pointer, I have

increased it to 1000 entries from the 472

But I can't seem to change the rate they're "fired"

Example: I have 1000 data entries that makes up 2 circles

I have a data rate now of your example, 2000 "polls"

I want to have it completed in half a second (now it does so in just over

1.5-2 seconds)

I have been sweating with that (and the previous) for 1 week now and would

deeply appreciate if you could point out what I'm missing

Thanks in advance again!

lør. 30. mar. 2019 12.27 skrev HemanthR_06 <community-manager@cypress.com>:

<http://www.cypress.com>

Cypress Developer Community

<https://community.cypress.com/?et=watches.email.thread>

Fx3 hid example speed

reply from HemanthR_06

<https://community.cypress.com/people/HemanthR_06?et=watches.email.thread>

in USB Superspeed Peripherals - View the full discussion

<https://community.cypress.com/message/191564?et=watches.email.thread#191564>

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

You can try decreasing the value to 2 OR 1.

Regards,

Hemanth

Hemanth
0 Likes

I have, that's why I'm sure I'm missing a point somewhere, that each packet

still has a delay, because no matter how much I change that value, it

doesn't change the rate at which the dataset is sent

lør. 30. mar. 2019 17.46 skrev HemanthR_06 <community-manager@cypress.com>:

<http://www.cypress.com>

Cypress Developer Community

<https://community.cypress.com/?et=watches.email.thread>

Fx3 hid example speed

reply from HemanthR_06

<https://community.cypress.com/people/HemanthR_06?et=watches.email.thread>

in USB Superspeed Peripherals - View the full discussion

<https://community.cypress.com/message/191544?et=watches.email.thread#191544>

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Can you let me know if your device is High Speed/Super Speed? Can you also tell what is your Endpoint Descriptor (And Endpoint Companion Descriptor - if Super speed)

Regards,

Hemanth

Hemanth
0 Likes

Hello,

In the  CyFxHidSendReport() function, there is a delay function which gives a delay of 2 ms between every packet (CyU3PBusyWait(2000)).

Please reduce this delay appropriately and test. This should solve your problem!

0 Likes

Hi, sorry for the delay.

so i've narrowed my ssue down a bit, i did what you recommended decreased the servicing interval to 1, but for benchmarking purposes i've increased the report count to 8, in order to simulate an average usb2 device (mouse) and while i am able to get close to 2000 packets a second, i keep thinking that this cant be the fastest it can go, i get 1600-1900. thats only a marginal increase over usb2

0 Likes

Also, looking in windows, it says "this device can perform faster in connected to Usb3"

It even says that with the default build

0 Likes

Could it be that it's only using one of the two USB data pipes?

lør. 30. mar. 2019 17.55 skrev HemanthR_06 <community-manager@cypress.com>:

<http://www.cypress.com>

Cypress Developer Community

<https://community.cypress.com/?et=watches.email.thread>

Fx3 hid example speed

reply from HemanthR_06

<https://community.cypress.com/people/HemanthR_06?et=watches.email.thread>

in USB Superspeed Peripherals - View the full discussion

<https://community.cypress.com/message/191545?et=watches.email.thread#191545>

0 Likes
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

In your firmware, the following API establishes USB connection to the Host:

CyU3PConnectState(CyTrue, CyFalse);

The second parameter when CyFalse, tells that the connection is going to be High Speed

If this is the case in your firmware, then you are operating in USB High Speed

The maximum bandwidth that you can get in High Speed over interrupt endpoint is 24MBps. (If in the Bits 11 and 12 of wMaxPacketSize, you mention that 2 additional packets are needed to be transferred in one microframe - please check Endpoint Descriptor Section of USB 2.0 Spec)

When the Host gets to know that Device can operate in Super Speed (from the BOS Descriptors), it displays the message showing - 'your device can operate at Higher Speeds'

I do not understand your comment - ' i get 1600-1900. thats only a marginal increase over usb2'

Please check the following:

1. As mentioned in the above comments - if CyU3PBusyWait(2000) is called in the firmware you can reduce it and test.

2. a. You can increase the payload size mentioned in wMaxPacketSize (if you are not already using 1024 bytes - max is 1024) and correspondingly change the value of the bytes committed using CyU3PDmaChannelCommitBuffer()

   b. Please also check what are the Bit 11 and 12 of wMaxPacketSize field in Endpoint Descriptor.

Please let me know if you have any questions.

Regards,

Hemanth

Hemanth
0 Likes