<?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>Using the DFU SDK 12.1 with a BLE command to jump to &amp;#39;bootloader&amp;#39; works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17767/using-the-dfu-sdk-12-1-with-a-ble-command-to-jump-to-bootloader-works-every-other-time-with-nordic-connect-app</link><description>We have been using the DFU that came with the sdk 12.1 with a modification (essentially removing the button from the DFU code). We currently send an application command that will tell the code to &amp;#39;jump&amp;#39; to the bootloader. This works great. Once the app</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Apr 2017 14:36:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17767/using-the-dfu-sdk-12-1-with-a-ble-command-to-jump-to-bootloader-works-every-other-time-with-nordic-connect-app" /><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68442?ContentTypeID=1</link><pubDate>Fri, 07 Apr 2017 14:36:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a029bb90-be22-4ac9-a085-1c8d34b2e083</guid><dc:creator>etienne</dc:creator><description>&lt;p&gt;@kamisen sorry for the delay... We find out that the compiler options in release &lt;code&gt;-Ofast -flto -ffat-lto-objects&lt;/code&gt; break the DFU OTA process.
What we did, is to build the nano_ecc with the same compiler options as in the sdk example and then we replaced the release options only with &lt;code&gt;-0s&lt;/code&gt;.
BTW we use the SDK 12.2.0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68441?ContentTypeID=1</link><pubDate>Fri, 07 Apr 2017 14:20:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca9c1a8f-1d67-476e-93e2-6cf11e253fcc</guid><dc:creator>kamisen</dc:creator><description>&lt;p&gt;@etienne &amp;quot;by checking and fixing the compiler optimisation flag for the nano_ecc library&amp;quot;, any detail?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68440?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2017 10:34:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0152fc9-7673-4365-a6bc-8b8df5cdc423</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@etienne: Could you post the changes you had to do in the comment section?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68439?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2017 09:13:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87e6c483-c0c1-45a0-8b94-e7a3aa3a464e</guid><dc:creator>etienne</dc:creator><description>&lt;p&gt;Hi sananth, like i said it before we had the same issue. What i forgot in my last comment, was to mention that we also fixed it by checking and fixing the compiler optimisation flag for the nano_ecc library...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68438?ContentTypeID=1</link><pubDate>Mon, 03 Apr 2017 08:04:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6063e5d-a441-41b7-b37f-ee76932c8ff4</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@kamisen: I will follow your question and work on the issue with Hung. I would appreciate if we could move the conversation to that thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68436?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 14:47:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a54b320a-501a-4b98-b24d-a5ce241b387f</guid><dc:creator>kamisen</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/123513/buttonless-secure-dfu-with-wdt-needs-dfu-twice/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;
here is my post&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68435?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 14:17:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:302f6364-3df4-446c-ae94-76927fd585f0</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@kamisen: Which WDT interval are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68437?ContentTypeID=1</link><pubDate>Sat, 25 Mar 2017 08:54:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04f85fb4-ae42-4061-9d2e-635b25b59489</guid><dc:creator>kamisen</dc:creator><description>&lt;p&gt;I met the same question. But even I reloading the WDT in the bootloader main before nrf_bootloader_init was called, the twice DFU situation happen again. Have you solved this issue?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68434?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 16:30:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b2dc385-2a94-49fa-8994-96c0d60ee4af</guid><dc:creator>etienne</dc:creator><description>&lt;p&gt;hi sananth,
we had exactly the same issue... when we reloaded the WDT in wait_for_event &amp;amp; nrf_dfu_wait in nrf_dfu.c after configuring and enabling it on the App side. Changing the timeout did not change anything.
But only reloading the WDT in the bootloader main before nrf_bootloader_init was called, fixes the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68433?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2016 09:15:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1b653cb-587f-4a09-9742-41237717929c</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;If there is only the SoftDevice and the bootloader present, then you should &lt;strong&gt;not&lt;/strong&gt; reach &lt;code&gt;nrf_bootloader_app_start&lt;/code&gt; in &lt;code&gt;nrf_dfu.c&lt;/code&gt;. If you read the bank 0 code at 0x0007F020 it should be 0x00000000. After the DFU of the applications it should be set to 0x00000001 and the nrf_dfu_app_is_valid check should return true.&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: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68432?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 15:47:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0e42606-9172-44f7-b685-ae5cbd6db30c</guid><dc:creator>sananth</dc:creator><description>&lt;p&gt;From a clean start (e.g. just soft device and bootloader running in debug mode), it does reach that line and execute it. I left the bootloader on debug and try to reload again and the phone acts as if the app was successfully loaded yet that same line in code is never reached.  I try again, and it reaches that line.  So essentially every other time it reaches that nrf_bootloader_app_start line.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68431?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 15:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:879bdc64-6b86-4d02-ade7-3613b5e604e6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I checked the &amp;quot;Not working hex file&amp;quot; and the dfu settings bank_0 code is set to NRF_DFU_BANK_VALID_APP, i.e.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 0x0007F020: 00000001
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This means that the bootloader should reach nrf_bootloader_app_start in nrf_dfu.c (should be at line 143 in nrf_dfu.c). Could check this by debugging the bootloader?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68430?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 15:26:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62dbac76-92a1-4080-8c5f-6e6299d05551</guid><dc:creator>sananth</dc:creator><description>&lt;p&gt;Hi Bjorn&lt;/p&gt;
&lt;p&gt;I ran the above line twice.  Once when things load properly (here is the output):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/open?id=0B9Eb5KyOypUVY3JpVlVfYVNoXzQ"&gt;Working Hex file&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And when things don&amp;#39;t (here is the file):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://drive.google.com/open?id=0B9Eb5KyOypUVRHdpcVMxcHRkbHM"&gt;Not working hex file&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I used a hex file comparator and the working one has values in place where the not working one has 0xFF&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68429?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 14:40:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aff582f-1193-48ae-a453-81857899b7d9</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;If you debug the bootloader after the DFU, does it reach nrf_bootloader_app_start in nrf_dfu.c (should be at line 143 in nrf_dfu.c)? If so, could you try to debug the application? Lastly, could you read back the flash after a failed 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: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68428?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 14:27:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45f971f4-7c48-40a2-a8b3-91603b0c3fd3</guid><dc:creator>sananth</dc:creator><description>&lt;p&gt;Hi Bjorn,&lt;/p&gt;
&lt;p&gt;We start/setup the watchdog right before we enter the&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for (;;)
{
    app_sched_execute();
    UTIL_kickWatchdog();
    APP_ERROR_CHECK(sd_app_evt_wait());
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is hard to pinpoint when the failure occurs.  We currently have an led that is one during the bootloader phase.  It most likely is happening at the end of the bootloading (or at least that is my guess).  As when it works the led blinks really quickly and shuts off.  Versus when it doesn&amp;#39;t work the led goes off and within a second is back on.  All signs on the nordic phone app make it seem like it correctly boot loaded.&lt;/p&gt;
&lt;p&gt;Do you have an suggestions on what to try to debug this better? So I can provide more info&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68427?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2016 13:16:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33a64890-02c9-41bc-8c29-0f18f49b9c84</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I&amp;#39;ve done some testing with the bootloader where I initialize and start the WDT right after entering main(). I am not seeing any issues with a WDT timeout interval of 2 seconds, so I do not think you should be breaking any timing requirements in the bootloader. When does the failures occur?  I would expect that you sometimes could run into some issues as the device is jumping from application mode to bootloader mode, i.e. if you jump at the end of the WDT interval in the application then the WDT might expire before you reach the wait_for_event() loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68426?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2016 19:53:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83a6b8b6-957d-4e54-9146-283d0db2a1e0</guid><dc:creator>sananth</dc:creator><description>&lt;p&gt;Hi Bjorn&lt;/p&gt;
&lt;p&gt;I added what you recommend to the code, but it still fails sporadically.  when the WDT has a timeout of 2000.&lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;
&lt;p&gt;Thanks again for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68425?ContentTypeID=1</link><pubDate>Mon, 21 Nov 2016 12:48:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6275797-b5b8-4875-b11e-cc84854215b6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Could you try to feed the WDT in the location suggested by &lt;a href="https://devzone.nordicsemi.com/question/103394/s130-dfu-ble-bootloader-no-timeout/"&gt;this&lt;/a&gt; post?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68424?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2016 16:32:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f90efad2-ca36-47b9-b146-154c21884d01</guid><dc:creator>sananth</dc:creator><description>&lt;p&gt;I&amp;#39;ve zipped both the DFU and nrf5_Sdk folders but they  might be too large too attach so have used a link to a google drive folder...&lt;a href="https://drive.google.com/open?id=0B1GPEqxvhoMnX2RwcVo0OUloVDg"&gt;attached zipped files&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68423?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2016 15:34:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1554ec6f-5095-400e-821d-5db425a63db9</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, if you have set &lt;code&gt;ble_enable_params.gatts_enable_params.service_changed = 1;&lt;/code&gt; then you should be O.K. Have you done the same in the application? Hmm, I dont see why the WDT should only fire every other time. Can you attach the bootloader project to your quetion so I can test it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68422?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2016 14:11:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72d4452c-99f3-4c46-9c4f-79aaf99cb76b</guid><dc:creator>sananth</dc:creator><description>&lt;p&gt;Hi Bjorn,&lt;/p&gt;
&lt;p&gt;Thanks for the response, it is set to 0.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define SOFTDEVICE_GATTS_SRV_CHANGED   0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but we have&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_enable_params.gatts_enable_params.service_changed = 1;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Also we have experimented with increasing the timeout on the WDT and things work fine with these settings:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#ifndef WDT_CONFIG_BEHAVIOUR
#define WDT_CONFIG_BEHAVIOUR 0
#endif

// &amp;lt;o&amp;gt; WDT_CONFIG_RELOAD_VALUE - Reload value  &amp;lt;15-4294967295&amp;gt; 


#ifndef WDT_CONFIG_RELOAD_VALUE
#define WDT_CONFIG_RELOAD_VALUE 5000
#endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What we are worried about is if the WDT_VALUE is set to 2000 it works only every other time.  We don&amp;#39;t want to set the config value to something large as we need the WDT timeout to be shorter for the main application. We aren&amp;#39;t sure why the WDT is firing every other time.  I added the NRF_WDT-&amp;gt;RR[0] = WDT_RR_RR_Reload; in the DFU in the wait_for_event() loop as recommended by this forum...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;       NRF_WDT-&amp;gt;RR[0] = WDT_RR_RR_Reload; //ADDED
       app_sched_execute();
       NRF_WDT-&amp;gt;RR[0] = WDT_RR_RR_Reload; //ADDED
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using the DFU SDK 12.1 with a BLE command to jump to 'bootloader' works every other time with nordic connect app</title><link>https://devzone.nordicsemi.com/thread/68421?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2016 09:30:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04407399-dc08-44b7-9e0b-8124660d3ecc</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Is the &lt;code&gt;SOFTDEVICE_GATTS_SRV_CHANGED&lt;/code&gt;define in &lt;code&gt;softdevice_handler.c&lt;/code&gt; set to 1, i.e. &lt;code&gt;#define SOFTDEVICE_GATTS_SRV_CHANGED 1&lt;/code&gt; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>