<p>tsaitgaist has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/simtrace2/+/16432">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">DFU: restart bootloader when USB conf failed<br><br>when starting the DFU bootloader, but USB configuration (e.g.<br>enumeration) failed, the MCU restarted in the main application.<br>this occured after a DFU detach and were the USB host missed the<br>USB reset.<br>now after MCU reset, the bootloader is started again, since this<br>is what was requested to begin with.<br>the bootloader will always restart in the bootloader until USB<br>enumeration succeeded.<br>this boot loop can be stopped by unplugging/removing power from<br>the device.<br><br>Change-Id: I4062a7d8a7934af2119c169759b614dc45990651<br>---<br>M firmware/apps/dfu/main.c<br>1 file changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/32/16432/1</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 0f1e0de..21418b0 100644</span><br><span>--- a/firmware/apps/dfu/main.c</span><br><span>+++ b/firmware/apps/dfu/main.c</span><br><span>@@ -313,8 +313,8 @@</span><br><span>              check_exec_dbg_cmd();</span><br><span> #if 1</span><br><span>               if (i >= MAX_USB_ITER * 3) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 TRACE_ERROR("Resetting board (USB could "</span><br><span style="color: hsl(0, 100%, 40%);">-                                 "not be configured)\n\r");</span><br><span style="color: hsl(120, 100%, 40%);">+                      TRACE_ERROR("Resetting board (USB could not be configured)\n\r");</span><br><span style="color: hsl(120, 100%, 40%);">+                   g_dfu->magic = USB_DFU_MAGIC; // start the bootloader after reboot</span><br><span>                        USBD_Disconnect();</span><br><span>                   NVIC_SystemReset();</span><br><span>          }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/simtrace2/+/16432">change 16432</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/+/16432"/><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: I4062a7d8a7934af2119c169759b614dc45990651 </div>
<div style="display:none"> Gerrit-Change-Number: 16432 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: tsaitgaist <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>