cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

AsMa_4627666
New Contributor

Hi,

I'm using Cypress FX3 DVK in my design and CyUSB DLLs are used for USB communication.

For sending data from host to device bulk out transfer will be used and bulk in for receive data to the host.

some times bulk in transfer returns empty buffer. When I check for USB logger bulk out command is sent out and the respective bulk in data also received as a valid buffer all the time but in my application layer, I am getting as an empty buffer. If some delay is added between write and read function I am getting data properly to the application but it is not consistent. The below image is the sample code let me know if I'm missing something.

pastedImage_4.png

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator

Hello,

Please confirm that you are sending command data from BULK OUT endpoint and read the response using BULK IN endpoint everytime.

Instead of using two if conditions, you can try merging the if conditions i.e. after sending the BULK OUT command, you can check the retvalue in the same if condition and then send the response through BULK IN endpoint.

Also, please use two different buffers for sending command and reading response. There is no need of initializing the buffer for sending response every time.

Please try the above suggestions and let me know the result.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
14 Replies
JayakrishnaT_76
Moderator
Moderator

Hello,

Please let me know which application firmware you are using to perform data transfer between the device and host.

Please remove the third parameter in the XferData API and let me know the result.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
AsMa_4627666
New Contributor

Hi,

Thanks for the reply.

I"m using CyFxBulkSrcSnktest application but modified as per my requirement, after considering the third parameter as false I'm still seeing the issue.

pastedImage_0.png

even after removing the third parameter im seeing the same issue.

pastedImage_2.png

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

Please try using Control center application and let me know if you are facing the same issue. This can be used to understand if the problem is related to your application or not.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
AsMa_4627666
New Contributor

Hi, I have used the control center to send the byte data but in control center, there will be a time delay between Transfer Data-Out and Transfer Data-In since in the control center UI, the user has to select the out endpoint and then click on the Transfer Data-Out button

pastedImage_1.png

and then select In endpoint and click on the Transfer Data -IN button to read data,

pastedImage_0.png

Using the control center there will be a delay between transferring and receiving data. But in the application, I have not given any delay since this is a blocking call. So when I transfer some bytes from the Out-EndPoint and receive the response at In-Endpoint approx 50th time there won't be any data in the In-EndPoint (Note number 50th is approx sometime it will be 30th time or 80th time). When I used USB analyzer and Lecroy to check the data transfer I understood that data will be received till the Host PC from the Fx3 but not to the In-EndPoint in the application.

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

Please let me know the following:

1. Please let me know which OS and driver version you are using?

2. What is the size of data which the host should read from FX3 through the IN point?

3. By empty buffer, do you mean that the parameter buffCnt is 0?

Please share the complete source code for the application so that we can debug this issue on our end.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
AsMa_4627666
New Contributor

1. Please let me know which OS and driver version you are using?

     - Windows 10 8th Gen Intel PC, DriverVer=08/21/2014,1.2.3.10

2. What is the size of data which the host should read from FX3 through the IN point?

     - 512 bytes from the Fx3

3. By empty buffer, do you mean that the parameter buffet is 0?

     - Yes, the buff Count will be 0. and return value will be false.

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

Please try using the latest driver which comes along with FX3 SDK. You can download the latest SDK from the link given below:

https://www.cypress.com/documentation/software-and-drivers/ez-usb-fx3-software-development-kit

Also, please use the library from the latest SDK.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
AsMa_4627666
New Contributor

Hi Jayakrishna,

I update the drivers. still, I'm seeing the issue.

pastedImage_0.png

The left side of the image is part of my code where I'm running in debug mode and the right side is the USB analyzer. Here you can see the data is reached the USB analyzer but in the application, buffer data is all zero and buffer size is 512.

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

Please share the source code for the application so that I can debug the issue and let you know the problem.

In the meanwhile, please make use of 2 different buffers for OUT and IN transfers and do not initialize the buffers more than once.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
AsMa_4627666
New Contributor

for writing and read the data this is the code.

pastedImage_0.png

This will the initial configuration when Fx3 is detected.pastedImage_1.png

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

Please confirm that you are sending command data from BULK OUT endpoint and read the response using BULK IN endpoint everytime.

Instead of using two if conditions, you can try merging the if conditions i.e. after sending the BULK OUT command, you can check the retvalue in the same if condition and then send the response through BULK IN endpoint.

Also, please use two different buffers for sending command and reading response. There is no need of initializing the buffer for sending response every time.

Please try the above suggestions and let me know the result.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
AsMa_4627666
New Contributor

Hi,

Please confirm that you are sending command data from BULK OUT endpoint and read the response using BULK IN endpoint everytime.

     - Yes im sending data from BULK OUT and Reading response from BULK IN. If not i wont get any data from the Fx3.

Instead of using two if conditions, you can try merging the if conditions i.e. after sending the BULK OUT command, you can check the retvalue in the same if condition and then send the response through BULK IN endpoint.

Also, please use two different buffers for sending command and reading response. There is no need of initializing the buffer for sending response every time.

     - I'm using the different buffers for IN and OUT data transfer and

     - Does the BUFFER SIZE and BUFFER COUNT is need to be same? I'm taking care of this also.

     - If the Write BUFFER is True then I'm entring to Read BUFFER.

0 Likes
JayakrishnaT_76
Moderator
Moderator

Hello,

Please let me know if you tried implementing my suggestion in response 11? If you tried implementing the suggestion, what was the observation?

Regarding your query on buffer size and buffer count, it need not be same.

Also, please share the source code of the application and your firmware so that we can try reproducing this issue on our end and solve it.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
AsMa_4627666
New Contributor

I need some time to create small application and I ahve Firmware team develop a Fimware for this perticular task.Ill get back to you soon. Thanks

0 Likes