xmos / lib_xud

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

Race condition between disconnect and Ep ready clear #351

Closed xross closed 2 years ago

xross commented 2 years ago

Issue occurs when unplug event happens between receiving an OUT token and DATA packet on an Iso EP (only)

Effects Iso EP's only since ready cleared before data received - this was slight optimisation for Iso EP timing

Issues occurs occurs around once every 80 disconnects. Customer replicates by shorting D+/D- lines (!)

Simple fix adds extra instruction:

- stw r11, r5[r10]
bl doRXData
clre
+ ldc r11, 0
+ stw r11, r5[r10]