<?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>How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50680/how-to-use-dfu-ota-with-custom-fw</link><description>Hello, we are using 3 nRF52840 DKs, NSDK 15.2, Mesh SDK 3.1.0, SoftDevice 6.1.0 and Segger Embbeded Studio as my IDE. 
 I have followed the documentation here to program some boards over the air and had SOME success. 
 I understood that the process has</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Aug 2019 13:18:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50680/how-to-use-dfu-ota-with-custom-fw" /><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202842?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2019 13:18:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ff6f736-7575-4656-960b-f745c62591b0</guid><dc:creator>rmarques</dc:creator><description>[quote userid="2121" url="~/f/nordic-q-a/50680/how-to-use-dfu-ota-with-custom-fw/202831"]You are correct. After you has updated your application to the blinky example it won&amp;#39;t be able to be updated (without manually switching it to bootloader mode).&amp;nbsp;[/quote]
&lt;p&gt;Thank you! After reading the documentation (for 3.1.0 at least), I was unsure if the bootloader handled background updating of the application or if that was only possible if a DFU compatible application took care of that. If I understood correctly, if the application does not have the DFU feature it cannot be updated in background, only in bootloader mode, is that right?&lt;/p&gt;
[quote userid="2121" url="~/f/nordic-q-a/50680/how-to-use-dfu-ota-with-custom-fw/202831"]You need to integrate DFU feature into your application to do mesh DFU (without manually put it to bootloader mode). To do that you would need to follow this &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.2.0/md_doc_libraries_dfu_integrating_dfu.html?cp=5_2_2_2_2"&gt;guide&lt;/a&gt;.&amp;nbsp;[/quote]
&lt;p&gt;Ah! That guide wasn&amp;#39;t present in 3.1.0! :) That is exactly what I was looking for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202831?ContentTypeID=1</link><pubDate>Wed, 07 Aug 2019 12:38:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da20a117-b7f2-49fa-abad-1b1b6c27b6dc</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Rmarques,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You are correct. After you has updated your application to the blinky example it won&amp;#39;t be able to be updated (without manually switching it to bootloader mode).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You need to integrate DFU feature into your application to do mesh DFU (without manually put it to bootloader mode). To do that you would need to follow this &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.meshsdk.v3.2.0/md_doc_libraries_dfu_integrating_dfu.html?cp=5_2_2_2_2"&gt;guide&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The dfu project is a good source for reference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202685?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 17:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74ced9a5-c8e9-4b12-b78a-78eabe1cb0ef</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;I think I figured it out.&lt;/p&gt;
&lt;p&gt;Firstly, I had some problems in my script. I am still not 100% sure it was from that, but I can now use any one of the 3 boards to initiate the DFU transfer reliably, I tried each once and every time it worked.&lt;/p&gt;
&lt;p&gt;Secondly, after moving to Mesh SDK v3.2 and Nordic SDK 15.3 AND discarding signature verification (can&amp;#39;t tell what caused the following result), nRFConnect now shows me this&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/200x300/__key/communityserver-discussions-components-files/4/blocks.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/414x255/__key/communityserver-discussions-components-files/4/blocks_2D00_size.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The third block from the bottom is the example blinky application in meshsdk/bin/blinky and the forth block in black/dark grey is the rest of the dfu example application that the documentation advises to program into the board the first time.&lt;/p&gt;
&lt;p&gt;What I THINK is happening is that after programming the blinky application once, the boards cannot be reprogrammed anymore over the air since the application that took care of that does not exist anymore. That forth block from the bottom is just junk. Am I right? Is the application responsible for handling the DFU packets? Or is the mbr/bootloader/softdevice the only parts taking care of that?&lt;/p&gt;
&lt;p&gt;Answering this would answer my original question, I would need to include in my applications the code that is part of the DFU example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202682?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 16:58:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebfa79b9-aed8-4e90-bc84-de532c181621</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;Also, removing the signature verification does nothing regarding the start of DFU transfer. Quote from the documentation:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;As the entire firmware data is required for the hash, the signature is not checked until after the entire transfer is complete.&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202676?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 16:35:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a3c02d3-2a0e-48c7-8e64-5b28bd090a4d</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;Did not work. I am now using Mesh SDK v3.2 and Nordic SDK 15.3.&lt;/p&gt;
&lt;p&gt;In fact, now the LEDs start blinking but that might be just because I stopped using signature verification, after removing the &lt;strong&gt;public_key&lt;/strong&gt; attribute from &lt;strong&gt;nrf5SDKforMeshv320src/tools/dfu/bootloader_config_default.json&lt;/strong&gt; and removing the &lt;strong&gt;--key-file private_key.txt&lt;/strong&gt; option from &lt;strong&gt;nrfutil dfu genpkg&lt;/strong&gt; when generating the firmware archive.&lt;/p&gt;
&lt;p&gt;The behaviour of the boards is not predictable either since after reprogramming everything from step 4, I was using /dev/ttyACM0 to test the DFUOTA in step 5 and it never worked. Tried using /dev/ttyACM1 and it worked... ONCE!&lt;/p&gt;
&lt;p&gt;That time all 3 boards started blinking the 4 LEDs. I could not repeat the experiment though, despite having step 4 scripted to run over the 3 boards automatically, including generating the device page from the bootloader_config_default.json using the &lt;strong&gt;device_page_generator.py&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Is it possible I have a problem with the serial driver or some library misconfigured? I can always program step 4 but sometimes step 5 fails (most of the times) and sometimes it doesn&amp;#39;t...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202635?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 13:05:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12e35ad9-25b8-4129-a321-a4dbb06a029f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Rmarques,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Most likely it was the bug in our SDK v3.1 causing the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can have a look here :&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46950/problem-with-mesh-dfu"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/46950/problem-with-mesh-dfu&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Especially the fix with&amp;nbsp;optimal_bank_address()&lt;/p&gt;
&lt;p&gt;However the bug should be solved in SDK v3.2. Could you give it a try ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202599?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 11:56:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d69eec95-2bf7-4fbf-b108-220b0193a19c</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;So I discovered that if I power cycle the boards after steps 2, 3 and 4 described above, when I try step 5 it fails immediately. Is this normal, or do you guys think I may have configured something wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202586?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 11:31:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96261f0d-e357-45b4-9ccd-b527e330aac8</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;If I try to reprogram with a higher version right after programming with the blinky example I get this message:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Failed to upgrade target. Error is: Device returned status code ERROR_DEVICE_STATE_INVALID (131) on a DFU state beacon packet.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If I power cycle the 3 boards and retry, I get&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Failed to upgrade target. Error is: Failed to establish connection&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202582?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 11:16:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f63f98da-1f21-4ce7-ba94-863ff7fc3915</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;I thought it might be easy if I just put the LED&amp;#39;s blinking on the DFU example, but when I generated the DFU archive of the DFU example, I noticed the transfer took much longer than the blinky example inside meshsdk/bin/blinky, and of course that is because the DFU archive for the DFU example is much larger than the DFU archive for the blinky example, 120KB as oposed to 3KB for the blinky DFU archive.&lt;/p&gt;
&lt;p&gt;So it is possible to have a smaller DFU archive passed to the boards. But what I ALSO noticed is that after passing the blinky DFU archive once, the boards stopped receiving DFU archives, regardless of the app version I set on the DFU archive (I understand it has to be always higher than the last DFU archive transfered). I suspected it might be because the whole application area of 120KB was being replaced by the 3KB application of the blinky DFU archive, but to my surprise, using nRFConnect I saw it is still 120KB, albeit some odd bytes larger.&lt;/p&gt;
&lt;p&gt;This doesn&amp;#39;t make sense to me...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use DFU OTA with custom FW</title><link>https://devzone.nordicsemi.com/thread/202563?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2019 09:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fd7f94b-9769-40aa-8a8c-171abfdd6655</guid><dc:creator>rmarques</dc:creator><description>&lt;p&gt;I found &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/getting-started/posts/adjustment-of-ram-and-flash-memory"&gt;this tutorial&lt;/a&gt; that might at least help understanding how memory setup works. Reading...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>