<?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>After OTA DFU Bootloader, Application gone</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39982/after-ota-dfu-bootloader-application-gone</link><description>1. I try DFU bootloader with OTA, it success. 
 2. But the Application was gone. 
 3. If item 2 is real, is that I have to porting the force enter to bootloader mode by botton.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Oct 2018 07:57:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39982/after-ota-dfu-bootloader-application-gone" /><item><title>RE: After OTA DFU Bootloader, Application gone</title><link>https://devzone.nordicsemi.com/thread/155264?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 07:57:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0163385b-1f19-4340-8f75-26c3c6531b7f</guid><dc:creator>GeorgeBlue</dc:creator><description>&lt;p&gt;OKie, I will test it and replay ASAP.&lt;/p&gt;
&lt;p&gt;thanks a lot!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: After OTA DFU Bootloader, Application gone</title><link>https://devzone.nordicsemi.com/thread/155263?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 07:43:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e5edec9-26c1-4a2f-b43d-f765903ee73a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are right that the application &lt;em&gt;may&lt;/em&gt; be valid even after a bootloader and/or SoftDevice update. This situation is already handled by the bootloader though, so the application will be started if it is still present and valid (i.e. CRC check is OK) and match the current SoftDevice version. You can see this from the SDK 15.2 documentation (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lib_bootloader_dfu_process.html?cp=4_0_0_3_5_1_0#lib_bootloader_dfu_step"&gt;DFU procedure&lt;/a&gt;):&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;After completion of the first step which ends with activation of the new SoftDevice (and the bootloader), application may still be valid but is not runnable because of broken SoftDevice dependency. It must be updated in the second step. After activation of a package with a SoftDevice, the bootloader will enter DFU mode expecting an application update. Since application update is optional (not required after SoftDevice minor version update), the inactivity timeout in the bootloader is set to a different (shorter) value than the default one (NRF_BL_DFU_CONTINUATION_TIMEOUT_MS).&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: After OTA DFU Bootloader, Application gone</title><link>https://devzone.nordicsemi.com/thread/155241?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 01:44:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba8cd193-70a3-490c-b419-48597c2eb587</guid><dc:creator>GeorgeBlue</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks your reply.&lt;/p&gt;
&lt;p&gt;As you said:&lt;/p&gt;
&lt;p&gt;1. Is that update bootlaoder, it must be flash Application. It means when I finished updated bootloader and reset get in to the bootloader, bootloader will detect the application is no valid, therefore user have to DFU application by BLE OTA.&lt;/p&gt;
&lt;p&gt;2. Or the application maybe could recover back, after finished updated bootloader and reset get into bootloader. In my bootloader source code, I have add some judgment, it will jump to start applicati&lt;pre class="ui-code" data-mode="text"&gt;nrf_bootloader_fw_activation_result_t nrf_bootloader_fw_activate(void)
{
    nrf_bootloader_fw_activation_result_t result;
    uint32_t                              ret_val   = NRF_SUCCESS;
    nrf_dfu_bank_t                      * p_bank    = &amp;amp;s_dfu_settings.bank_1;
    bool                                  sd_update = false;


    NRF_LOG_DEBUG(&amp;quot;Enter nrf_bootloader_fw_activate&amp;quot;);

    switch (p_bank-&amp;gt;bank_code)
    {
       case NRF_DFU_BANK_VALID_APP:
            NRF_LOG_DEBUG(&amp;quot;Valid App&amp;quot;);
            ret_val = app_activate();
            break;
       case NRF_DFU_BANK_VALID_SD:
            NRF_LOG_DEBUG(&amp;quot;Valid SD&amp;quot;);
            ret_val = sd_activate();
            sd_update = true;
            break;
        case NRF_DFU_BANK_VALID_BL:
            NRF_LOG_DEBUG(&amp;quot;Valid BL&amp;quot;);
            ret_val = bl_activate();
            break;
        case NRF_DFU_BANK_VALID_SD_BL:
            NRF_LOG_DEBUG(&amp;quot;Valid SD + BL&amp;quot;);
            ret_val = sd_bl_activate();
            sd_update = true;
            break;
        case NRF_DFU_BANK_INVALID:
        default:
            NRF_LOG_INFO(&amp;quot;No firmware to activate.&amp;quot;);
            return ACTIVATION_NONE;
    }

    if (ret_val != NRF_SUCCESS)
    {
        NRF_LOG_ERROR(&amp;quot;Activation failed with error %d (bank code: 0x%x)&amp;quot;, ret_val, p_bank-&amp;gt;bank_code);
        result = ACTIVATION_ERROR;
    }

    // Invalidate bank, marking completion.
    nrf_dfu_bank_invalidate(p_bank);

    m_flash_write_done = false;
    ret_val = nrf_dfu_settings_write(flash_write_callback);
    ASSERT(m_flash_write_done);

    /* At this point flash module is performing blocking operation. It is expected that operation is already performed. */
    if (ret_val == NRF_SUCCESS)
    {
        result = ACTIVATION_SUCCESS;
        if (sd_update &amp;amp;&amp;amp; nrf_dfu_app_is_valid(true))
        {
            //If SD was updated and application is valid we want to stay in DFU to receive application.
            NRF_LOG_DEBUG(&amp;quot;A SoftDevice has just been activated. It&amp;#39;s likely that an application will come immediately&amp;quot;);
            result = ACTIVATION_SUCCESS_EXPECT_ADDITIONAL_UPDATE;
        }
    }
    else
    {
        NRF_LOG_ERROR(&amp;quot;Could not write settings.&amp;quot;);
        result = ACTIVATION_ERROR;
    }

    return result;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: After OTA DFU Bootloader, Application gone</title><link>https://devzone.nordicsemi.com/thread/155111?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 12:33:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0a1a6f8-9a72-40b4-8b04-dc612874ccdd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When you update the bootloader (and SoftDevice) this must to be duel bank, as a failed update could brick the device. Therefor the application is deleted so that the new bootloader can be stored there and verified before it is subsequently copied in place by the MBR. This means that you have to upgrade the application after upgrading the bootloader. You should not have to force bootloader mode by a button in this case though, as the bootloader should always enter DFU mode when there is no valid application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>