<?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>Problem Completing a DFU Update</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97083/problem-completing-a-dfu-update</link><description>I&amp;#39;ve developing an application for the nRF52833 that uses the v7.2.0 s140 Soft Device and the secure BLE DFU bootloader. 
 
 I&amp;#39;m able to compile the bootloader (taken from examples\dfu\secure_bootloader\pca10100_s140_ble) 
 I&amp;#39;m able to compile my application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Mar 2023 20:10:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97083/problem-completing-a-dfu-update" /><item><title>RE: Problem Completing a DFU Update</title><link>https://devzone.nordicsemi.com/thread/414243?ContentTypeID=1</link><pubDate>Wed, 08 Mar 2023 20:10:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8451cb5-62a0-455c-868b-6ed0720ad019</guid><dc:creator>Jeremy</dc:creator><description>&lt;p&gt;I found some more time to dig into my assumptions, and think I&amp;#39;m good to go now. Just a summary post to wrap this up in case somebody finds this in the future.&lt;/p&gt;
&lt;p&gt;My problem&amp;nbsp;&lt;em&gt;did&lt;/em&gt; have to do with the Bluetooth Mesh flash configuration getting corrupted during the dfu update process. If I add a &amp;quot;stack_config_clear_and_reset()&amp;quot; call to the power-on initialize function my application works being deployed multiple times in a row without issue.&lt;/p&gt;
&lt;p&gt;Of course, clearing Mesh configuration every power-up and needing to rejoin the network isn&amp;#39;t ideal, but I found another helpful post on the DevZone that addresses passing data between the bootloader and application (&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33530/ram-variables-exchange-between-bootloader-and-application"&gt;RAM variables exchange between bootloader and application&lt;/a&gt;&amp;nbsp;). I haven&amp;#39;t actually implemented this yet, but being able to optionally trigger the configuration wipe only after a firmware update by setting a flag from the bootloader solves my issue completely.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem Completing a DFU Update</title><link>https://devzone.nordicsemi.com/thread/412853?ContentTypeID=1</link><pubDate>Wed, 01 Mar 2023 23:17:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f4d341f-a444-4e3a-b692-6d4c099c6c6a</guid><dc:creator>Jeremy</dc:creator><description>&lt;p&gt;I&amp;#39;m aware of the different memory layout, I was just clarifying that I adjusted the &amp;quot;blinky&amp;quot; example to include the s140 SoftDevice (adding &amp;quot;debug_additional_load_file&amp;quot;, the &amp;quot;S140&amp;quot; preprocessor definition, and changing FLASH_START to 0x2700) so it would be compatible with my application which also uses the s140 bootloader.&lt;/p&gt;
&lt;p&gt;I was able to successfully deploy this modified blinky example, which to me confirms that:&lt;/p&gt;
&lt;p&gt;1. The combined image is valid (SD + custom application + bootloader)&lt;br /&gt;2. The DFU update process is working (&amp;quot;blinky&amp;quot; started normally after being deployed via BLE DFU)&lt;/p&gt;
&lt;p&gt;The question that remains is why my custom application is unable to be deployed in the same way. It works the first time (if I flash a naked bootloader and start with a DFU update), but if I drop back to the bootloader or start with the combined image, &amp;quot;re-deploying&amp;quot; the custom application succeeds but it fails to start.&lt;/p&gt;
&lt;p&gt;My custom application uses Bluetooth Mesh which I believe relies on configuration data written to dynamic flash pages, and I think that&amp;#39;s where my issue is coming from. I could attempt to clear all stored data and re-provision, but I&amp;#39;d like to only do that after a firmware update and not every time the device is powered on.&lt;/p&gt;
&lt;p&gt;My questions are:&lt;/p&gt;
&lt;p&gt;1. Does this hypothesis about corrupted Bluetooth Mesh flash configuration data pages make sense?&lt;br /&gt;2. What would be the best way to send a signal to the application from the bootloader to inform it that an update has just taken place and it needs to clear it&amp;#39;s data and re-provision?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;Jeremy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem Completing a DFU Update</title><link>https://devzone.nordicsemi.com/thread/412576?ContentTypeID=1</link><pubDate>Tue, 28 Feb 2023 16:00:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:109f4f31-2e37-401e-83ed-b9e0014e3f6c</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It sounds like you found the explanation, yes. The applications that do not require a SoftDevice (SD) and the applications who do, have different memory layout. In nRF5 SDK, for applications with SD, the SD will occupy the beginning of flash with the application on top. For applications without SD, the application is placed where the SD would otherwise be. This definitely could mess up things if DFU-ing from one to the other, yes. Allowing such updates (from SD to no-SD or from no-SD to SD) might require changes to the DFU bootloader. We do however support SD updates where the SD changes in size, although that does void the application so you would then have to use DFU for installing a new application which starts at the end of the new SD.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem Completing a DFU Update</title><link>https://devzone.nordicsemi.com/thread/412362?ContentTypeID=1</link><pubDate>Mon, 27 Feb 2023 21:19:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1e6b48a-4b1e-4878-997a-8d4256d97835</guid><dc:creator>Jeremy</dc:creator><description>&lt;p&gt;I should have thought of this earlier, but I compiled &amp;quot;blinky&amp;quot; modified for the nRF52833 PCA10100 and to include the s140 Soft Device (not needed for blinky, but to keep the overall memory architecture the same), and it is able to deploy without issue.&lt;/p&gt;
&lt;p&gt;That is to say I flash the &amp;quot;combined&amp;quot; firmware (sd + custom app + bootloader + bootloader settings), signal my custom app to drop to the bootloader, then deploy the new &amp;quot;blinky&amp;quot; test via BLE DFU. After the DFU update finishes, &amp;quot;blinky&amp;quot; appears to start up and work without issue.&lt;/p&gt;
&lt;p&gt;I believe this confirms my suspicion that I don&amp;#39;t have a&amp;nbsp;DFU issue, but a first run issue that only comes up when I try to overwrite my custom application with another version of the same BLE Mesh application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>