<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>52840 DFU operational failure/question</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53479/52840-dfu-operational-failure-question</link><description>I am porting the Microsoft Sphere example ( https://github.com/Azure/azure-sphere-samples/tree/master/Samples/ExternalMcuUpdate ) that updates a Nordic nRF52 Development Kit over UART using the MT3620 Sphere Development Kit. The port involves moving this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2019 19:08:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53479/52840-dfu-operational-failure-question" /><item><title>RE: 52840 DFU operational failure/question</title><link>https://devzone.nordicsemi.com/thread/216696?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 19:08:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f55d88a4-019e-49a6-9bc1-14bc2a025c8c</guid><dc:creator>JMF</dc:creator><description>&lt;p&gt;Thank you that was what I needed to know!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 DFU operational failure/question</title><link>https://devzone.nordicsemi.com/thread/216571?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 10:56:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18fbf971-9614-4af2-89a3-c93b23f0ce6a</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi, you can add it as an additional load file, i.e. it is loaded after the bootloader when you click download in SES. You can add it by&amp;nbsp;right-clicking&amp;nbsp;Project in the Project explorer, then Options, select Common in the drop-down menu in the upper-left corner. Then navigate to&amp;nbsp;Debug &amp;gt; Loader &amp;gt; Additional Load File[0] and browse to &amp;lt;SDK folder&amp;gt;\components\softdevice\s140\hex to find the SoftDevice hex.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Optionally you can flash the SoftDevice using nrfjprog with the following command:&lt;/p&gt;
&lt;p&gt;nrfjprog --program&amp;nbsp;s140_nrf52_7.0.1_softdevice.hex --sectorerase --reset&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 DFU operational failure/question</title><link>https://devzone.nordicsemi.com/thread/216402?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2019 13:35:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b2992bf-d75e-4b9f-adfe-e5d9fdc39624</guid><dc:creator>JMF</dc:creator><description>&lt;p&gt;Bjorn, thank you for the response. I am using the SEGGER Embedded Stdio, can you possible tell me how do I add the SD to the bootloader so that when it downloads, it includes the SD?&amp;nbsp; Also, is there anyway to tell the DFU SW to ignore the presence of a SD and simply program the one that is provided?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 52840 DFU operational failure/question</title><link>https://devzone.nordicsemi.com/thread/216349?ContentTypeID=1</link><pubDate>Wed, 23 Oct 2019 11:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d3c6167-f1e2-4c55-81d3-ea6337fdd9fa</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi JMF,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if you take a look at the&amp;nbsp;sd_req_ok() in nrf_dfu_ver_validation.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static bool sd_req_ok(dfu_init_command_t const * p_init)
{
    ASSERT(p_init != NULL);
    bool result;
#if defined(BLE_STACK_SUPPORT_REQD) || defined(ANT_STACK_SUPPORT_REQD)
    // The bootloader needs the SoftDevice, so disabling NRF_DFU_APP_DOWNGRADE_PREVENTION
    // should not be applied to SoftDevice updates.
    const bool prevent_downgrade = NRF_DFU_APP_DOWNGRADE_PREVENTION || (p_init-&amp;gt;type == DFU_FW_TYPE_SOFTDEVICE);
#else
    const bool prevent_downgrade = NRF_DFU_APP_DOWNGRADE_PREVENTION;
#endif

    if (SD_PRESENT)
    {
        if (p_init-&amp;gt;sd_req_count == 0)
        {
            result = false;
        }
        else if (p_init-&amp;gt;sd_req[0] != SD_REQ_APP_OVERWRITES_SD)
        {
            result = sd_req_check(p_init-&amp;gt;sd_req,
                                  p_init-&amp;gt;sd_req_count,
                                  (p_init-&amp;gt;type == DFU_FW_TYPE_EXTERNAL_APPLICATION));
        }
        else if (p_init-&amp;gt;type == DFU_FW_TYPE_APPLICATION)
        {
            // The application wants to overwrite the SoftDevice.
            if (prevent_downgrade &amp;amp;&amp;amp; (p_init-&amp;gt;sd_req_count &amp;gt; 1) &amp;amp;&amp;amp; (p_init-&amp;gt;sd_req[0] == SD_REQ_APP_OVERWRITES_SD))
            {
                // The application can overwrite the SD if sd_req[0] == 0 and table has the FWID of the current SD.
                result = sd_req_check(p_init-&amp;gt;sd_req, p_init-&amp;gt;sd_req_count, false);

                // Prevent BLE bootloaders from allowing applications overwriting the SoftDevice.
#ifdef BLE_STACK_SUPPORT_REQD
                result = false;
#endif // BLE_STACK_SUPPORT_REQD
            }
            else
            {
                result = true;
            }
        }
#if NRF_DFU_SUPPORTS_EXTERNAL_APP
        else if(p_init-&amp;gt;type == DFU_FW_TYPE_EXTERNAL_APPLICATION)
        {
            // Won&amp;#39;t accept FW upgrade using external application to
            // enforce replacing SoftDevice (SD_REQ_APP_OVERWRITES_SD)
            result = false;
        }
#endif // NRF_DFU_SUPPORTS_EXTERNAL_APP
        else
        {
            // Don&amp;#39;t allow SoftDevice updates which assume no SD is present already.
            result = !prevent_downgrade || (p_init-&amp;gt;type != DFU_FW_TYPE_SOFTDEVICE);
        }
    }

    else
    {
        if (p_init-&amp;gt;sd_req_count &amp;amp;&amp;amp; (p_init-&amp;gt;sd_req[0] != SD_REQ_APP_OVERWRITES_SD))
        {
            // Fail if there is no SD and the update requires SD. The special &amp;quot;any&amp;quot; FWID is valid
            // for external apps only.
            result = false;
#if NRF_DFU_SUPPORTS_EXTERNAL_APP
            result = sd_req_check(p_init-&amp;gt;sd_req,
                                  p_init-&amp;gt;sd_req_count,
                                  (p_init-&amp;gt;type == DFU_FW_TYPE_EXTERNAL_APPLICATION));
#endif // NRF_DFU_SUPPORTS_EXTERNAL_APP
        }
        else
        {
            // If there is no SD and update has SD it is accepted only if it has a fw_version.
            result = !prevent_downgrade || p_init-&amp;gt;has_fw_version;
        }
    }
    return result;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then you&amp;#39;ll see that the bootloader does not&amp;nbsp;allow SoftDevice updates if there are no SD already present on the nRF device. So you will have to flash a SoftDevice together with the Bootloader eventhough the Bootloader does not require the SD.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>