<?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>mergehex with s310v1 and .bin generation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7251/mergehex-with-s310v1-and-bin-generation</link><description>Hi,
I need a .bin file of the whole flash memory for production programming.
The procedure I have used until now (with s310v2) was the following: 
 
 Upload .hex file of firmware with
nrfgo; 
 Upload .hex file of
softdevice with nrfgo; 
 Download</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 May 2015 07:18:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7251/mergehex-with-s310v1-and-bin-generation" /><item><title>RE: mergehex with s310v1 and .bin generation</title><link>https://devzone.nordicsemi.com/thread/25636?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 07:18:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:436eac9b-4de1-4f1d-815f-4660394771b9</guid><dc:creator>Vito</dc:creator><description>&lt;p&gt;Thanks. Indeed I didn&amp;#39;t realize that joining in a .bin file addresses so far from each other was not a good idea. I&amp;#39;ll just enable the readback protection after flashing the code memory area.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mergehex with s310v1 and .bin generation</title><link>https://devzone.nordicsemi.com/thread/25635?ContentTypeID=1</link><pubDate>Tue, 26 May 2015 01:05:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aa9cee0-0e1e-4743-b116-03d75bc1733c</guid><dc:creator>testy</dc:creator><description>&lt;ol&gt;
&lt;li&gt;Segger J-Flash offers merge too (Open data file, Merge data file, Save data file as... bin)&lt;/li&gt;
&lt;li&gt;S310 v1.0.0 won&amp;#39;t run &lt;strong&gt;without&lt;/strong&gt; readback protect (NRF_ERROR_SOFTDEVICE_NOT_ENABLED failure when sd_softdevice_enable is called)&lt;/li&gt;
&lt;li&gt;merged bin file (containing UICR) will be about 256MB...&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mergehex with s310v1 and .bin generation</title><link>https://devzone.nordicsemi.com/thread/25634?ContentTypeID=1</link><pubDate>Mon, 25 May 2015 13:20:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bb674a0-97e7-4f5f-bad8-43f60bd5922b</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;You can use objcopy, the standard binutils utility, with the --remove-section (-R). --gap-fill and --pad-to to make 3 separate bin files, one from 0x00000000 to 0x1FFFF, 1 byte before the start of program code with the first 2 sections in the softdevice hex file (ie remove section 3), a file from from 0x20000 to 0x10000FFF with the program code, and one from 0x10001000 to 0x10001018 with the third section of the softdevice (ie remove sections 1 and 2). Then you just cat them together and you have one long bin file you can use.&lt;/p&gt;
&lt;p&gt;I believe the sections are called &amp;#39;.sec1&amp;#39; and &amp;#39;.sec2&amp;#39; and &amp;#39;.sec3&amp;#39;&lt;/p&gt;
&lt;p&gt;The first piece for instance would look like this&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;objcopy -Iihex -Obinary -R .sec3 --gap-fill=0xff --pad-to=0x20000 s310_nrf51422_1.0.0_softdevice.hex s310_nrf51422_1.0.0_softdevice.1.bin
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;the rest are similar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mergehex with s310v1 and .bin generation</title><link>https://devzone.nordicsemi.com/thread/25633?ContentTypeID=1</link><pubDate>Mon, 25 May 2015 12:12:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c9b4861-1406-4dbf-a57c-811c26de881c</guid><dc:creator>Vito</dc:creator><description>&lt;p&gt;Thanks. Actually I made the long story short losing some details. The chips are already mounted on the boards, which are equipped with another microcontroller. The nrf51422 get its firmware (and updates) from the main uC, which gets it over the air. The main uC has a custom SWD script able to flash the nrf51422, and it always worked fine (but it works with .bin format).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: mergehex with s310v1 and .bin generation</title><link>https://devzone.nordicsemi.com/thread/25632?ContentTypeID=1</link><pubDate>Mon, 25 May 2015 12:05:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c61a9f9-b269-457d-bde7-c958cf3e47a1</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;How about this alternative &lt;a href="http://embeddedsoftdev.blogspot.ca/p/idap-link.html"&gt;here&lt;/a&gt;.  No mergehex, no hex2bin require. Parallel programming multiple devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>