<?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>Bootloader settings - Current bank value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45940/bootloader-settings---current-bank-value</link><description>using nRF52832, SDK 15.1, custom made units. 
 My Obervations - (in bootloader settings) $nrfutil settings display ota46to47.hex 
 
 when device is flashed &amp;quot;Current bank&amp;quot; value is 0 
 after first attempt of OTA, if it fails - &amp;quot;Current bank&amp;quot; value remains</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Apr 2019 08:10:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45940/bootloader-settings---current-bank-value" /><item><title>RE: Bootloader settings - Current bank value</title><link>https://devzone.nordicsemi.com/thread/180930?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2019 08:10:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78ccac25-8edd-497b-815c-21c0ff4089cb</guid><dc:creator>Andy</dc:creator><description>&lt;p&gt;I&amp;#39;m not 100%&amp;nbsp;sure about this, so take it with a grain of salt. You can test it by yourself.&lt;/p&gt;
&lt;p&gt;The bootloader uses the nrf_dfu_settings struct as a means to know whether a valid application is saved in bank 1. The bootloader then performs a soft-reset, and it checks whether there is a valid app in bank 1 (see&amp;nbsp;nrf_bootloader_fw_activate() in nrf_bootloader_fw_activation.c). Then it proceeds to copy the firmware from bank 1 to bank 0.&lt;/p&gt;
&lt;p&gt;You can follow the code by yourself, maybe the official documentation is not great, but at least the code itself is pretty well self-documented.&lt;/p&gt;
&lt;p&gt;The trick to the bootloader is understanding that the applications are validated and copied &lt;strong&gt;on boot&lt;/strong&gt;, not when the DFU transfer is done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>