<?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>nRF51822 memory layout and compilation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98618/nrf51822-memory-layout-and-compilation</link><description>Hello, guys. 
 We are using nRF51822 SoC together with nRF5 v12.3.0 SDK. 
 Here is what the memory footprint of our application code should look like: 
 
 We have SoftDevice, Application area, Application data area (for flash data storage and Peer Manager</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Apr 2023 07:14:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98618/nrf51822-memory-layout-and-compilation" /><item><title>RE: nRF51822 memory layout and compilation</title><link>https://devzone.nordicsemi.com/thread/420660?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 07:14:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:850bee53-0dd2-4e12-a377-bcb9a53f6342</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="bojan"]Also, if our code does not fit in the Application area, why don&amp;#39;t we get the error during the compilation and linking process that the code is too big? Are our settings of the Application and Bootloader linkers OK? Do we need to specify something else?[/quote]
&lt;p&gt;It seems like the way it is designed, and the memory pointers being use, the linked is not able to figure out that application is spilling into the application reserved space. The virtual pages number and size seems to be a runtime evaluation thing and not a link time.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 memory layout and compilation</title><link>https://devzone.nordicsemi.com/thread/420651?ContentTypeID=1</link><pubDate>Mon, 17 Apr 2023 06:27:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c799325c-b28a-4b82-a0bf-9a444379b1c8</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Thanks for the clarifications, &lt;a href="https://devzone.nordicsemi.com/members/aryan"&gt;Susheel Nuguru&lt;/a&gt; . &lt;/p&gt;
&lt;p&gt;It is now clear to us that we would need to set:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define FDS_VIRTUAL_PAGE_SIZE 256&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;if we want the &lt;span style="background-color:rgba(204, 255, 204, 1);"&gt;&lt;strong&gt;Application data&lt;/strong&gt;&lt;/span&gt; flash area of 3KB.&lt;/p&gt;
&lt;p&gt;Now, if we create a new DFU image with such a setting (3KB Application data area) and update the nRF51 that runs with the old settings (12KB Application data area), would that update take effect without bricking the device?&lt;/p&gt;
&lt;p&gt;Also, if our code does not fit in the Application area, why don&amp;#39;t we get the error during the compilation and linking process that the code is too big? Are our settings of the Application and Bootloader linkers OK? Do we need to specify something else?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 memory layout and compilation</title><link>https://devzone.nordicsemi.com/thread/420215?ContentTypeID=1</link><pubDate>Thu, 13 Apr 2023 11:33:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8d4d525-b58f-41b0-8a48-7781b7c0ebb6</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The size that you are giving in FDS_VIRTUAL_PAGE_SIZE is in words. That is 1024 words is equal to 4096 bytes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;4906 bytes = 4 Physical pages on nRF51.&lt;/p&gt;
&lt;p&gt;Setting&amp;nbsp;FDS_VIRTUAL_PAGES as 3 means that you are reserving 3*1024 words = 3072 words = 12,288 bytes = 12 physical pages for FDS.&lt;/p&gt;
&lt;p&gt;I think your main confusion was thinking that&amp;nbsp;FDS_VIRTUAL_PAGE_SIZE size is in bytes, but the size is in words&amp;nbsp; as described clearly in the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__fds__config.html&amp;amp;anchor=ga94b7203878878277663b572bded3499d"&gt;documentation&lt;/a&gt;. (word = 4 bytes). As developers we are used to deal with sizes as bytes so, I understand your confusion :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 memory layout and compilation</title><link>https://devzone.nordicsemi.com/thread/419610?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2023 10:18:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:feb8278c-e930-44ea-aa1d-93a2eb5721ad</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;We just came back from Easter vacation and that was the reason for no response from out end.&amp;nbsp;&lt;/span&gt;&lt;span&gt;D&lt;/span&gt;&lt;span&gt;ue to very high traffic during this period on devzone and fewer people working this week,&amp;nbsp;&lt;/span&gt;&lt;span&gt;we did not manage to assign this to an expert yet. We will look into this as soon as possible, but please expect more delays the first two days. Thanks for your patience so far.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>