<?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>Custom DFU transport (sdk 12)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18576/custom-dfu-transport-sdk-12</link><description>Hello. I am at the point in my project (using sdk v12) where I need to get DFU implemented. 
 In my case, DFU must occur through an alternative transport that is none of the &amp;#39;usual suspects&amp;#39; of BLE, serial, etc. 
 Having struggled to get DFU implemented</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Dec 2016 19:18:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18576/custom-dfu-transport-sdk-12" /><item><title>RE: Custom DFU transport (sdk 12)</title><link>https://devzone.nordicsemi.com/thread/71680?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 19:18:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e51c8b1-63fa-4850-97ed-624a3ff00344</guid><dc:creator>Ray</dc:creator><description>&lt;p&gt;Interesting thought, and thanks for continuing to brainstorm about this.&lt;/p&gt;
&lt;p&gt;Yesterday I did some analysis and realized that because the .BIN is basically uncompressable, there isn&amp;#39;t much on-air savings for sticking with ZIP.  And so I deconstruct the ZIP on the service, discard the manifest, and send the .DAT and .BIN down to the device uncompressed.  This will make it easier for the bootloader.&lt;/p&gt;
&lt;p&gt;I am now traveling but I will indeed try to find the time to look at and understand the existing code.  Your thoughts sound fascinating.  Thanks again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU transport (sdk 12)</title><link>https://devzone.nordicsemi.com/thread/71679?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 16:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a1566ee-51f0-4047-a5bd-8f25de620166</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again Ray,&lt;/p&gt;
&lt;p&gt;I had a discussion with one of our coworkers, Vidar. It seems that it&amp;#39;s actually possible to reuse most of the secure bootloader. As you already noticed we tried to create the DFU with transport agnostic in mind. We only have one type of transport medium for now (BLE). But we think it&amp;#39;s possible to replace the transport layer with your own custom transport. In your transport layer, you can instead of waiting for command from &amp;quot;DFU master&amp;quot;, the NRF5 actually read the flash and check if there is a new image or not, if there is, it continue to read flash to get the init packet, ( the signature, CRC, size) and continue to call NRF_DFU_OBJECT_OP_EXECUTE so the upper layer can check the packet as it is done now with the nrf_ble_dfu.c and dfu_reg_handling.c (upper layer).&lt;/p&gt;
&lt;p&gt;We are working on the UART transport layer for the secure bootloader now, most likely it will come with SDK v13 production, but I don&amp;#39;t know when.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU transport (sdk 12)</title><link>https://devzone.nordicsemi.com/thread/71678?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2016 15:23:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1789eec2-ce0c-429d-8a09-2f9c9e1cdcf3</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I understand Ray. Since you have some constrains as you described, you will need to implement almost your own bootloader. You can re-use what we got to store data to swap page, check CRC, then replace old image with new one. That&amp;#39;s it. Other than that you may need to implement your own protocol for receiving the init packet, the image, etc.
I would suggest you to have a look at the UART bootloader we have as the base for your development.&lt;/p&gt;
&lt;p&gt;Regarding the .zip, we usually don&amp;#39;t do un-zip on the nRF5, but on the phone (DFU Master) instead. You should choose to do un-zip and hex to bin converting on the device with less constrain on power consumption. Maybe on your 3G module ? What you store in the flash driver is simply the binary image (and the init data if needed) that the nRF5 should flash into its ROM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU transport (sdk 12)</title><link>https://devzone.nordicsemi.com/thread/71677?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2016 12:16:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:039f3349-ea49-4f04-8e74-fe9048811fee</guid><dc:creator>Ray</dc:creator><description>&lt;p&gt;Hi.  Thanks for your time.&lt;/p&gt;
&lt;p&gt;My situation, in greater detail, is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;the developer does a &amp;#39;git push&amp;#39; of updated builds to a special repo on our &amp;#39;base service.  From this moment on, everything happens in an unattended manner.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Each of a widely distributed set of devices poll the service once nightly to check if an update is pending for the firmware of its specific configuration.  If such an update is available, the download is performed by our nRF app.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;the download is done over 3G cellular. This is all run by a tiny nonprofit, and so it is important that the firmware is small.  And so we are happy that nrfutil generates a ZIP file, and this is why we distribute the application only.  The firmware was delivered 100% in the clear, and we don&amp;#39;t trust link level encryption anyway, and so we love the new digitally signed images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The download is done over FTP and this ZIP file is buffered entirely within the 3G cellular module&amp;#39;s own 2GB flash drive (a SIMCOM 5320, FYI).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;after download, each of these solar-powered devices will wait until it has sufficient battery life to ensure a complete DFU. It may be immediate, or it may be days. When it is ready, the nRF app reboots the device.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now back in the bootloader, we initialize serial and use it to talk with the 3G module to look for the new firmware ZIP file.  If it isn&amp;#39;t present, we just start the app.  If the ZIP file is present, we will begin the DFU process. In essence this implements a buttonless DFU.  (By the way, I really like your use of _WEAK methods to allow me to override things like the &amp;quot;should start&amp;quot; method.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Unfortunately, the only transfer method from the 3G module&amp;#39;s Flash drive and the nRF is to initiate a stream of bytes from the zip file, from beginning to end, with no random access or flow control. As such, I have configured it to transfer very slowly (9600bps), and it uses app_sched of course to allow the bootloader to process it in 512-byte chunks.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All the code above is completed and tested.  As you can see, there is no &amp;quot;controller&amp;quot; or &amp;quot;master&amp;quot; of the DFU process; the device must update itself given nothing more than a ZIP file.&lt;/p&gt;
&lt;p&gt;And so given that I need to decode this zip file on the fly, and verify its integrity and digital signature, and to do the DFU, all inside the bootloader, I&amp;#39;m trying to come up with a plan as to what code I can borrow/transliterate and what I need to write.&lt;/p&gt;
&lt;p&gt;Thanks again for taking the time to read and assist.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom DFU transport (sdk 12)</title><link>https://devzone.nordicsemi.com/thread/71676?ContentTypeID=1</link><pubDate>Tue, 27 Dec 2016 10:28:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a9b32b3-0bd0-4bd9-8011-0ce377fe375f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ray,&lt;/p&gt;
&lt;p&gt;UART Bootloader is available since SDK v6. However with the introduce of Secure Bootloader in SDK v12, we removed UART as it&amp;#39;s not been updated to secure bootloader yet.&lt;/p&gt;
&lt;p&gt;So if you need UART bootloader, I would suggest to use the Legacy bootloader from SDK v11.&lt;/p&gt;
&lt;p&gt;However, in your case, the DFU master side is simply a storage device with AT command ? Then you may need to modify the bootloader a little bit as the storage device may not be able to handle the DFU starting sequence.
I don&amp;#39;t think you really need to &amp;quot;reversed engineering&amp;quot; the DFU master, but simply follow what we described in our documentation to make your DFU master or to modify the bootloader to cope with your setup. The documentation for UART bootloader is &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/examples_ble_dfu.html?cp=4_0_3_4_3_1"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>