FinishDataXfer() fail

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

cross mob
lock attach
Attachments are accessible only for community members.
Zenith
Level 3
Level 3
5 questions asked 100 sign-ins 25 replies posted

I am developing real-time data transmission using fx3 (USB\VID_04B4&PID_00F3).

 

The number of modules is a system that receives data at the same time using 7 to 8 modules.

But
Errors often occur in FinishDataXfer(), and the error codes are as

The source is roughly as follows. follows:
lease check the attached file for the approximate source and situation.

 

0 Likes
1 Solution
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

To summarize:

1. Streaming by directly connecting multiple FX3 with PC works fine.

2. Streaming by connecting multiple FX3 with CY4601 (HX3) and then PC works fine.

3. Streaming by connecting multiple FX3 with HX3 on a custom board, fails.

Am I right? If yes, this points to an issue on your custom board specifically and not on the FX3 firmware.

Best Regards,
AliAsgar

View solution in original post

0 Likes
37 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

We have never encountered the error code of 3073 before. We do not know what it corresponds to.

Could you let us know what your application firmware is? If it is a continuous streaming kind, can you test with the Streamer host application provided in the EZ-USB FX3 SDK and let us know if the issue is seen?

Can you please share your host application with us to try to reproduce the issue you are facing?

Best Regards,
AliAsgar

0 Likes
Zenith
Level 3
Level 3
5 questions asked 100 sign-ins 25 replies posted

Hello.

At first, I used v1.2.3.34, but I am testing by finding v1.24.0 and v 1.3.0.3.
Drugs If you have a recent driver, please provide it.

For reference, we are using Windows 10 1809_LTSC version.

I'll try the streamer test.

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Thank you for the information on the USB drivers bound to FX3.

Could you share with us the FX3 firmware and Windows host application used for transferring data with us?

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hello.

Usbfirmware file attached.

Unfortunately, the application is not in a testable form for you.
This is an application that requires our daq board.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Sorry for the miscommunication. I meant could you share the FX3 firmware source project and the host application source.

Best Regards,
AliAsgar

 

0 Likes
lock attach
Attachments are accessible only for community members.

Hi.

I have attached the file below.

1. usb firmware file
2. Read thread : A brief summary..

Thank you,.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Please try transferring data from the Cypress Control Center and let me know what issue is seen.

If the transfer fails with error 997, it means there is a timeout.

Make sure the FPGA is driving signals as per the interface definition of the GPIF 2 Designer.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hello.

Additional test results are attached.

1. "If the transfer fails with error 997, it means there is a timeout."

  - If no data is coming in.
  - Isn't it filtered in the WaitForXfer(&inOvLap[i], 3000)) function?

Thank you .

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Yes, you are right the timeout error occurs when the WaitForXfer fails.

I just want to check what error comes up in the control center when you are trying to transfer data to/from FX3. Could you please perform this test and let us know if transfers are happening successfully using control center.

Best Regards,
AliAsgar 

0 Likes

Hello.

If an error occurs, the corresponding equipment is not visible in the control center.
So I can't do any tests.

0 Likes
Zenith
Level 3
Level 3
5 questions asked 100 sign-ins 25 replies posted

Please correct any incorrect information in the previous post.

The error code I received is 997 not 3073.
Sorry for the confusion.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Error code 997 denotes a timeout. This usually occurs when hosts asks for data, but the device does not have data to transfer.

Please do the following changes for debug:

Change the DMA channel from AUTO to MANUAL channel and register for DMA callback. Count the number of PROD and CONS events in the DMA callback and print it in the thread loop and share the prints with us.

Please check the UsbBulkLoopManual default firmware example for reference.

Best Regards,
AliAsgar 

0 Likes

Dear AliAsgar.

Thank you for your support.

1.How do I do debugging printing?

2.  when does the device disappear from the control center?

   - It appears only after rebooting the pc.

 

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I see that the code inside the CyFxSlFifoApplnDebugInit() API is commented out. Uncommenting this code will enable debug prints and CyU3PDebugPrint () API can then be used to get the debug prints. Is there any particular reason why the code was commented out?

Device disappears from the Control Center if device enumeration has issues. The UART debug prints will give help us get the reason of why the device disappears from the control center.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hello.

1. Debug message

I enabled "debugging" as you suggested and configured the environment to receive messages.

2. Callback function

I tried to test it by doing, but there is a phenomenon that it stops while downloading the firmware.
I will attach the source, so please check it.

0 Likes

Dear AliAsgar

I checked debugging messages with uart.

First. It proceeded with the existing source (CY_U3P_DMA_TYPE_AUTO).

Check result
In CyFxSlFifoApplnUSBEventCB(), "CY_U3P_USB_EVENT_EP_UNDERRUN" occurs, Errcoder997 occurs, and an error occurs in data transmission.

When does this error occur?

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

CY_U3P_USB_EVENT_EP_UNDERRUN means that more data has been requested from the endpoint than it can provide. This issue can result when the data has not been committed to the USB endpoint.

Please try the given debug method mentioned earlier : Change the DMA channel from AUTO to MANUAL channel and register for DMA callback. Count the number of PROD and CONS events in the DMA callback and print it in the thread loop and share the prints with us.

I doubt that the DMA buffers are not being filled from the GPIF and hence are not getting committed to the USB.

Best Regards,
AliAsgar

0 Likes

Hello.

 

I tried to register a callback function, but it failed.

I don't know exactly, but our software doesn't work properly when dma is set to manual.

If I don't set dma manually, can I not use the dmacallback function properly?

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

You could also try using an AUTO_SIGNAL DMA channel instead of MANUAL to get the DMAcallback. Please enable notifications for PROD and CONS while configuring the DMA channel.

Best Regards,
AliAsgar

0 Likes

Hi.

I modified it as below.

// Enabling the callback for produce event.
//dmaCfg.notification = 0;
//dmaCfg.cb = NULL;
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT; 
dmaCfg.cb = CyFxBulkLpDmaCallback; 

 

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Modify the notifications as follows:
dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT |  CY_U3P_DMA_CB_CONS_EVENT

and define counters for both these events.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi

I tried, but I don't get the callback function.

The source is attached.. Please check it.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I see that the DMA channels created are "AUTO" type. However, as I mentioned in my previous post, please change the channel type to "AUTO_SIGNAL" to get the callback notifications. 

In the DMA callback, please remove all the logic for DMA buffer handling and just increment the global variables depending on the type of callback event. Please refer to "USBBulkLoopAutoSignal" firmware example from the FX3 SDK for your reference.

Best Regards,
AliAsgar

0 Likes

Hi.

Thank you for your support.

I made the fix as you suggested.
The Result.

  -  glDMARxCount = 3

 -  glDmaTxCount = 0

 

Best Regards.

 

 

0 Likes
lock attach
Attachments are accessible only for community members.
Zenith
Level 3
Level 3
5 questions asked 100 sign-ins 25 replies posted

Hi.

A more detailed situation is attached.
Please check.

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I assume glDmaTxCount is incremented when a CONS event is received. 

From your previous post, it seems that the data is produced properly from the GPIF, but not consumed by USB properly.
Can you try streaming with streamer.exe application without the HUB (CYUSB3314) in between?

Best Regards,
AliAsgar

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

To summarize:

1. Streaming by directly connecting multiple FX3 with PC works fine.

2. Streaming by connecting multiple FX3 with CY4601 (HX3) and then PC works fine.

3. Streaming by connecting multiple FX3 with HX3 on a custom board, fails.

Am I right? If yes, this points to an issue on your custom board specifically and not on the FX3 firmware.

Best Regards,
AliAsgar

0 Likes

Hi.

Yes, that's right.
It seems to be a problem that appears when a momentary voltage drop occurs.
We're checking power and more.

Best Regards.

0 Likes
Zenith
Level 3
Level 3
5 questions asked 100 sign-ins 25 replies posted

I tested again.
A 997 error also occurs for No.2.

It also occurs on the USBboard connected to CY4601 (HX3).
The more Usbboards connected, the faster errors seem to occur.

Best Regards.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Can you program all the FX3 boards with UsbBulkSrcSink firmware and start BULK IN transfers on streamer applications for each of the boards?

Please share a USB hardware trace if possible when the issue is seen. Trace should be taken between the HUB and FX3.

Could you let us know what was inference after debugging when "momentary voltage drop" is seen?

Best Regards,
AliAsgar

0 Likes

Hi.

1. Can you program all the FX3 boards with UsbBulkSrcSink firmware and start BULK IN transfers on streamer applications for each of the boards?

   ->  Please refer to the attached file on ‎Dec 07, 2022.

  - > At some point, the streamer's transmission stops.

2. Could you let us know what was inference after debugging when "momentary voltage drop" is seen?

  -  I tried slowly stepping down the input voltage from 5 V. When it reaches about 4.7 ~ 4.8V (I'm not sure), it stops returning a 997 error like the error situation I have. So, it seemed that this situation could be the cause of one of the problems.

 

My error situation occurs within 1 hour at the shortest and within 2-3 days at the longest.

Have you ever tested 6-7 modules in bulk for a long time like me? Anything wrong?

 

Best Regards,
AliAsgar

 

 

0 Likes

Hi.

I have a question.

 

1. Endpoint->Timeout = 10000

2. Endpoint->WaitForxFer(&inOverLpa,100);

What is the difference between timeouts No.1 and No.2?

 

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

>> I have ran 4 FX3 bulk IN streaming with a streamer application. I faced no errors. Two of them had a data rate of ~420MBps and two others had half the data rate ~210MBps. This is because BULK endpoints use up only the available bandwidth on the USB bus, unlike ISOC endpoint which takes up the maximum bandwidth of the USB bus.

>> Could you please share with us a hardware USB protocol analyser trace between FX3 and HUB  when the issue is seen?

>>The timeouts in No. 1 and No. 2 are very similar. Both are used for WaitForXfer. For synchronous data transfer (XferData), WaitForXfer is called with timeout No. 1 internally to the XferData API implementation and for asynchronous data transfer (beginDataXfer/WaitForXfer/FinishDataXfer), timeout No. 2 is called explicitly.

>>Just to be clear, no issue is seen with multiple FX3 connected directly to the PC without a HUB. Issue seems to occur only if there is a HUB in between. Am I right?

Best Regards,
AliAsgar

0 Likes

Hi.

I saw in the community that some user had a similar problem as me, but solved it by increasing the time-out value.

So I am also testing by increasing the time-out value.

1. Previous

   BlutOut(0x1) : 100

   BlutIn(0x81) : 100

   BlutOut(0x2) : 3000

   BlutIn(0x82) : 3000    <- Occurs ERROR997

 

2. Current

   BlutOut(0x1) : 10000

   BlutIn(0x81) : 10000

   BlutOut(0x2) : 3000

   BlutIn(0x82) : 3000

 

For a few days, the condition seems more stable than before.
I'll let you know the results after more testing.

Will the error at 0x81 affect 0x82?

Best Regards.

 

 

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

I am sorry but I could not understand what you are trying to convey in the previous post. I did not understand what those values are in the previous and current.

Also please let me know what tests are running currently and what is the result of those tests?

Has increasing the timeout value solved your issue?

Please explain the above post in more detail.

Best Regards,
AliAsgar

0 Likes

Hi,

So far I am getting 997 error situation at Endpoint (0x82).

However, I increased the timeout value of endpoint(0x1) from 100 to 1000, not Endpoint(0x82).

As a result of watching for a few days, my system seems more stable than when time-out 100.

That is, I increased the timeout value of endpoint (0x1), but it seems that endpoint (0x82) is more stable.

If an error occurs in an endpoint (0x1) under some circumstances,
Is there a possibility of ep->lasterror( 997) occurring at Endpoint (0x82)?

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Lasterror()/NtStatus() API call returns the error code returned by the driver from the last call to the XferData, BeginDataXfer, FinishDataXFer or Abort methods.

Hence, if the above Xfer APIs were called for 0x82, Then the following lasterror() API call for 0x82, gives the error on endpoint on 0x82.

Are the transfers happening simultaneously on 0x82 and 0x01/any other endpoints?

Has increasing the timeout value solved your issue?

Best Regards,
AliAsgar 

0 Likes