<?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>Not able to enter in DFU mode after creating a new project based on secure boot</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84519/not-able-to-enter-in-dfu-mode-after-creating-a-new-project-based-on-secure-boot</link><description>Hi, 
 
 I am using nrf52840 development kit with SDK 17.1.0. 
 I created a new project in IAR 8.50 and replicate project for sceure_bootloader in new project by adding files manually and include path and all. 
 Its compiling properly no issue in that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Feb 2022 14:19:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84519/not-able-to-enter-in-dfu-mode-after-creating-a-new-project-based-on-secure-boot" /><item><title>RE: Not able to enter in DFU mode after creating a new project based on secure boot</title><link>https://devzone.nordicsemi.com/thread/352667?ContentTypeID=1</link><pubDate>Fri, 11 Feb 2022 14:19:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67304861-5854-4da4-ae6d-fd1112a9fd99</guid><dc:creator>Sigurd</dc:creator><description>[quote user="R_S"]If i comment the portion before&amp;nbsp;app_start(vector_table_addr); then the issue get resolved.&amp;nbsp;[/quote]
&lt;p&gt;Good!&lt;/p&gt;
[quote user="R_S"]How flash protect can cause this issue..?[/quote]
&lt;p&gt;You seem to be protecting the&amp;nbsp;bootloader settings page as well. This way, bootloader2 won&amp;#39;t be able to update the bootloader settings page when it does the DFU, and the DFU will fail.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to enter in DFU mode after creating a new project based on secure boot</title><link>https://devzone.nordicsemi.com/thread/352081?ContentTypeID=1</link><pubDate>Wed, 09 Feb 2022 13:18:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:811de567-3f84-41b5-a414-ec94469e4352</guid><dc:creator>R_S</dc:creator><description>&lt;p&gt;OK&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i have two bootloaders. bootloader 1 and bootloader 2.&lt;/p&gt;
&lt;p&gt;the flashing sequence is like -&amp;gt;MBR-&amp;gt;Softdevice-&amp;gt;Bootloader1-&amp;gt;Bootloader2 -&amp;gt;Application code&lt;/p&gt;
&lt;p&gt;Bootloader 1 start address&amp;nbsp; -- &lt;span&gt;0x000E8000 to ECFFF&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Bootloader 2 start Address&amp;nbsp; --0x000ED000&amp;nbsp; to FDFFF&lt;br /&gt;Application Start Address&amp;nbsp; --&amp;nbsp;&amp;nbsp;0x00027000&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Bootloader 1 is used for Bootloader 2 signature verification and bootloader 2 is responsible for DFU activity.&lt;/p&gt;
&lt;p&gt;in Bootloader 1 i found that some portion of code creating this issue&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void nrf_bootloader_app_start_final(uint32_t vector_table_addr)
{
    ret_code_t ret_val;

    // Size of the flash area to protect.
    uint32_t area_size;

    area_size = BOOTLOADER_SIZE + NRF_MBR_PARAMS_PAGE_SIZE;
    if (!NRF_BL_DFU_ALLOW_UPDATE_FROM_APP &amp;amp;&amp;amp; !NRF_BL_DFU_ENTER_METHOD_BUTTONLESS &amp;amp;&amp;amp; !NRF_DFU_TRANSPORT_BLE)
    {
        area_size += BOOTLOADER_SETTINGS_PAGE_SIZE;
    }

    ret_val = nrf_bootloader_flash_protect(BOOTLOADER_START_ADDR, area_size);

    if (ret_val != NRF_SUCCESS)
    {
        NRF_LOG_ERROR(&amp;quot;Could not protect bootloader and settings pages, 0x%x.&amp;quot;, ret_val);
    }
    APP_ERROR_CHECK(ret_val);

    ret_val = nrf_bootloader_flash_protect(0,
                    nrf_dfu_bank0_start_addr() + ALIGN_TO_PAGE(s_dfu_settings.bank_0.image_size));

    if (ret_val != NRF_SUCCESS)
    {
        NRF_LOG_ERROR(&amp;quot;Could not protect SoftDevice and application, 0x%x.&amp;quot;, ret_val);
    }
    APP_ERROR_CHECK(ret_val);

    // Run application
    app_start(vector_table_addr);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If i comment the portion before&amp;nbsp;app_start(vector_table_addr); then the issue get resolved.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But i am not able to understand it why.&lt;/p&gt;
&lt;p&gt;How flash protect can cause this issue..?&lt;/p&gt;
&lt;p&gt;This portion is realted to the bootloader 1 and i am facing issue in bootloader2 . is it because flash protect function accessing more size i think in this case include bootloader size as well..?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;R_S&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not able to enter in DFU mode after creating a new project based on secure boot</title><link>https://devzone.nordicsemi.com/thread/352024?ContentTypeID=1</link><pubDate>Wed, 09 Feb 2022 11:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:740da7ae-6969-470d-9d2c-86fd5435df2e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]But when i am flashing that code then its not entering to DFU mode.[/quote]
&lt;p&gt;What did you flash? SoftDevice and the bootloader?&lt;/p&gt;
[quote user=""]I created a new project in IAR 8.50 and replicate project for sceure_bootloader in new project by adding files manually and include path and all.[/quote]
&lt;p&gt;Does it work with the original&amp;nbsp;secure_bootloader&amp;nbsp;&lt;span&gt;project?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>