<?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>Bootloader with FDS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21099/bootloader-with-fds</link><description>Hi everyone! 
 I have an application based on experimental_ble_app_eddystone for nRF52 (SDK12.2), which uses FDS to save in flash memory. Now I want to add the secure_bootloader to update the firmware with DFU. 
 My way to &amp;quot;activate&amp;quot; DFU mode is to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 05 Apr 2017 10:27:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21099/bootloader-with-fds" /><item><title>RE: Bootloader with FDS</title><link>https://devzone.nordicsemi.com/thread/82520?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 10:27:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba61059f-d9e5-40af-975b-703b5f8babca</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Yes, I forgot that the register must be cleared to prevent the device from staying in the bootloader when it should jump to the application. I added have fixed this in the snippet above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader with FDS</title><link>https://devzone.nordicsemi.com/thread/82519?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 10:24:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4955ff9a-96f2-4599-ac27-b7d3e8a1bf06</guid><dc:creator>dblasco</dc:creator><description>&lt;p&gt;I think I forgot to clear first the register. I added sd_power_gpregret_clr and now it does work.
Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader with FDS</title><link>https://devzone.nordicsemi.com/thread/82518?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 10:16:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98b78dca-d170-4523-a163-cc4daa44f6f3</guid><dc:creator>dblasco</dc:creator><description>&lt;p&gt;Thank you Bjørn, that worked. I didn&amp;#39;t know it was so simple!
However, when I upload the new  application firmware through DFU, the device does not start the application automatically (I have to turn off and on the device). I suppose this is because the register still has the 0xB1 value, so I tried adding sd_power_gpregret_set(0,0x00); in bootloader, but it has no effect.
Is there any explanation for this?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader with FDS</title><link>https://devzone.nordicsemi.com/thread/82517?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2017 07:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b596c07-5949-467a-99b7-9b14b6c73542</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi dblasco,&lt;/p&gt;
&lt;p&gt;if you want to enter bootloader mode from the application then you only have to write to one of the nRF52s GPREGRET registers(general purpose registers that are retained through a Soft Reset) and then check this register once you enter the bootloader on startup.&lt;/p&gt;
&lt;p&gt;Thus, you only need to call the following snippet in your application when you want to enter bootloader mode.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = sd_power_gpregret_set(0,0xB1);       
APP_ERROR_CHECK(err_code);       

sd_nvic_SystemReset();   
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the bootloader you will have to modify the nrf_dfu_enter_check() in nrf_dfu.c to the following&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;__WEAK bool nrf_dfu_enter_check(void)
{    
     if(NRF_POWER-&amp;gt;GPREGRET == 0xB1)
     {
           //Reset GPREGRET register so bootloader mode is not triggered when the device resets.
           NRF_POWER-&amp;gt;GPREGRET = 0x00;       
           return true;   
     }       

     if (s_dfu_settings.enter_buttonless_dfu == 1)   
     {       
        s_dfu_settings.enter_buttonless_dfu = 0;       
        (void)nrf_dfu_settings_write(NULL);       
        return true;     
     }     
     return false;
}
&lt;/code&gt;&lt;/pre&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>