<?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>nrfutil zip package generation with hex containing address 0x2000XXXX</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30561/nrfutil-zip-package-generation-with-hex-containing-address-0x2000xxxx</link><description>Hi, We are testing the dfu ota example for the PCA10040. In our application we have some default values and settings are stored in the RAM. nrfutil is unable to generate the zip package for our hex file. It produces a &amp;quot;Memory Error&amp;quot;.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Feb 2018 15:25:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30561/nrfutil-zip-package-generation-with-hex-containing-address-0x2000xxxx" /><item><title>RE: nrfutil zip package generation with hex containing address 0x2000XXXX</title><link>https://devzone.nordicsemi.com/thread/121110?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 15:25:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82222635-eaf6-497c-95df-1493d01aec6a</guid><dc:creator>Siddhesh</dc:creator><description>&lt;p&gt;Thanks Ivan and Vidar,&lt;br /&gt;I moved the retained ram data to the flash and was able to generate the zip file from the hex. The firmware was then successfully loaded o the dev board. The application works fine but I am having an error &amp;quot;FDS_ERR_NO_SPACE_IN_QUEUES&amp;quot; .&amp;nbsp; I am sure this would be an easier fix. If I run into issues I will create a new question.&lt;br /&gt;Really appreciate the quick response here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil zip package generation with hex containing address 0x2000XXXX</title><link>https://devzone.nordicsemi.com/thread/121062?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 10:18:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14c421e1-9841-4892-9830-b12df6c73a57</guid><dc:creator>ivansanchez</dc:creator><description>&lt;p&gt;A DFU procedure will &lt;strong&gt;reset&lt;/strong&gt; the chip after it&amp;#39;s completed (unless you are using a &lt;strong&gt;very&lt;/strong&gt; custom DFU bootloader). RAM might survive a short reset in this architecture, but you should consider all RAM as dirty after a DFU.&lt;/p&gt;
&lt;p&gt;Furthermore, you cannot be sure that the RAM addresses used on your .hex files will not be used by the DFU code when it&amp;#39;s performing a DFU procedure. Messing up with the RAM during a DFU is a Bad Idea&amp;trade;.&lt;/p&gt;
&lt;p&gt;If you need to keep user settings, use the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.2.0%2Fgroup__nrf__fstorage.html"&gt;fstorage module&lt;/a&gt;. Those settings will not be overwritten when DFU&amp;#39;ing. Keep the defaults in your code, , and write them to flash the first time your application runs, read from flash and conflate the settings with your defaults.&lt;/p&gt;
[quote userid="25598" url="~/f/nordic-q-a/30561/nrfutil-zip-package-generation-with-hex-containing-address-0x2000xxxx"]It produces a &amp;quot;Memory Error&amp;quot;.&amp;nbsp;[/quote]
&lt;p&gt;.hex represent sparse data (the same small file can have some data e.g. at 0x00001000 and some data at 0x20000800). The DFU procedure needs a contiguous file (see &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk52.v0.9.0%2Fbledfu_memory_banks.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk52.v0.9.0%2Fbledfu_memory_banks.html&lt;/a&gt; ). nrfutil uses a na&amp;iuml;ve algorithm to convert the sparse .hex file into a contiguous file by adding 0xFF bytes as padding anywhere in the middle. Unfortunately nrfutil does not perform any constraint check on this, because it doesn&amp;#39;t assume any memory address layout.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil zip package generation with hex containing address 0x2000XXXX</title><link>https://devzone.nordicsemi.com/thread/121058?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 09:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d4e4464-69fa-4cce-9eaa-bb09dfa27b04</guid><dc:creator>ekrashtan</dc:creator><description>&lt;p&gt;Check your .map file to see exact segment name, included in HEX, and then generate HEX from ELF using command&lt;br /&gt;objcopy&amp;nbsp; -O ihex -R &amp;lt;RAM_segment_name_here&amp;gt; your.elf your.hex&lt;/p&gt;
&lt;p&gt;You can use more than one -R key during generation&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil zip package generation with hex containing address 0x2000XXXX</title><link>https://devzone.nordicsemi.com/thread/121056?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 09:28:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c913ae6-ed10-4dd6-a2d9-4aea8d820a7f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;A&amp;nbsp;DFU image can only contain data mapped to flash. The *.bin file would be 500+ MB if you included data in the RAM section because of byte padding (RAM start address is 0x20000000).&amp;nbsp;I would suggest to store the default data in flash, and have it loaded during startup.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>