FX3 grabbing image timeout

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

cross mob
RiYo_1135191
Level 1
Level 1

Hi, all

I develop a usb3.0 camera under SDK1.3.4, data flow following:

SENSOR-->ZYNQ-->3014-->PC

Basic setting:

Data: 640x480@800fps, Mono8

GPIF: 32bits@100M

DMA: 16KBx8,Auto mode

EP: 0x81, BULK

I meet a trouble, grabbing image from camera, after about 1000000 frames, system is hung, i check 3014 GPIF, PIB, DMA, EP, no error found. i reopen my capture tool, the same trouble happen again.

so, my questions are:

1.  which phrase cause the trouble, and how to settle it;

2. how to restore grabbing as fast as possible;

3. and other advise

Thanks & Best regards.

Richard

0 Likes
1 Solution

Hello Richard,

Please check if you getting CYU3P_USBEP_SS_RESET_EVT  in  CyFxApplnEpCallback as mentioned in the default gpiftousb example in SDK. The firmware handles the endpoint specific CYU3P_USBEP_SS_RESET_EVT event to detect and recover from potential USB data corruption due to protocol level errors.This is done by stalling the endpoint on receiving  CYU3P_USBEP_SS_RESET_EVT event.

EP_HALTED indicates that the endpoint is stalled and host will send CLEAR_FEATURE request to that endpoint. This clear feature requests need to be handled in the firmware. When a clear feature is received,the previous transfer has to be flushed and cleaned up.

This done in the gpiftousb default firmware.

You can refer to this thread with similar problems ASMedia FX3 EP hangs on USB 3.0 eXtensible Host Controller .

Can you try changing the cable and check if it helps

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
13 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Richard,

Please let me know are you using the default AN 75779 firmware or a custom one.

Please share the debug prints when the application hangs.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi,

I use custom board, image data from sensor to FPGA, the data flow is same as gpif2usb demo.

At first, i found about 150 phy_errs, then connect the device, enumate it, start data transfer, after a while, PC can't receives any data, EP_HALTED indicate on PC side, according this, i found no gpif error occur, no dma errors, no pib/usb errors.

i want to know, it is a hardware or layout problem, or software bugs? if so how to settle the problem? and any other customers meet this type problem?

Thanks & Best regards!

Richard.

0 Likes

Hello Richard,

Please check if you getting CYU3P_USBEP_SS_RESET_EVT  in  CyFxApplnEpCallback as mentioned in the default gpiftousb example in SDK. The firmware handles the endpoint specific CYU3P_USBEP_SS_RESET_EVT event to detect and recover from potential USB data corruption due to protocol level errors.This is done by stalling the endpoint on receiving  CYU3P_USBEP_SS_RESET_EVT event.

EP_HALTED indicates that the endpoint is stalled and host will send CLEAR_FEATURE request to that endpoint. This clear feature requests need to be handled in the firmware. When a clear feature is received,the previous transfer has to be flushed and cleaned up.

This done in the gpiftousb default firmware.

You can refer to this thread with similar problems ASMedia FX3 EP hangs on USB 3.0 eXtensible Host Controller .

Can you try changing the cable and check if it helps

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi,

Thanks for you replying.

I has done it in my application, when EP halted, PC will send CLEAR_FEATHER to device? i will debug it, according to poor signal/bad cable, i can't comfirm.

Our data flow:

1. Load cyusb3014 program in RAM.

2. Enumate cyusb3014 device, and connect it.

3. Start grabbing, frame@800fps from device to PC, and display the image.

4. cyusb3014 driver use SDK supplied, application use cyAPI.

Our issue:

1. After start grabbing, i check phy_err over 150, and ZLP cause DMA suppend and resume operation.

2. After a while, data transfer stopping, USBD_STATUS indicate EP_HALT, the time maybe 100+ frames, max frames up to 15M.

3. Deferent PC, cause deferent grabbing frames, my dell workstation max up to 15M frames.

How to:

1. I don't know how to locate the problem, hardware issue or software, and how to repair it.

Any way, we have 10K+ CYUSB3014 per month to purchase, and want to settle the problem as fast as possible.

Thanks & best regards.

Richard

0 Likes

Hello Richard,

I understand the problem. We would need to know more about the firmware to reach to a conclusion whether the error is from hardware or firmware

- Please confirm the SDK version that you are using

- Please refer to default gpiftousb firmware and  let me know whether the CLEAR_FEATURE request is handled or not.

- Please refer to bulksrcsink example of the SDK and get the debug logs ( CyU3PUsbInitEventLog)  and share the debug prints so that we can understand what exactly is happening on the USB side.

- Is the endpoint a bulk endpoint or synchronous endpoint.

-If possible please share the firmware for us to check.

Regards,

Rashi

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

Hi, Rashi

Thanks for your help!

- My SDK is 1.3.4, and endpoint is bulk.

- The EP_HALTED is reported by host.

- The attachment is my source code.

Thanks & best regards!

Richard.

0 Likes

Hello Richard,

The firmware seems fine i.e handling the CYU3P_USBEP_SS_RESET_EVT and it is also handling the Clear feature request.

In my previous response i had also asked for debug logs using CyU3PUsbInitEventLog  & CyU3PUsbGetEventLogIndex API. CyU3PUsbInitEventLog function is to initiate logging of USB state changes into a circular buffer. CyU3PUsbGetEventLogIndex will get the current event log buffer index.

You can refer to the bulksrcsink example of the SDK, the example will help in the implementation of the API and getting the debug logs. Please share the debug logs to debug the problem you are facing.

Regards,

Rashi

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

hi rashi,

log file is attached.

0 Likes

Hello Richard,

It seems that the logs  you shared are not complete.

Please refer to the logs which we get after programming usbbulksrcsink example

usblog.PNG

Can you run the same firmware (usbbulksrcsink) are get the logs (uart prints) and share them.

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi Rashi,

I use EP0 to get log info.  no uart output.

First, i use CyU3PUsbInitEventLog() to initialize log buffer, use request code 0x81 to get log info. via EP0.

Second, i interpret message by CYU3P_USB_LOG_XXX macros.

Thanks & Best regards!

Richard

0 Likes

Hello,

1) Please confirm do you get CYU3P_USBEP_SS_RESET_EVT in your firmware

2) If yes, you will get EP_HALT on host application. On getting this the host application should send Clear feature to device.

3) Is the device receiving the clear feature request?

You can call CYU3PDeviceReset(CyFalse) to check whether the  CYU3P_USBEP_SS_RESET_EVT or clear feature request is executed or not.

I programmed FX3 with default gpiftousb example and got following logs. Please program the default firmware and share the logs.

gpiftousb.PNG

Regards,

Rashi

Regards,
Rashi
0 Likes

Hi, Rashi,

CYU3P_USBEP_SS_RESET_EVT is processed.

How to get EP_HALT on host(or PC) application?

On my new firmware, i receive above 6M frames, log is 06 12 25 26 17 00 00 ...

On different PC has different result, such as:

PC0: receive about 20k frames, and time out, no any frame received.

PC1: receive about 100k frames, and time out, no any frame received.

PC2: receive about 500k frames, and time out, no any frame received.

PC3: receive about 10M frames, and time out, no any frame received.

...

When failed, i read log index:

06 12

17 00

06 12

17 00

...

log contents:

0000 06 12 25 26 06 12 25 26 05 00 03 08 04 00 00 00

0010 05 00 03 08 04 00 00 00 05 00 03 08 04 00 00 00

0020 05 00 03 08 04 00 00 00 05 00 03 08 04 00 00 00

0030 05 00 03 08 04 00 00 00 05 00 03 08 00 00 00 00

0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

01A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

01B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

01C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

01D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

01E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

01F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

CONTROL IN transfer completed

if re-enumerate the fx3 device, it may failed, try any times, it may success.

i track program on host, no data received.

i do not know why? Hardware/software/layout/...?

Regards!

Richard.

0 Likes

Hello Richard,

Please let me know the answers to questions asked in previous response

- Do you get a clear feature from host?

pastedImage_0.png

- Please try programming the device with default firmware (gpiftousb) and let me know the results (usb logs)

- Please let e know the changes done in the new firmware. If possible please share the firmware

Regards,

Rashi

Regards,
Rashi
0 Likes