<?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>Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17455/device-reboots-into-dfu-mode-after-app-update</link><description>Hello, 
 I am having an issue with the DFU in SDK V12.
Using the secure_dfu package, and the buttonless dfu app as a template, I was able to get OTA DFU application updates working with the development kit. However, the same cannot be said about running</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Nov 2016 07:00:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17455/device-reboots-into-dfu-mode-after-app-update" /><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67073?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2016 07:00:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2262d7ae-3f3f-4d9b-8968-2d99411ee7d1</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Happy to help Kyle. I think it should be a part of the bootloader example, but I think that we should make users of the SDK that this pin is used to enter bootloader mode and  the pin number should be modified or the check removed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67072?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 15:12:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20b23bea-7e4e-4a62-9888-e60a85d34c19</guid><dc:creator>Kyle Krueger</dc:creator><description>&lt;p&gt;Pin16 is checked in the default implementation of  nrf_dfu_enter_check() of &lt;code&gt;nrf_dfu.c&lt;/code&gt;. If implementing buttonless DFU, this function should be overridden or modified to avoid conflicts with the use of this pin.&lt;/p&gt;
&lt;p&gt;We had been using pin16 for a SPI bus, and as a result, it was tricking the bootloader into launching DFU.&lt;/p&gt;
&lt;p&gt;I modified the code in nrf_dfu_enter_check() to remove the logic that checked the state of that pin. This should not be a problem for us since we are using a buttonless implementation.&lt;/p&gt;
&lt;p&gt;After removing the check for the state of pin16, the application launched successfully.&lt;/p&gt;
&lt;p&gt;Thanks for your help  Bjørn!&lt;/p&gt;
&lt;p&gt;I feel like the DFU should only check the value of this button for the example code, and that it should not be part of the SDK default function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67066?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 14:56:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03dfffba-6603-4f49-9249-a99a3f0183aa</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hmm, it should only enter that section if if the bootloader button is pressed, i.e. pin 16 is low, or if enter_buttonless_dfu flag in the bootloader setttings is set. Looking at the hexdump, I can see that the enter_buttonless_dfu flag is not set so it has to be the GPIO pin. Do you have pin 16 of the nRF52 tied to anything?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67071?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 14:22:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6f4e494-cd29-4c80-9c03-1f6a6323d7d5</guid><dc:creator>Kyle Krueger</dc:creator><description>&lt;p&gt;Hi Bjørn,&lt;/p&gt;
&lt;p&gt;The code is instead entering the if statement just before at line 119:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```
if(enter_bootloader_mode != 0 || !nrf_dfu_app_is_valid())
{
    timers_init();
    scheduler_init();

    // Initializing transports
    ret_val = nrf_dfu_transports_init();
    if (ret_val != NRF_SUCCESS)
    {
        NRF_LOG_INFO(&amp;quot;Could not initalize DFU transport: 0x%08x\r\n&amp;quot;);
        return ret_val;
    }

    (void)nrf_dfu_req_handler_init();

    // This function will never return
    NRF_LOG_INFO(&amp;quot;Waiting for events\r\n&amp;quot;);
    wait_for_event();
    NRF_LOG_INFO(&amp;quot;After waiting for events\r\n&amp;quot;);
}
```
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is because the nrf_dfu_enter_check() is passing, and the enter_bootloader_mode flag is being set to 1. To confirm, this is right after a DFU update, and that flag should not be set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67065?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 13:46:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dffdc6d-fe3e-4f47-8c59-bd22666376a4</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Kyle, I directed you to the wrong &lt;code&gt;nrf_bootloader_app_start&lt;/code&gt; call, &lt;code&gt;nrf_bootloader_init()&lt;/code&gt; should not return as &lt;code&gt;nrf_bootloader_app_start&lt;/code&gt; is called in &lt;code&gt;nrf_dfu_init()&lt;/code&gt; in &lt;code&gt;nrf_dfu.c&lt;/code&gt;. Can you try to set a breakpoint at the &lt;code&gt;nrf_bootloader_app_start&lt;/code&gt; call shown below(should be at line 143 in &lt;code&gt;nrf_dfu.c&lt;/code&gt;)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (nrf_dfu_app_is_valid())
    {
        NRF_LOG_INFO(&amp;quot;Jumping to: 0x%08x\r\n&amp;quot;, MAIN_APPLICATION_START_ADDR);
        nrf_bootloader_app_start(MAIN_APPLICATION_START_ADDR);
    }
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67070?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 13:38:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb1ffadb-f7a7-4c6a-aa52-9954933fb772</guid><dc:creator>Kyle Krueger</dc:creator><description>&lt;p&gt;No, it doesn&amp;#39;t look like it ever returns from &lt;code&gt;nrf_bootloader_init()&lt;/code&gt;. However, it did acknowledge the valid app as seen above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67069?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 12:50:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b1bddee-bbc3-47d8-91ef-78c188659ca7</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Did the bootloader reach nrf_bootloader_app_start? The suggested RAM start address for the application is lower than 0x20002C00, i.e. it should not be an issue since you have allocated more than enough RAM to the SoftDevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67064?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 11:45:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cef54feb-8a63-4c7f-810c-21899c5fb36e</guid><dc:creator>Kyle Krueger</dc:creator><description>&lt;p&gt;Here is a larger portion of the output after issuing a reset with nrfjprog:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```
:INFO:------- nrf_dfu_flash_init-------
:INFO:Waiting for events
:INFO:Inside main
:INFO:In nrf_bootloader_init
:INFO:In real nrf_dfu_init
:INFO:running nrf_dfu_settings_init
:INFO:Enter nrf_dfu_continue
:INFO:Valid App
:INFO:Application sent bootloader request
:INFO:In nrf_dfu_transports_init
:INFO:num transports: 1
:INFO:vector table: 0x00075000
SDH:INFO:sd_ble_enable: RAM START at 0x20002c00
SDH:WARNING:sd_ble_enable: app_ram_base should be adjusted to 0x20002798
SDH:WARNING:ram size should be adjusted to 0xd868 
:INFO:After nrf_dfu_transports_init
:INFO:------- nrf_dfu_flash_init-------
:INFO:Waiting for events
```
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67063?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 11:40:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b88d2c7-4586-41cd-8484-dbc3f2cf35d3</guid><dc:creator>Kyle Krueger</dc:creator><description>&lt;p&gt;While checking if the bootloader reaches nrf_bootloader_app_start, I noticed some warnings about RAM configuration.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    SDH:INFO:sd_ble_enable: RAM START at 0x20002c00
    SDH:WARNING:sd_ble_enable: app_ram_base should be adjusted to 0x20002798
    SDH:WARNING:ram size should be adjusted to 0xd868 
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67068?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 10:58:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1515298f-6d08-4154-943f-2b9cb3c5e02d</guid><dc:creator>Kyle Krueger</dc:creator><description>&lt;p&gt;The hex_dump is now attached at the end of the question. Going to check if the software reaches nrf_bootloader_app_start next.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67067?ContentTypeID=1</link><pubDate>Wed, 16 Nov 2016 09:56:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e992c502-f37d-4b0e-bf27-1fc48ebac707</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;If you debug the bootloader after the DFU, does it reach &lt;code&gt;nrf_bootloader_app_start&lt;/code&gt; in &lt;code&gt;main()&lt;/code&gt;? If so, could you try to debug the application? It would be interesting to know if it enters the application and then resets. Lastly, could you read back the flash after DFU to a file and attach it to the question? You can read back the flash and store it to a file using the following command.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfjprog -f nrf52 --memrd 0x00000000 --n 524288 &amp;gt;&amp;gt; hex_dump.txt
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67062?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 10:11:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d53ea860-2ec9-4214-a129-6be4e9309274</guid><dc:creator>Kyle Krueger</dc:creator><description>&lt;p&gt;Hi Bjørn,&lt;/p&gt;
&lt;p&gt;The output from our custom board is reading out as &lt;code&gt;0x0007F020: 00000001 |....|&lt;/code&gt; after flashing the application package with DFU. So the BANK_0 flag is being set properly on update completion. However, the device is not starting the application, and is instead launching DFUTARG.&lt;/p&gt;
&lt;p&gt;This is not the case with the development kit. On the PCA10040 the application launches successfully.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device reboots into DFU Mode after App Update</title><link>https://devzone.nordicsemi.com/thread/67061?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2016 09:03:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adf9331e-a1d6-485f-839e-3b0b61eca130</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Yes, if the if the LFCLK settings were wrong you would not be able to perform DFU. The bootloader would simply hang on ble_stack_init. As for the BANK_0 flag, you can check whether the valid app flag is set by reading the DFU settings page, i.e.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrfjprog -f nrf52 --memrd 0x7f020
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;which should output&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0x0007F020: 00000001                              |....|
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;if the valid app flag is set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>