<?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>Reverting DFU using dual bank</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38465/reverting-dfu-using-dual-bank</link><description>Hi! 
 I use SD 6.0.0 and SDK 15.0. 
 I am developing an application and I want it to include service of buttonless OTA firmware updating. So far I have managed to zip my application and send it over bluetooth to my chip. Nothing special. 
 I am still</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Sep 2018 13:20:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38465/reverting-dfu-using-dual-bank" /><item><title>RE: Reverting DFU using dual bank</title><link>https://devzone.nordicsemi.com/thread/148639?ContentTypeID=1</link><pubDate>Thu, 13 Sep 2018 13:20:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8229d14-9a84-49d5-8777-ee4c44a7ccfb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Pawel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is possible, however, this will require &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;major&lt;/strong&gt;&lt;/span&gt; changes to the bootloader as well as in the application code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The first think you would need to address is the SoftDevice interrupt forwarding scheme, i.e. the SoftDevice expects the application to be located directly after the SoftDevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hence, if you want to have multiple applications in the application space you will need to create a small application, placed directly on top of the SoftDevice, that forwards the SoftDevice interrupts/events to the correct application. This is similar to&amp;nbsp;what we do in our&amp;nbsp;MBR when jumping to the bootloader if it is present and directly to the application if not, see&amp;nbsp;&lt;a title="Master boot record and bootloader" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/mbr_bootloader/mbr_bootloader.html?cp=2_3_1_0_11"&gt;Master boot record and bootloader&lt;/a&gt;&amp;nbsp;in the Softdevice specification for more information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The second hurdle you would have to pass is modifying the bootloader so that the DFU banks starts after this application MBR and find a way to tell the application MBR where the new and old application starts. We use the UICR registers for this with the bootloader, but in our case the bootloader start address is fixed, in your case i would imagine that the application may grow in size. It is possible to modify the UICR registers from runtime, but if a power failure occurs during the update you might end up with a bricked device if the jump address(es) are only partially written.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The third hurdle is the actual DFU process, you will have to modify the bootloader so that the old application is not erased after the new image has been received and validated and then update only one of the two merged applications.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With our implementation you can always perform a new DFU there is an issue with the application and the bootloader is the fallback should anything happen to the app.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>