<?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>Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92262/successive-dfu-fail-one-in-two-cases</link><description>Hello, We are using nRF52840 with SDK 15.3.0, a bootloader and the SoftDevice 6.1.1. An update to the same version of application is allowed in our code. We discovered a really annoying problem with DFU but the case is difficult to reproduce each time</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Oct 2022 07:31:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92262/successive-dfu-fail-one-in-two-cases" /><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/388902?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 07:31:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff262fd4-31b6-4a4e-8175-0bcaa236cdb7</guid><dc:creator>Pierre cgwi22</dc:creator><description>&lt;p&gt;Yes it is a dual-bank for sure.&lt;/p&gt;
&lt;p&gt;Even if we don&amp;#39;t understand why it fails like that, restoring the &lt;em&gt;settings_backup_valid&lt;/em&gt; boolean causes the DFU to complete as before. So we will stop the investigation of this problem for the moment, and trying to see what can be the consequences on our app.&lt;/p&gt;
&lt;p&gt;We will send a new post here later if we found more information about this problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/388896?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 06:46:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a368ff1-153e-4466-9c94-0a758212442d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I think I would probably have to reproduce the problem here to understand what is going on.&amp;nbsp;&lt;/p&gt;
[quote user="Pierre cgwi22"]The firsts 12288 bytes of the app data are not in the bank 1, but in bank 0 all data is good and the app is running. I don&amp;#39;t understand how it is possible.[/quote]
&lt;p&gt;Are you sure the bootloader is not just performing a &lt;span&gt;&lt;a title="Single-bank updates" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader_dfu_banks.html?cp=8_1_3_5_1_2_1#lib_bootloader_dfu_single_bank"&gt;Single-bank update&lt;/a&gt;&lt;/span&gt;? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/388197?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 15:22:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a531019-42a8-45c7-9343-e22ecf65aeb1</guid><dc:creator>Pierre cgwi22</dc:creator><description>&lt;p&gt;If we remove it, the DFU is OK but the content of the bank 1 is weird. The firsts 12288 bytes of the app data are not in the bank 1, but in bank 0 all data is good and the app is running. I don&amp;#39;t understand how it is possible.&lt;/p&gt;
&lt;p&gt;Then the second DFU works well too, and this time the bank 0 and bank 1 are both complete.&lt;/p&gt;
&lt;p&gt;So without our modification the bootloader is not blocked in DFU mode, but it was not a problem since more than a year.&lt;/p&gt;
&lt;p&gt;I have seen something during my tests: if I use the debugger with breakpoints to verify the settings values during DFU, the problem doesn&amp;#39;t appear! But if I remove all breakpoints I can see the settings cleared just after the copy of bank 1 in bank 0. Can this issue be based on timing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/388070?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 09:04:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e63a8942-a978-4384-8bde-29cfc2a8a8e3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I see. Is it possible to just revert this change for now to see if it makes any difference? Also, please check that both the application and bootloader is compiled with NRF_DFU_SETTINGS_VERSION=2&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/388060?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 08:38:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5380cb7c-955f-4144-975a-bb254a74ac6a</guid><dc:creator>Pierre cgwi22</dc:creator><description>&lt;p&gt;1. Previously we had a problem with the &amp;quot;backup settings&amp;quot; during a DFU from the application (not in BLE) so we have bypassed the &lt;em&gt;settings_backup_valid&lt;/em&gt; boolean (set to false) in the file &lt;em&gt;nrf_dfu_settings.c&lt;/em&gt; more than one year ago and it worked fine for both application and BLE DFU processes. So it can explain all the zeros because in &lt;em&gt;nrf_dfu_settings_init()&lt;/em&gt; there is an erase of the settings if the CRC is wrong. The question is why it is wrong one in two times?&lt;/p&gt;
&lt;p&gt;2. The DFU is fully handled by the bootloader in BLE. We can use the application too but for this problem we only use the bootloader to be sure it is not the fault of our app.&lt;/p&gt;
&lt;p&gt;3. Yes, the two banks are identical, for valid and failed DFU. Only data in settings are different. So it seems the BLE transfer is good (nRF Connect always indicates a success at the end) but just one in two times something goes wrong in settings --&amp;gt; CRC invalid --&amp;gt; settings erased --&amp;gt; no boot on application even if the data in bank 0 is OK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/388041?ContentTypeID=1</link><pubDate>Tue, 27 Sep 2022 07:28:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dda744f1-9d2c-4181-ad69-2de209009920</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It&amp;#39;s strange that most of the elements from the settings struct are set to zero in the failing case. Some more follow up questions:&lt;/p&gt;
&lt;p&gt;1. Have you made any modifications to the bootloader that might be relevant?&lt;/p&gt;
&lt;p&gt;2. Is the DFU transfer handled by the application or bootloader?&lt;/p&gt;
&lt;p&gt;3. If the update is dual-banked, does the app in bank 1 match the one in bank 0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/387975?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 15:06:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:461dfabb-9899-4f97-8802-9800010e84db</guid><dc:creator>Pierre cgwi22</dc:creator><description>&lt;p&gt;Hi Vidar, thanks for your answer.&lt;/p&gt;
&lt;p&gt;Here are the results for the successful DFU:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Unknown Bootloader DFU settings version: 3922740841&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Bootloader DFU Settings:&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* File:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flash_ok.hex&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Family:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF52840&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Start Address:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* CRC:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xF6C101EB&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Settings Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000002 (2)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* App Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000002 (2)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Bootloader Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000 (0)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Bank Layout:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Current Bank:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Application Size:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00044184 (278916 bytes)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Application CRC:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xAC62AA7C&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Bank0 Bank Code:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000001&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Softdevice Size:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000 (0 bytes)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Boot Validation CRC:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x6DCA1671&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* SD Boot Validation Type:&amp;nbsp; 0x00000000 (0)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* App Boot Validation Type: 0x00000001 (1)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And here for the error state:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Unknown Bootloader DFU settings version: 3922740841&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Bootloader DFU Settings:&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* File:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flash_error.hex&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Family:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF52840&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Start Address:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* CRC:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x54C8C87F&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Settings Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000002 (2)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* App Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000 (0)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Bootloader Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000 (0)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Bank Layout:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Current Bank:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Application Size:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000 (0 bytes)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Application CRC:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Bank0 Bank Code:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Softdevice Size:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00000000 (0 bytes)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Boot Validation CRC:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xACDA1BA2&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* SD Boot Validation Type:&amp;nbsp; 0x00000000 (0)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* App Boot Validation Type: 0x00000000 (0)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After that, the successive DFU alternate between these two results.&lt;/p&gt;
&lt;p&gt;If we compare the settings content in memory, a lot of 0xFFFFFF... (empty parts) are replaced by 0x000000..., the application CRC is lost and the bootloader CRC is different (but data is the same because it is only a DFU for app).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Successive DFU fail one in two cases</title><link>https://devzone.nordicsemi.com/thread/387951?ContentTypeID=1</link><pubDate>Mon, 26 Sep 2022 13:29:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8604202c-d893-4329-8488-ca58b8f32830</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure if I have seen this before. As a start, please run the following commands to compare the bootloader settings content before and after DFU:&lt;/p&gt;
&lt;p&gt;$ nrfjprog --readcode flash_content.hex&lt;/p&gt;
&lt;p&gt;$ nrfutil settings display flash_content.hex&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>