<?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>Reducing RAM usage on nRF52811</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91790/reducing-ram-usage-on-nrf52811</link><description>Hi! 
 I&amp;#39;m porting our application from nRF52832 (SD132 6.3.1, SDK 15.2.0) to nRF52811. We&amp;#39;re intereset in the nRF52811 because of its smaller size with the WLCSP package. Our application is quite heavy in that it allows 2 concurrent connections with DLE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Sep 2022 03:09:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91790/reducing-ram-usage-on-nrf52811" /><item><title>RE: Reducing RAM usage on nRF52811</title><link>https://devzone.nordicsemi.com/thread/386076?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 03:09:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a03c92af-3bfd-4be4-9ea4-cb76a5b101f5</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Federico"]How low can it go?[/quote]
&lt;p&gt;If I remember correctly, it was a maximum size of 510.&lt;/p&gt;
&lt;div style="left:48px;top:72.3333px;"&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reducing RAM usage on nRF52811</title><link>https://devzone.nordicsemi.com/thread/386075?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 03:07:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cedfc8c-e855-4827-b3f2-b69bc7cae141</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Federico"]By number of roles do you mean the&amp;nbsp;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT and&amp;nbsp;NRF_SDH_BLE_CENTRAL_LINK_COUNT?&amp;nbsp;[/quote]
&lt;p&gt;The code size of the softdevice is fixed per version and cannot be changed by any configuration changes. The RAM size used by the softdevice can be increased or decreased based on&amp;nbsp;on the number of roles and attribute table size. Yes,&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT&amp;nbsp;and&amp;nbsp;NRF_SDH_BLE_CENTRAL_LINK_COUNT are two configs that control how many roles the softdevice should be configured to support at the time of initialization. The softdevice needs more RAM space per extra role/instance it supports.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="Federico"]What does attribute size mean? I see&amp;nbsp;NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE. What does that field mean? How low can it go?[/quote]
&lt;p&gt;By default, softdevice stores the attributes of the services/characteristics/Descriptors that your application initializes into its own RAM memory. The&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE defines the maximum number of attribute size the whole of your services in your application can store in softdevice RAM. We had to know the max attribute table size that the softdevice reserves in its memory, since this effects where the application RAM starts.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reducing RAM usage on nRF52811</title><link>https://devzone.nordicsemi.com/thread/386022?ContentTypeID=1</link><pubDate>Tue, 13 Sep 2022 14:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:680240c1-e3ff-42f1-9c0e-a4487871fea9</guid><dc:creator>Federico</dc:creator><description>&lt;p&gt;Hi Susheel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the answer! I understand we might need to disable logging for the 811. Also, debugging on the 840 and moving to 811 for final release makes sense.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I still have a few questions about what you suggest for Soft Device optimization. What do you mean exactly by:&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/91790/reducing-ram-usage-on-nrf52811/385606"]Softdevice code size is fixed and its RAM size depends on the number of roles and the attribute size you select in the sdk_config.h file. Apart from that there is nothing much to configure on the softdevice size.[/quote]
&lt;p&gt;By number of roles do you mean the&amp;nbsp;NRF_SDH_BLE_PERIPHERAL_LINK_COUNT and&amp;nbsp;NRF_SDH_BLE_CENTRAL_LINK_COUNT?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What does attribute size mean? I see&amp;nbsp;NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE. What does that field mean? How low can it go?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reducing RAM usage on nRF52811</title><link>https://devzone.nordicsemi.com/thread/385606?ContentTypeID=1</link><pubDate>Sun, 11 Sep 2022 08:16:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90fc6adb-8244-4f6f-a84b-299076b0d2e9</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]I&amp;#39;ve noticed that disabling the log has a big impact and actually makes it fit. After setting &amp;quot;#define NRF_LOG_ENABLED 0&amp;quot;, this is the output.[/quote]
&lt;p&gt;This sounds correct, Logs are used for prototyping and not for release versions. Which the chip revisions with smaller memories, some of the applications won&amp;#39;t be able to afford having logging feature.&amp;nbsp;You can continue to prototype your application on nRf52840 (If logging is necessary) and then do your final testing on the nrf52811 without the logs and with compiler/linker optimizations enabled.&lt;/p&gt;
[quote user=""]What else can I do to bring the RAM footprint down? Either for the app or for the SoftDevice. There must be something in the sdk_config that I can disable but it&amp;#39;s too big to start trying without some common sense guidance.[/quote]
&lt;p&gt;Softdevice code size is fixed and its RAM size depends on the number of roles and the attribute size you select in the sdk_config.h file. Apart from that there is nothing much to configure on the softdevice size.&lt;/p&gt;
&lt;p&gt;On your application side, disable logs and UART if you are not using them. If you have used another example as template, it might be possible that it has some other peripherals that you do not use initialized and enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>