<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/simtrace2/+/16431">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">DFU: increase USB reset duration to 50 ms<br><br>the specification requires a reset duration of at least 10 ms.<br>reset is indicated by the device to the host by removing the<br>pull-up on D+ (host to device reset is a USB packet).<br>we used 20 ms, but on some setups (USB host, stack, hub, and load<br>dependent), this does not seem to be enough (no USB enumeration<br>was performed afterward, at least for the DFU bootloader).<br>increasing to 50 ms solved the issue on the affected setups.<br><br>instead of USB suspend, the more proper USB disconnect is used.<br>this mainly disables the pull-up provided by the USB peripheral.<br>USB activate is not required since the follow up initialisation<br>takes care of it.<br><br>Change-Id: If5ceb3b8f7a8f134d4439fdd138dd12b46589f97<br>---<br>M firmware/apps/dfu/main.c<br>1 file changed, 2 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/firmware/apps/dfu/main.c b/firmware/apps/dfu/main.c</span><br><span>index 97cd074..36f80a8 100644</span><br><span>--- a/firmware/apps/dfu/main.c</span><br><span>+++ b/firmware/apps/dfu/main.c</span><br><span>@@ -300,17 +300,16 @@</span><br><span> </span><br><span>  TRACE_INFO("USB init...\n\r");</span><br><span>     /* Signal USB reset by disabling the pull-up on USB D+ for at least 10 ms */</span><br><span style="color: hsl(120, 100%, 40%);">+  USBD_Disconnect();</span><br><span> #ifdef PIN_USB_PULLUP</span><br><span>  const Pin usb_dp_pullup = PIN_USB_PULLUP;</span><br><span>    PIO_Configure(&usb_dp_pullup, 1);</span><br><span>        PIO_Set(&usb_dp_pullup);</span><br><span> #endif</span><br><span style="color: hsl(0, 100%, 40%);">-  USBD_HAL_Suspend();</span><br><span style="color: hsl(0, 100%, 40%);">-     mdelay(20);</span><br><span style="color: hsl(120, 100%, 40%);">+   mdelay(50);</span><br><span> #ifdef PIN_USB_PULLUP</span><br><span>         PIO_Clear(&usb_dp_pullup);</span><br><span> #endif</span><br><span style="color: hsl(0, 100%, 40%);">-        USBD_HAL_Activate();</span><br><span> </span><br><span>     USBDFU_Initialize(&dfu_descriptors);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/simtrace2/+/16431">change 16431</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/+/16431"/><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: If5ceb3b8f7a8f134d4439fdd138dd12b46589f97 </div>
<div style="display:none"> Gerrit-Change-Number: 16431 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: tsaitgaist <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Hoernchen <ewild@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>