<?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>RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48919/ram-retention-settings-with-softdevice-enabled</link><description>Hello, 
 
 I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flashing the image. I am using ‘ble_app_blinky’. 
 I have few variables in application. These will be keep on changing based on different conditions in application. Other than</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jun 2019 06:51:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48919/ram-retention-settings-with-softdevice-enabled" /><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194502?ContentTypeID=1</link><pubDate>Tue, 25 Jun 2019 06:51:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66972630-dc9a-488a-8b4c-6dcf6a4e8d9a</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;You welcome &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194374?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2019 13:47:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b520c95f-2ac0-4215-9f31-55ee852b64f3</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Sorry, I got your point. Thank you for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194373?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2019 12:18:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e40cc2f-a1d6-42f2-bce1-71c3659fe888</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Vishnu&lt;/p&gt;
&lt;p&gt;In the standard ble_app_blinky application in nRF5 SDK v15.3.0 the leds_init function is implemented as such:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;static void leds_init(void)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; bsp_board_init(BSP_INIT_LEDS);&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Is it not the same in your example?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194372?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 14:07:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc5d1af1-4b55-4249-a7f8-76c31f62d9f7</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Sorry I am using ble_app_blinky app where there is no bsp module.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194371?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 07:57:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa75c5a9-e907-4a8a-b7c3-8d626ced583d</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Vishnu&lt;/p&gt;
&lt;p&gt;To avoid this I think the easiest way is to make a copy of the bsp_board_leds_init() function somewhere (in main.c for instance), and run that rather than running&amp;nbsp;bsp_board_init(BSP_INIT_LEDS).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then you can comment out the last line of the bsp_board_leds_init function, where the LED&amp;#39;s are turned off:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;static void bsp_board_leds_init_copy(void)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt;#if defined(BOARD_PCA10059)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; // If nRF52 USB Dongle is powered from USB (high voltage mode),&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; // GPIO output voltage is set to 1.8 V by default, which is not&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; // enough to turn on green and blue LEDs. Therefore, GPIO voltage&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; // needs to be increased to 3.0 V by configuring the UICR register.&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; if (NRF_POWER-&amp;gt;MAINREGSTATUS &amp;amp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; (POWER_MAINREGSTATUS_MAINREGSTATUS_High &amp;lt;&amp;lt;&amp;nbsp; &amp;nbsp;POWER_MAINREGSTATUS_MAINREGSTATUS_Pos))&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; gpio_output_voltage_setup();&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; }&lt;/em&gt;&lt;br /&gt;&lt;em&gt; #endif&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;nbsp; uint32_t i;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; for (i = 0; i &amp;lt; LEDS_NUMBER; ++i)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; {&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; &amp;nbsp; nrf_gpio_cfg_output(m_board_led_list[i]);&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; }&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&amp;nbsp; // bsp_board_leds_off(); - This line should be commented out&lt;/em&gt;&lt;br /&gt;&lt;em&gt;}&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;This code can be found on line 125 of boards.c&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194370?ContentTypeID=1</link><pubDate>Tue, 18 Jun 2019 08:17:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa7144cf-1b22-4180-836b-c508be1df91e</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I only concerned with one scenario where I set LED ON based on some conditions and then go to System OFF mode. After coming out of System off mode and if initialization routine executes LED will be switched OFF. I want to avoid this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Vishnu Beema&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194369?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2019 13:56:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9150145d-171a-4a45-b7e8-ae3684e0068e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Vishnu&lt;/p&gt;
&lt;p&gt;1) RAM retention refers to the ability of the RAM to retain it&amp;#39;s state during power down, which is indeed working. When you leave system OFF mode the RAM content is still intact.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What happens here is that the RAM is overwritten after you wake from system OFF and go through the MCU startup procedure, which the RAM retention doesn&amp;#39;t protect you from.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2)&amp;nbsp;This is probably caused by the internal variables of the led and button modules not being retained.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The normal procedure is to re-initialize the various SDK modules after wakeup from system OFF.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is this not a viable option in your application?&lt;/p&gt;
&lt;p&gt;Otherwise you would have to ensure that all the global and static variables in these modules are located in a .non_init section.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194368?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2019 09:37:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f7a9c7a-b4b8-49ac-949f-6575121229ac</guid><dc:creator>beemavishnu</dc:creator><description>&lt;p&gt;Thank you for your confirmation.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1) So without non_init section, there is no RAM retention even by calling&amp;nbsp;sd_power_ram_power_set().&lt;/p&gt;
&lt;p&gt;2) My worry is, I don&amp;#39;t know which are all required to be kept in RAM. As mentioned above when I skip&amp;nbsp;leds_init() and buttons_init() I am getting ASSERT. Below is once such example when I call&amp;nbsp;app_button_enable() or&amp;nbsp;app_button_disable().&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;ASSERT(mp_buttons);&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards&lt;/p&gt;
&lt;p&gt;Vishnu Beema&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RAM retention settings with SoftDevice enabled</title><link>https://devzone.nordicsemi.com/thread/194367?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2019 08:54:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2df37b74-d57e-423e-b827-bf935d5b6146</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Vishnu&lt;/p&gt;
&lt;p&gt;1. RAM retention in system ON mode is enabled by default, that is correct. Most applications use system ON idle mode continuously, and having at least partial RAM retention is critical.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. a. Most examples come with a .non_init section that can be used to declare retained variables, without having to make any changes to the flash_placement.xml file.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do this just declare the variables like this:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;static uint32_t&amp;nbsp;my_variable&amp;nbsp;__attribute__((section(&amp;quot;.non_init&amp;quot;)));&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;b. Technically the RAM is still retained, but it gets zero initialized during the reset sequence. I agree it doesn&amp;#39;t make sense to enable RAM retention if you don&amp;#39;t put the memory in the .non_init section.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;c. That code should suffice, yes. Can you try using the .non_init section like I suggested earlier and see if it works?&lt;/p&gt;
&lt;p&gt;3. What part of the code causes the crash?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you get an assert from the SoftDevice, or an error code in return from one of the SDK modules?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>