<?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>Detecting DFU upgrade</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66143/detecting-dfu-upgrade</link><description>This is really a question about best practice - I have some ideas of ways to do what I want, but wonder if there is some clean API-supported method that I haven&amp;#39;t found... 
 I&amp;#39;m implementing DFU over BLE, and I want my application to &amp;quot;know&amp;quot; that it&amp;#39;s</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Sep 2020 23:48:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66143/detecting-dfu-upgrade" /><item><title>RE: Detecting DFU upgrade</title><link>https://devzone.nordicsemi.com/thread/270700?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 23:48:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95353511-36ef-4a57-b158-85a4993faebf</guid><dc:creator>David Meiklejohn</dc:creator><description>&lt;p&gt;Thanks Hung, that&amp;#39;s an excellent idea.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detecting DFU upgrade</title><link>https://devzone.nordicsemi.com/thread/270630?ContentTypeID=1</link><pubDate>Mon, 21 Sep 2020 13:52:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6727f06-2143-41cc-915d-a658fa8d20df</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi David,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Option 1 and 2 would requires you run a relatively time consuming check every time you boot your application.&amp;nbsp;&lt;br /&gt;Option 3 may have an issue if you&amp;nbsp;have a power reset before you enter the main application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I would think of writing to the start address of bank 1 a magic word, 0xFEEDC0DE for example. When your application booting up, it will check for this magic word at the first address of the first page of bank 1. If it&amp;#39;s 0xFFFFFFFF or something else not 0xFEEDC0DE , the application knows that it should reinitialize the log. It should then erase the first page in bank 1 and re-write the magic word back and continue to reinitialize the log database.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;This should work in both case successful and unsuccessful DFU update. And it works even in case that there was a power failure when switching from bootloader to application. And you don&amp;#39;t need to modify the bootloader.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>