xmos / lib_xud

XMOS USB code and associated examples
Other
8 stars 25 forks source link

Setup packet occasionally hangs in lib_xud 2.2.2 #395

Closed Zdenek151 closed 2 months ago

Zdenek151 commented 2 months ago

Dear all,

I am seeking advice regarding the following problem, which is possibly relevant to lib_xud. In our product, we are using xu216 with modified sw_usb_audio 6.15.2 and lib_xud 2.2.2. We received reports of our control software loosing connection with our device. The usb trace shows error in setup packets of the control transfers exchanged between the control software and the device. trace The processor core state appears to be stuck in XUD_GetBuffer_Finish. XMOS DUMPSTATE.txt Any idea on how to tackle this?

This issue was very hard to reproduce and apparently only happens on specific computers.

xross commented 2 months ago

Please could you attach a full USB trace. Thanks.

Zdenek151 commented 2 months ago

@xross The full usb trace archive is about 560MB. Here is a dropbox link. https://www.dropbox.com/scl/fi/53ds76fkk00yrvh6e6o0r/lib_xud_issue395_USB_trace.tdc.tar.gz?rlkey=9f32znypjd10f6rdqjfl0s4c7&st=1p9zd7i7&dl=0

xross commented 2 months ago

Thanks.

The issue is the OUT is missing a handshake. This likely indicates a timing issue.

Can you confirm a couple things:

Zdenek151 commented 2 months ago

@xross Both tiles are running at 500MHz, usb is on tile[1] with 6 cores. XUD_Manager core is assigned 100MHz using set_core_high_priority_on().

xross commented 2 months ago

Is there a chance you can try to reproduce with the develop branch of lib_xud? A small timing tweak was recently applied but not yet released

Zdenek151 commented 2 months ago

Ok. We can try.

Zdenek151 commented 2 months ago

@xross It looks good after a day of stress-testing. With lib_xud 2.2.2, the issue occurred after 15 minutes. Was that the RX_RISE_DELAY change?

xross commented 2 months ago

Okay that's good news. Yes this is the main change since 2.2.2. It's a result of going back and doing more soak testing of handshaked transactions on xs2 devices. We'll make a new release very soon. It looks like it affects you due to polling from your control software.

Zdenek151 commented 2 months ago

@xross That was incredibly lucky timing for us. Thank you for the help.

Zdenek151 commented 2 months ago

Closing as resolved.