<?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>SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53039/sdk15-2-bootloader-does-not-timeout-even-though-nrf_bl_dfu_inactivity_timeout_ms-is-set</link><description>During a DFU on SDK15.2 the BLE connection is terminated. The NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set to 120000. 
 After 2 minutes, the device still has not reset and started running the application again. 
 This same test on SDK14.0.0 will restart the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Jan 2020 09:51:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53039/sdk15-2-bootloader-does-not-timeout-even-though-nrf_bl_dfu_inactivity_timeout_ms-is-set" /><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/231342?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 09:51:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfd9ec73-61e6-4412-8fd3-299d89ac7ab4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mark,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Each page of the nRF52 is 4kB so we need to count the size with page aligned.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The S132 v6.1/S132v6.2 will occupy 152kB (end address at 0x26000).&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;You app is 159608byte =&amp;gt; 156kB in size.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The bootloader I assume the start address is at 0x78000 by default =&amp;gt; Occupies 32kB. This is required because there are some storage pages for bootloader setting and backup.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;So it&amp;#39;s already occupied 152+156+32=340kB.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume you are using nRF52832 which has 512kB of flash. So we have 172kB left.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Even if you don&amp;#39;t have any application data need to be reserved. It&amp;#39;s still not enough to receive the Softdevice + BL = 152+22= 174kB (occupies 176kB).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can do a quick check by reading the flash out using: nrfjprog --readcode and compare it with the previous hex dump before the update.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you do a SD DFU only or BL DFU only, it should fit into the swap bank and the app should run after that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/231277?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 00:22:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb76a6a9-aa77-4fdb-8e4f-4ec623ff3760</guid><dc:creator>Mark P. Mendelsohn</dc:creator><description>&lt;p&gt;These are the sizes of the BL, SD, and Apps for each of SDK 14.0 and SDK 15.2&lt;/p&gt;
&lt;p&gt;In both instances, the SD being updated is actually smaller in size than the loaded SD.&lt;/p&gt;
&lt;p&gt;The sum of BL+SD is greater for SDK 15.2 than for SDK 14.0&lt;/p&gt;
&lt;p&gt;Force Dual bank is disabled&lt;/p&gt;
&lt;p&gt;#define NRF_DFU_FORCE_DUAL_BANK_APP_UPDATES 0&lt;/p&gt;
&lt;p&gt;SDK14.0 App Segment Size&lt;/p&gt;
&lt;p&gt;340kB -&amp;nbsp;158784&amp;nbsp;= 189376 free&lt;/p&gt;
&lt;p&gt;SDK 15.2 App Segment Size&lt;/p&gt;
&lt;p&gt;328kB - 159608 = 176264 free&lt;/p&gt;
&lt;table width="240"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td width="104"&gt;&lt;/td&gt;
&lt;td width="68"&gt;SDK 14.0.0&lt;/td&gt;
&lt;td width="68"&gt;Update&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BL&lt;/td&gt;
&lt;td&gt;23280&lt;/td&gt;
&lt;td&gt;23280&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SD 5.0.0/5.1.0&lt;/td&gt;
&lt;td&gt;136360&lt;/td&gt;
&lt;td&gt;123012&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sum BL+SD&lt;/td&gt;
&lt;td&gt;159640&lt;/td&gt;
&lt;td&gt;146292&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App&lt;/td&gt;
&lt;td&gt;158784&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;SDK 15.2.0&lt;/td&gt;
&lt;td&gt;Update&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BL&lt;/td&gt;
&lt;td&gt;23040&lt;/td&gt;
&lt;td&gt;23040&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SD 6.1.0/6.1.1&lt;/td&gt;
&lt;td&gt;148332&lt;/td&gt;
&lt;td&gt;147792&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sum BL+SD&lt;/td&gt;
&lt;td&gt;171372&lt;/td&gt;
&lt;td&gt;170832&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App&lt;/td&gt;
&lt;td&gt;159608&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Looks like there is room for the DUAL Bank DFU to take place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/231183?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 14:08:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5453494-d386-43d4-b382-fd185add711d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mark,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To clarify, if the SD+BL is performed with dual bank update ,and if the size of the SD is not changed, the application will be retained. If not the application will be erased. If the SD+BL size is bigger than the swap area, the singe bank update will be performed automatically&amp;nbsp;(unless you configured not to use singlebank).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In the case that the application is erased, the application is only put back if you do another DFU for the app. This either be done by the DFU master automatically if you do an APP+SD+BL update or done manually if you only do DFU for SD+BL.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;To avoid the case being drag for long time without solving your issue. Please summarize with bullet points on the issue(s) you currently have. Please send us any code that we can reproduce the issue here.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/230945?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2020 20:07:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f5c3c80-d8b6-4fc3-a895-11275c22505e</guid><dc:creator>Mark P. Mendelsohn</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bootloader_5F00_debug.log"&gt;devzone.nordicsemi.com/.../bootloader_5F00_debug.log&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Attached is an RTT log of the buttonless DFU application with a BL + SD update with a debug Bootloader. It just hangs after the DFU finishes. The production code is based on SDK 15.2. This used to work in SDK 14.0. Although the reference you mention says that the application is saved during the DFU, it also states that the Application is put back after the DFU is completed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/230387?ContentTypeID=1</link><pubDate>Wed, 22 Jan 2020 14:14:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0db02d1b-48ee-4c65-a5f0-b14e37bbc36c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mark,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a normal behavior.&amp;nbsp;The reason for that is that the application is erased when you have a successful BL+SD update or if you do single bank update. And when there is no application,&amp;nbsp; the board will stay in Bootloader mode until there is a DFU&amp;nbsp;of the app.&amp;nbsp;&lt;br /&gt;You can read more about that here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_bootloader_dfu_banks.html?cp=7_1_3_5_1_2"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_bootloader_dfu_banks.html?cp=7_1_3_5_1_2&lt;/a&gt;&lt;br /&gt;Single bank update is triggered if there isn&amp;#39;t enough space for the new softdevice + BL image. You can disable this automatic switch to single bank feature.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/230188?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2020 23:45:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af259515-b937-4d39-95c7-195b3df1a7de</guid><dc:creator>Mark P. Mendelsohn</dc:creator><description>&lt;p&gt;Some more testing shows that sending BL+SD does not return. Bootloader is still running because advertising can still be seen. The continuation timer is set to the default 10 seconds. The inactivity timer is also set to the default of 120 seconds. Running with no debugger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/229911?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2020 14:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20b6bd5d-6cd3-45a8-950c-447508a84a1b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Could you reproduce with the stock bootloader and the DFU buttonless example? &lt;br /&gt;If you could, please send us your DFU buttonless that you have your code to start WDT so we can test here.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/229821?ContentTypeID=1</link><pubDate>Mon, 20 Jan 2020 12:11:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac2fa171-81d3-4366-add9-c8d467e1fa36</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;We have a case here stating that it went to the inactivity timeout handler when in debug mode but not when it&amp;#39;s running without the debugger.&amp;nbsp;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/52036/freertos-with-wdt-reset-problem-nrfjprog/212193"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/52036/freertos-with-wdt-reset-problem-nrfjprog/212193&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Could you check if it&amp;#39;s the case for you ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, as I mentioned the&amp;nbsp;&lt;span&gt;bootloader_reset() doesn&amp;#39;t do reset immediately but will trigger and wait for the bootloader setting to be written in flash before the actual reset. One thing you can do is to put the reset code :&amp;nbsp;NVIC_SystemReset() right into the inactivity_timeout() before the&amp;nbsp;bootloader_reset() and run in normal mode and check if the board get reset ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you enable reload register RR7 when you enable WDT ? We have a bug inside&amp;nbsp;wdt_feed() that we don&amp;#39;t feed the&amp;nbsp;NRF_WDT_RR7 in the loop.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/229687?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 16:46:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:437d0c7f-331a-4488-b58b-d78d88a9529f</guid><dc:creator>Mark P. Mendelsohn</dc:creator><description>&lt;p&gt;The screenshot previously posted shows that the inactivity timer does get triggered.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Correction: The bootloader is advertising after the reset fails.&lt;/p&gt;
&lt;p&gt;The SDK15.2 Bootloader will automatically feed the WDT if it is running by default.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/229595?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2020 12:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d92cc8f-0cdb-42e1-a507-23c9d9c109ed</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mark,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Could you check if the inactivity timeout is triggered or not ?&amp;nbsp;&lt;br /&gt;If the reset didn&amp;#39;t happen, what does the bootloader do ? does it advertise ?&amp;nbsp;&lt;br /&gt;How do you feed the WDT inside the bootloader ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/229494?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 22:13:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db98f64f-0197-46ba-aaf8-b7807dc83850</guid><dc:creator>Mark P. Mendelsohn</dc:creator><description>&lt;p&gt;Determined that the issue is related to the use of WDT. When WDT is enabled, the reset does not work. When WDT is disabled, the reset is working. We need WDT enabled. Even with WDT enabled on SDK14.0.0 Bootloader, it was still able to reset.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/214195?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 13:59:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91cfe76f-b4bb-4bfa-9580-97cd05f271f9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mark,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;bootloader_reset() doesn&amp;#39;t do the reset immediately. It will try to store the bootloader setting ( to store the DFU progress)&amp;nbsp; before triggering a reset. Normally the actual reset (inside reset_after_flash_write()) should be triggered after the write command finished (a callback from softdevice). There must be something causing the callback event not to arrive.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you reproduce the issue every time or it only happens occasionally ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you checked if you have the same problem on SDK v15.3 ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you check if&amp;nbsp;settings_write() inside settings_backup() return NRF_SUCCESS, and reset_after_flash_write() is called ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SDK15.2 Bootloader does not timeout even though NRF_BL_DFU_INACTIVITY_TIMEOUT_MS is set</title><link>https://devzone.nordicsemi.com/thread/214009?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 20:38:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85f01c9d-6cf5-4a14-a68f-949a28100dbc</guid><dc:creator>Mark P. Mendelsohn</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/BootloaderTimeoutSDK15.2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>