<p>laforge has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/simtrace2/+/16910">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">HACK: Solve weird problem wih lost OUT transfer on ping-pong endpoint<br><br>This adds an unconditional endpoint reset procedure to every SET_FEATURE(UnHalt).<br><br>It doesn't really make sense that this is required, *particularly* as<br>we *MUST NOT* set bEndpoint->bank to 0 here.<br><br>Without this patch, I'm observing the following problem:<br><br>Every first OUT transfer after a SET_INTERFACE + UNHALT on a bulk endpoint<br>is lost. "lost" means that it completes successfully on the host, can<br>be seen completing successfully with an ACK on a USB bus analyzer,<br>but still doesn't show up in the firmware.  No Endpoint Interrupt<br>is generated.<br><br>This can be reproduced by calling libusb_set_interface_alt_setting()<br>from the host and then submitting a single OUT transfer.<br><br>Change-Id: I18ed530e617baddf76e8f9829512443ce2a76e0d<br>---<br>M firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c<br>1 file changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/10/16910/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c b/firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c</span><br><span>index 1ebab5b..e6edda6 100644</span><br><span>--- a/firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c</span><br><span>+++ b/firmware/atmel_softpack_libraries/libchip_sam3s/source/USBD_HAL.c</span><br><span>@@ -1672,6 +1672,10 @@</span><br><span>             UDP->UDP_RST_EP |= 1 << bEndpoint;</span><br><span>             UDP->UDP_RST_EP &= ~(1 << bEndpoint);</span><br><span>         }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* This fixes a weird bug with regard to ping-pong OUT endpoints */</span><br><span style="color: hsl(120, 100%, 40%);">+        UDP->UDP_RST_EP |= 1 << bEndpoint;</span><br><span style="color: hsl(120, 100%, 40%);">+        UDP->UDP_RST_EP &= ~(1 << bEndpoint);</span><br><span>     }</span><br><span> </span><br><span>     /* Return Halt status */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/simtrace2/+/16910">change 16910</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/simtrace2/+/16910"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I18ed530e617baddf76e8f9829512443ce2a76e0d </div>
<div style="display:none"> Gerrit-Change-Number: 16910 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>