cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

Wellington
New Contributor

Hi,

my setup are FX3 slave fifo, dma auto mode.

I notice that on my host application, sometimes the Xferdata will return false due to timeout. By using Visual studio 2015 set breakpoint to observe why it time out, I found that the Xferdata did not fully grabbed my data and it failed(it only grabbed half of the data which is 4MB). However using Wireshark, i could see the data has fully send from FX3 thru USB3.0 on my PC host.

Things i tried:

Set the timeout to 10s for xferdata longer time to grab, but it still failed. (During this 10 second, I also observed from wireshark the full data packed  4194331 + 4194331 + 65563 - 3*27 has been sent) Xferdata will just wait 10 second do nothing and return false.

 

//Code explain

if (endPoint->XferData(buffer[1], rLen, 0))

{

//check package is fully grabbed? or return error.

}

else //timeout

{

 //debugging purpose

// check lens return value

}

 

From here we can see the lens return value will always less than < expected bytes. (Eventhough wireshark has shown data has been send from FX3)

 

Please let me know if you have any idea to this?

Thanks!

ZY

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator

Hello,

Please try using the test driver attached with this Solved: Win10 specific issue in data transfer from an FX3 ... - Cypress Developer Community  thread and let me know if it works.

Edited: The driver attached with the thread is not certified from Microsoft so to test with the driver you should put the PC in test mode - which will bypass certificate validation.

The same driver is attached in the thread you are pointing to

Regards,
Rashi

View solution in original post

0 Likes
10 Replies
Rashi_Vatsa
Moderator
Moderator

Hello,

From the attached image, I can see that more than 4 MB of data is requested from the device in a single transfer.

Please refer to GetXferSize API in CyApi Programmer's reference or  Xfersize() in CYUSB.NET programmer's reference which mentions maximum transfer size limit set into cyusb3.sys driver.

The reference guide for CyAPI.lib is available at C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\doc\SuiteUSB\CyAPI.pdf and the reference guide for CyUSB.dll is available at C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\doc\SuiteUSB\CyUSB.NET.pdf.

For Bulk transfers the limit is set to 4MB.

To transfer the whole frame you can transfer/requests chunks of 4 MB video data from the device.

Regards,
Rashi
0 Likes
Wellington
New Contributor

Hi Rashi,

There are more than 4mb of data being transfer at one time due to our full frame size is 2064x2048x2 = 8,454,144 bytes. Can we increase the Bulk transfers the limit more than 4Mb?

May i know the possible reason why Xferdata will timeout when we already received the full frame data?

 

Thanks!

0 Likes
Rashi_Vatsa
Moderator
Moderator

Hello,

There are more than 4mb of data being transfer at one time due to our full frame size is 2064x2048x2 = 8,454,144 bytes. Can we increase the Bulk transfers the limit more than 4Mb?

>> The 4 MB limit is set in the cyusb3.sys driver. The driver will drop the data exceeding the limit.

To receive the frame fully you can try requesting the frames in chunks by calling XferData multiple times in the host application.

Please let me know which cypress driver version are you using and the host PC configuration (like Win10 x64)

Regards,
Rashi
0 Likes
Wellington
New Contributor

Hi Rashi,

>> The 4 MB limit is set in the cyusb3.sys driver. The driver will drop the data exceeding the limit.

-> I only send one time Xferdata from my host application. I think FX3 will "somehow" auto pack the data for if more than 4MB. As you can refer to my wireshark log, I only send one Xferdata, it will auto return the full frame data for me by packing it as 4MB+4MB+remainder. The question is i do not understand the data is already return full data, the Xferdata sometimes will return false on this case.

I am using Window10 x64. Host Program Running in C++ environment.

 

Thanks

0 Likes
Wellington
New Contributor

Hi Rashi,

there are similar thread on this isssue.

https://community.cypress.com/t5/USB-Superspeed-Peripherals/BULK-OUT-transfer-failed-with-Error-Code...

 

Could you let me know how to build the driver my self to increase the BULK_IN size more than 4MB?

0 Likes
Rashi_Vatsa
Moderator
Moderator

Hello,

Please try using the test driver attached with this Solved: Win10 specific issue in data transfer from an FX3 ... - Cypress Developer Community  thread and let me know if it works.

Edited: The driver attached with the thread is not certified from Microsoft so to test with the driver you should put the PC in test mode - which will bypass certificate validation.

The same driver is attached in the thread you are pointing to

Regards,
Rashi

View solution in original post

0 Likes
Wellington
New Contributor

Hi,

Thanks for your suggestion. I have tried the driver, it is the same as current behavior now. Please refer to my attached wireshark pic.

The BULK in data are still grabbed using 4MB per transfer. We are expecting the new driver will transfer more than 4MB per transfer right?

 

Thanks

ZY

Could you let me know 

 

0 Likes
Rashi_Vatsa
Moderator
Moderator

Hello,

I understand with the new driver shared in this thread Solved: Win10 specific issue in data transfer from an FX3 ... - Cypress Developer Community  the results are same. Is that correct?

If yes, please let me know IRP USBD_STATUS of the transactions that you captured using Wireshark (in your attached picture)

Please find the attached snippet for reference

Regards,
Rashi
0 Likes
Rashi_Vatsa
Moderator
Moderator

Hello,

The driver attached with the thread is not certified from Microsoft so to test with the driver you should put the PC in test mode - which will bypass certificate validation.

Please check  the version of the driver that binds to the device to confirm if the driver is updated

Regards,
Rashi
0 Likes
Wellington
New Contributor

Hi Rashi,

Thanks for your help, I am able to update the driver by disable the digital signature on window. The timeout issue has been resolved where I could grab more than 4MB of data in one BULK transfer.

 

Thanks!

0 Likes