<p>Kévin Redon has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12914">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">set initial DFU state to ERROR if application is corrupt<br><br>as specified in DFU standard<br><br>Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0<br>---<br>M usb/class/dfu/device/dfudf.c<br>M usb_dfu_main.c<br>2 files changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/14/12914/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/usb/class/dfu/device/dfudf.c b/usb/class/dfu/device/dfudf.c</span><br><span>index 8232979..223999a 100644</span><br><span>--- a/usb/class/dfu/device/dfudf.c</span><br><span>+++ b/usb/class/dfu/device/dfudf.c</span><br><span>@@ -306,7 +306,6 @@</span><br><span>  usbdc_register_function(&_dfudf);</span><br><span>        usbdc_register_handler(USBDC_HDL_REQ, &dfudf_req_h);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-    // TODO check if firmware is corrupted and set dfuERROR state if it is</span><br><span>       return ERR_NONE;</span><br><span> }</span><br><span> </span><br><span>diff --git a/usb_dfu_main.c b/usb_dfu_main.c</span><br><span>index 81b02f8..7fd54d3 100644</span><br><span>--- a/usb_dfu_main.c</span><br><span>+++ b/usb_dfu_main.c</span><br><span>@@ -101,6 +101,9 @@</span><br><span>         if (!check_force_dfu() && check_application()) { // application is valid</span><br><span>             start_application(); // start application</span><br><span>    } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              if (!check_application()) { // if the application is corrupted the start DFU start should be dfuERROR</span><br><span style="color: hsl(120, 100%, 40%);">+                 dfu_state = USB_DFU_STATE_DFU_ERROR;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span>            usb_dfu(); // start DFU bootloader</span><br><span>   }</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12914">change 12914</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/12914"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-asf4-dfu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0 </div>
<div style="display:none"> Gerrit-Change-Number: 12914 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>