<?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>Over-the-air DFU requires two uploads (SDK12.0.0 + S132 3.0.0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18677/over-the-air-dfu-requires-two-uploads-sdk12-0-0-s132-3-0-0</link><description>We made a version of bootloader_secure for our own purposes. The problem is now that application must be uploaded twice into the device (nRF52) before it really gets updated. I guess it is because of dual banking and for some reason, the bank is not changed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Jan 2017 11:39:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18677/over-the-air-dfu-requires-two-uploads-sdk12-0-0-s132-3-0-0" /><item><title>RE: Over-the-air DFU requires two uploads (SDK12.0.0 + S132 3.0.0)</title><link>https://devzone.nordicsemi.com/thread/72115?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 11:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f52aae68-28b3-40ac-a6f1-08c002d85329</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;The final application should always be copied starting from MAIN_APPLICATION_START_ADDR ( right after the softdevice) regardless it was updated using dual bank or single bank. Please have a look &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/lib_bootloader_dfu_banks.html?cp=4_0_1_3_5_1_2"&gt;here&lt;/a&gt; with attention to &amp;quot;DFU flash operations for a dual-bank application update&amp;quot; and &amp;quot;DFU flash operations for a single-bank application update&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Over-the-air DFU requires two uploads (SDK12.0.0 + S132 3.0.0)</title><link>https://devzone.nordicsemi.com/thread/72116?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 11:22:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9861baec-7d5f-4c22-9876-58c9be3bc5b1</guid><dc:creator>Jarmo</dc:creator><description>&lt;p&gt;The first flash is also do with DFU and it works as expected. After that, I need to do DFU twice, always.&lt;/p&gt;
&lt;p&gt;The original bootloader_secure uses also nrf_bootloader_app_start(MAIN_APPLICATION_START_ADDR), so how can it work with dual banking, if you say that call does not take dual banking into consideration? Is that a bug?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Over-the-air DFU requires two uploads (SDK12.0.0 + S132 3.0.0)</title><link>https://devzone.nordicsemi.com/thread/72120?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 09:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0df33706-3545-46cc-be79-f76601fc19c4</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jarmo,&lt;/p&gt;
&lt;p&gt;The bootloader_secure is at production level, it&amp;#39;s tested properly. Could you try to test again with the unmodified bootloader debug version and the provided .zip package in \examples\dfu\ble_dfu_send_hex\test_images_update_nrf52 ?&lt;/p&gt;
&lt;p&gt;How did you flash your application for the first time, would it work when u do the first DFU or also only works on the second trial ?&lt;/p&gt;
&lt;p&gt;nrf_bootloader_app_start() won&amp;#39;t take dualbank or single bank into consideration, it simply start the application at MAIN_APPLICATION_START_ADDR which is the address right after the softdevice.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Over-the-air DFU requires two uploads (SDK12.0.0 + S132 3.0.0)</title><link>https://devzone.nordicsemi.com/thread/72119?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 14:31:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dbf67a6-e19e-4299-9e9d-b8c592791c91</guid><dc:creator>Jarmo</dc:creator><description>&lt;p&gt;It does not stay in bootloader but enters into the previous version of application. Is it sure that the original example (bootloader_secure) works correctly? Because everything looks to work, It took me a while to notice that the application is truly updated only after the second upload. In the bootloader main.c there is the call nrf_bootloader_app_start(MAIN_APPLICATION_START_ADDR), is that taking dual banking into consideration?&lt;/p&gt;
&lt;p&gt;The way I got the system finally working was to disable dual banking brutally from nrf_dfu_utils.c. What would be the correct way to set dual banking off, to use NRF_DFU_BANK_LAYOUT_SINGLE?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Over-the-air DFU requires two uploads (SDK12.0.0 + S132 3.0.0)</title><link>https://devzone.nordicsemi.com/thread/72118?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 14:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a4d285c-851f-4809-8413-9df5d765c8bc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;The bank swapping is done inside nrf_dfu_app_continue().&lt;/p&gt;
&lt;p&gt;What do you have after :INFO:num transports: 1 ? Would the device reset and you are back to main ?
You may want to post the full log. You may also add a break point ad check why the new application is not consider valid app (nrf_dfu_app_is_valid()) and the bootloader stay in bootloader mode instead of the application.&lt;/p&gt;
&lt;p&gt;You can also record the two logs, and compare what make the difference between the first and the second update.&lt;/p&gt;
&lt;p&gt;Have you tried to get the hex dump and check if the image is actually copied into bank 1 (or bank 0 if you are using single bank) .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Over-the-air DFU requires two uploads (SDK12.0.0 + S132 3.0.0)</title><link>https://devzone.nordicsemi.com/thread/72117?ContentTypeID=1</link><pubDate>Fri, 30 Dec 2016 13:30:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e50e74b3-f418-41f4-8a36-9e94e066b8ec</guid><dc:creator>Jarmo</dc:creator><description>&lt;p&gt;I have now tried to set     s_dfu_settings.bank_layout = NRF_DFU_BANK_LAYOUT_SINGLE after nrf_dfu_settings_init() but this did not help. Debug prints look like following. After first upload, it says &amp;quot;Current bank is bank 0&amp;quot; but then it stays always at bank 1.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:INFO:Doing postvalidate
:INFO:Current bank is bank 1
:INFO:Successfully run the postvalidation check!
:INFO:Erasing old settings at: 0x0007f000
:INFO:Could not queue writing of DFU Settings
:INFO:Erasing old settings at: 0x0007f000
:INFO:Could not queue writing of DFU Settings
:INFO:Erasing old settings at: 0x0007f000
:INFO:Erasing: 0x0007f000, num: 1
:INFO:Writing 0x00000057 words
:INFO:Writing settings...
:INFO:Sending Response: [0x4, 0x1]
:INFO:Resetting device. 
:INFO:In nrf_dfu_transports_close
:INFO:num transports: 1
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>