<?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>Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73761/entering-serial-dfu-mode-from-the-application-layer</link><description>Hi, I am try to implement UART SERIAL Bootloader for my device and I just need to perform DFU using uart serial 
 I have tested the code and bootloader. My query is 
 Without pressing BUTTON_4 and Power reset how to enter to DFU mode from the application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Apr 2021 18:04:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73761/entering-serial-dfu-mode-from-the-application-layer" /><item><title>RE: Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/thread/304089?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 18:04:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57093667-9a34-4e8b-b01c-47de37ed9f25</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi Einar, I got It working. when i used to enter dfu mode I can able to enter&lt;/p&gt;
&lt;p&gt;I made the above lines into the function and where ever i need to perform it enter into DFU mode&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: Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/thread/304050?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 13:56:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60bf3621-72c6-4037-8ffc-f1692e4fed7e</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;in&lt;/p&gt;
&lt;p&gt;void main()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;err_code = sd_power_gpregret_clr(0, 0xffffffff);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VERIFY_SUCCESS(err_code);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; VERIFY_SUCCESS(err_code);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC_SystemReset();&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;..&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/thread/304044?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 13:47:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5def42c-0b22-4c73-bf33-6a7929a12abb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You do not need to do all that. To just enter DFU mode, simply:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    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);

    NVIC_SystemReset();&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/thread/304030?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 13:19:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cc8771f-c92b-4559-85d8-d9fe9459a186</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;i worked in BLE buttonless&lt;/p&gt;
&lt;p&gt;there i use&amp;nbsp; code&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static bool app_shutdown_handler(nrf_pwr_mgmt_evt_t event)
{
    switch (event)
    {
        case NRF_PWR_MGMT_EVT_PREPARE_DFU:
        NRF_LOG_INFO(&amp;quot;Power management wants to reset to DFU mode\r\n&amp;quot;);        
        break;
        default:       
        return true;
    }
    NRF_LOG_INFO(&amp;quot;Power management allowed to reset to DFU mode\r\n&amp;quot;);
    return true;
}

NRF_PWR_MGMT_HANDLER_REGISTER(app_shutdown_handler, 0);


static void ble_dfu_buttonless_evt_handler(ble_dfu_buttonless_evt_type_t event)
{
    switch (event)
    {
      case BLE_DFU_EVT_BOOTLOADER_ENTER_PREPARE:
        NRF_LOG_INFO(&amp;quot;Device is preparing to enter bootloader mode\r\n&amp;quot;);
        break;
      case BLE_DFU_EVT_BOOTLOADER_ENTER:
        NRF_LOG_INFO(&amp;quot;Device will enter bootloader mode\r\n&amp;quot;);
        break;
      case BLE_DFU_EVT_BOOTLOADER_ENTER_FAILED:
        NRF_LOG_ERROR(&amp;quot;Device failed to enter bootloader mode\r\n&amp;quot;);
        break;
      default:
        NRF_LOG_INFO(&amp;quot;Unknown event from ble_dfu.\r\n&amp;quot;);
        break;
    }
}


static void dfu_init(void)
{
    ret_code_t             err_code;
    ble_dfu_buttonless_init_t dfus_init =
    {
        .evt_handler = ble_dfu_buttonless_evt_handler
    };
        err_code = ble_dfu_buttonless_init(&amp;amp;dfus_init);
        APP_ERROR_CHECK(err_code);
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;dfu_init() i called in service_init()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ble_dfu_buttonless_bootloader_start_finalize()&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;where i can use this&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/thread/304021?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 12:53:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd8173f7-4521-4620-9e9c-a3b2b87ab64a</guid><dc:creator>Einar Thorsrud</dc:creator><description>[quote user="Sunil vignesh"]&lt;p&gt;these lines&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;write&amp;nbsp;BOOTLOADER_DFU_START to GPREGRET just as in&amp;nbsp;ble_dfu_buttonless_bootloader_start_finalize() in&amp;nbsp;components\ble\ble_services\ble_dfu\ble_dfu.c before you do a soft reset.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;where i need to perform&lt;/p&gt;
&lt;p&gt;In Application code?&lt;/p&gt;[/quote]
&lt;p&gt;&amp;nbsp;Yes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/thread/304014?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 12:46:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18e18923-4188-4254-b675-845a1d415b0d</guid><dc:creator>Sunil vignesh</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
&lt;p&gt;Yes, It is working in nRF5 SDK&lt;/p&gt;
&lt;p&gt;these lines&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;write&amp;nbsp;BOOTLOADER_DFU_START to GPREGRET just as in&amp;nbsp;ble_dfu_buttonless_bootloader_start_finalize() in&amp;nbsp;components\ble\ble_services\ble_dfu\ble_dfu.c before you do a soft reset.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;where i need to perform&lt;/p&gt;
&lt;p&gt;In Application code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Entering Serial DFU mode from the application layer</title><link>https://devzone.nordicsemi.com/thread/303995?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 12:01:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:722d6be1-3897-4c09-8da9-ff0adcdc848e</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I assume you are referring to the nRF5 SDK now? In that case, you can use GPREGRET to enter DFU mode, in the same way as is used with the BLE buttonless DFU service. Essentially you just ensure that&amp;nbsp;NRF_BL_DFU_ENTER_METHOD_GPREGRET is set to 1 in the bootloader&amp;#39;s sdk_config.h and write&amp;nbsp;BOOTLOADER_DFU_START to GPREGRET just as in&amp;nbsp;ble_dfu_buttonless_bootloader_start_finalize() in&amp;nbsp;components\ble\ble_services\ble_dfu\ble_dfu.c before you do a soft reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>