<?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>nRF52840 how to goto DFU when the softdevice has been disabled?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56343/nrf52840-how-to-goto-dfu-when-the-softdevice-has-been-disabled</link><description>I have a system based on nRF52840 (SDK 15.0.0) where while running the application I can call the below code, and it will then restart in DFU secure mode to do a firmware upate. This all works great. 
 However I have a use-case where once running the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 09 Jan 2020 10:19:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56343/nrf52840-how-to-goto-dfu-when-the-softdevice-has-been-disabled" /><item><title>RE: nRF52840 how to goto DFU when the softdevice has been disabled?</title><link>https://devzone.nordicsemi.com/thread/228318?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2020 10:19:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7aaf8dcd-860a-4a26-9a26-63c78a19406b</guid><dc:creator>Philip</dc:creator><description>&lt;p&gt;Thanks, updated to the following which works;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void do_dfu(void)
{
    uint32_t err_code;

    #if LEGACY == true
        NRF_POWER-&amp;gt;GPREGRET = 0xB1;
        NVIC_SystemReset();
    #else
        err_code = sd_power_gpregret_clr(0, 0xffffffff);
        VERIFY_SUCCESS(err_code);

        err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);
        VERIFY_SUCCESS(err_code);

        // Signal that DFU mode is to be enter to the power management module
        nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU);
    #endif
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 how to goto DFU when the softdevice has been disabled?</title><link>https://devzone.nordicsemi.com/thread/228213?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2020 17:01:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7ccf490-fb46-410a-8de6-885e4589fe7d</guid><dc:creator>Turbo J</dc:creator><description>[quote userid="2945" url="~/f/nordic-q-a/56343/nrf52840-how-to-goto-dfu-when-the-softdevice-has-been-disabled"]Is there a way to modify the GPREGRET register and then call a system reset?[/quote]
&lt;p&gt;Just modify NRF_POWER-&amp;gt;GPREGRET directly and then call NVIC_SystemReset();&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>