<?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>Generate HEX file from DFU update package</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/45731/generate-hex-file-from-dfu-update-package</link><description>Hi, 
 For our continuous integration and deployment of firmware updates for our product, we want to test firmware upgrade paths from different versions. We are building a teststand that automatically flashes different firmware versions into a test device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Apr 2019 06:06:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/45731/generate-hex-file-from-dfu-update-package" /><item><title>RE: Generate HEX file from DFU update package</title><link>https://devzone.nordicsemi.com/thread/180408?ContentTypeID=1</link><pubDate>Fri, 05 Apr 2019 06:06:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe1df084-fca6-4f38-8fb0-c5d60934671c</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi Thomas.&lt;/p&gt;
&lt;p&gt;Could you perhaps try to combine these two approaches? &lt;/p&gt;
&lt;p&gt;If you first use nrfutil pkg display and find the FW version of the packet, you can generate a new bootloader settings page with that FW version and use that.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate HEX file from DFU update package</title><link>https://devzone.nordicsemi.com/thread/180232?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2019 09:29:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f14e42fc-0aeb-4a75-b299-a1328a7a1fab</guid><dc:creator>Thomas Nenning</dc:creator><description>&lt;p&gt;Hi Andreas,&lt;/p&gt;
&lt;p&gt;Thanks for your quick and detailed answer. Generating an application .hex with an offset from a .bin file is unfortunately only half of the puzzle. Just&amp;nbsp;flashing it without updating the CRC (and fw version) fields in the bootloader cause the bootloader to not accept the new firmware. This is where we struggle in the moment.&lt;/p&gt;
&lt;p&gt;So far we have two, but incomplete, approaches:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reading the bootloader flash page, manipulate the CRC and fw version and write it back. This is though not futureproof as the bootloader settings page layout might change with future versions&lt;/li&gt;
&lt;li&gt;Display all the package information via &lt;em&gt;nrfutil pkg display&lt;/em&gt;&amp;nbsp;and generate a new bootloader settingspage. Here though we miss the information about the bootloader version and bootloader settings version which is not present in the DFU package&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Do you have a third option you can recommend us and if not which of the two approaches would you recommend?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Tho,as&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Generate HEX file from DFU update package</title><link>https://devzone.nordicsemi.com/thread/180184?ContentTypeID=1</link><pubDate>Thu, 04 Apr 2019 08:06:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65b15ace-66e2-4ac0-a79a-0026eb7e5aef</guid><dc:creator>AndreasF</dc:creator><description>&lt;p&gt;Hi Thomas.&lt;/p&gt;
&lt;p&gt;I think the solution to your problem is the following:&lt;/p&gt;
&lt;p&gt;You have to unzip the DFU package, convert the .&lt;strong&gt;bin&lt;/strong&gt; file by using for example &lt;strong&gt;bin2hex.py&lt;/strong&gt;, this can be installed by installing the I&lt;a href="https://pypi.org/project/IntelHex/"&gt;ntelHex package &lt;/a&gt;(pip install intelhex), and use the --offset option.&lt;/p&gt;
&lt;p&gt;You hve to know which SoftDevice version you use, which I will assume that you do, so that you can look up the start address in the table found in &lt;a href="https://devzone.nordicsemi.com/tutorials/b/getting-started/posts/adjustment-of-ram-and-flash-memory"&gt;Section 3 here&lt;/a&gt;, and offset the Application start to that address.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;If I use S132 V6.1.1 in my Application, I can read in the table that the start address should be &lt;strong&gt;0x26000. &lt;/strong&gt;The bin2hex command I would use then is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bin2hex --offset=0x26000 &amp;lt;INPUT .BIN FILE&amp;gt; &amp;lt;output_file_name.hex&amp;gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is an example of me doing this with the ble_app_uart example:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-a7a2e616ccd4419292ee2180bc8d4f51/pastedimage1554365202891v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Hope this works for you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>