Two FX3 connection send two Frame Request at same time will caused one of the Xferdata receive 0 data

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

cross mob
Wellington
Level 4
Level 4
100 sign-ins 50 sign-ins 25 replies posted

Hi, We having trouble to receive frame when send two Frame Request two endpoint simultaneously. We are using window10 64x, CyAPI library.

I am connecting HX3PD EVP board to two FX3

DS4 to FX3_1

DS5 to FX3_2

we set device count 1, endpoint1 to be FX3_1

then device count 2, endpoint2 to be FX3_2

1.) The code below Works, however this is not our use case. We are required to send two Frame request from two different endpoint then only received two data from two different endpoint

Send first frame request using endpoint1 then receive using endpoint1

Send 2nd frame request using endpoint2 then receive using endpoint2
succeedsendA = true
succeedsendB  = true
succeedReceivedA = true
succeedReceivedB = true

Wellington_0-1662107085437.png

 

2.) Our Actual use case: The code below result be

succeedsendA = true
succeedsendB  = true
succeedReceivedA = true
succeedReceivedB = false

Wellington_1-1662107265318.png

3.) The code below result be

succeedsendA = true
succeedsendB  = true
succeedReceivedA = true
succeedReceivedB = false

Wellington_2-1662107499312.png

 

We tried with different combination, it always result "endPointX->XferData(VideobufferX[currentFrame], rLenX)" will only succeed get data if it is placed before ControlEndPointExecuteCommand();

May i know how can i send two Frame request with endpoint1 and endpoint2 then only receive the data of either endpoint1 and endpoint2 simultaneously?

 

Thanks







Attached the ControlEndPointExecuteCommand() as reference

Wellington_4-1662107802206.png

Wellington_5-1662107835149.png

 

 

 

0 Likes
1 Solution

Hello,

If xferdata is used one after the other, then you will not be able to perform simultaneous data transfers.

Instead, you can try to create 2 threads in your host application. And then call xferdata for each device in individual threads. We currently do not have any reference examples to share. But, you can test this approach and let us know if it helps.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
8 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Can you please let me know why you want to use "endPointX->XferData(VideobufferX[currentFrame], rLenX)" after ControlEndPointExecuteCommand()? 

This is because, from the definition of ControlEndPointExecuteCommand(), I understood that it is just a vendor command that transmits zero byte to the device (it could be a command to initiate or terminate the data transfer). Then, you can perform the data transfer soon after ControlEndPointExecuteCommand() is called for a particular device as you have done in the first case. This can be followed by the same sequence for the second device. Please let me know why this option is not the one of interest for you.

Also, what exactly is rLenx?

In addition to this, can you please connect both the FX3 devices to 2 different USB ports on the same PC and check if the same issue occurs with this setup too? This will help us to understand if the problem is related to HX3PD or not.

Best Regards,
Jayakrishna
0 Likes

rlens is our expected frame size which is 4096x2304x2

endPoint->XferData(Videobuffer1[currentFrame], rLen, 0)

we also monitor the return bytes from rLens after getting 
This is our working FX3 code for this potion:

Wellington_0-1662110156791.png

 

The reason why we doing two Frame request at same time is because want to utilize the HX3PD 10Gbps speed/bandwith. Since FX3 only support 5Gbps, so two FX3 return the frame should be can fully utilize HX3PD (5Gbps+5Gbps = 10Gbps). 
Do let us know if our testing method is invalid?

Thanks

 

0 Likes

Hello,

xferdata () is a blocking API. It will return only if the intended amount of data is received/short packet is received/an error occurred. So, you will not be able to read simultaneously from 2 FX3 devices by using 2 xferdata () calls one after the other.

Best Regards,
Jayakrishna
0 Likes

Hello Jayakrishna,

Thanks for your clarification, is there other way to read simultaneously from 2 FX3 devices by using 2 xferdata () calls one after the other?

Thanks

0 Likes

we would like to test this theory based on this description,

https://community.infineon.com/t5/USB-superspeed-peripherals/Multiple-FX3-into-Gen2-HUB/m-p/185253
so setting two Frame request at same time and receiving both frame at same time is our assumption to test this out.

Let us know if the assumption is correct?

0 Likes

Hello,

If xferdata is used one after the other, then you will not be able to perform simultaneous data transfers.

Instead, you can try to create 2 threads in your host application. And then call xferdata for each device in individual threads. We currently do not have any reference examples to share. But, you can test this approach and let us know if it helps.

Best Regards,
Jayakrishna
0 Likes

Hi Jayakrishna,

Just tested your suggestion and it did working. just use the std::thread will do. then t1.join() wait the thread end.

 

Thanks

0 Likes

Hello,

We are glad to hear that our suggestion helped to meet your requirement. 

Best Regards,
Jayakrishna
0 Likes