<?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 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28814/nrf51822-advertising-timeout-sleep-ram-retention</link><description>Hello I would like to know when nrf51822 (SDK v12.3 with SD S130 ) advertising timeout and system goes to sleep , how could I retain the ram data so the MCU could work properly when it is woke up by other event?
Thanks.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Jan 2018 08:26:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28814/nrf51822-advertising-timeout-sleep-ram-retention" /><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114124?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 08:26:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0942b82a-165b-4cb7-bcf7-063df9c26e07</guid><dc:creator>mm81</dc:creator><description>&lt;p&gt;Ok, understand thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114119?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 08:21:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16c33cd6-b619-453e-94e1-2fa71bcc5b51</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;When configuring the ble_advertising module you will usually register an event handler in the application, that allows you to change the advertising behavior without having to change the module itself.&lt;/p&gt;
&lt;p&gt;In the standard examples this function is called on_adv_evt(..):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
{
    uint32_t err_code;

    switch (ble_adv_evt)
    {
        case BLE_ADV_EVT_FAST:
            err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
            APP_ERROR_CHECK(err_code);
            break;
        case BLE_ADV_EVT_IDLE:
            sleep_mode_enter();
            break;
        default:
            break;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114122?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 13:35:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68a1ac0c-2285-4ed3-bb12-24e6e843ca7e</guid><dc:creator>mm81</dc:creator><description>&lt;p&gt;Or you mean i should create a customized version of ble_advertising_on_ble_evt() and call it instead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114121?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 13:26:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1035e510-d06b-428c-b1cf-450c9be4d802</guid><dc:creator>mm81</dc:creator><description>&lt;p&gt;Thank. I am modifing the ble_advertising.c itself.&lt;/p&gt;
&lt;p&gt;Understood, I am new to NRF51 development.&lt;/p&gt;
&lt;p&gt;Could you advise where should I modify on application level if i do not want the device go to deep sleep after advertising timeout?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114123?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 11:32:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3d5ae51-39a1-4530-9643-31120c65d57c</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you mean you changed the advertising event handler, or the ble_advertising.c file itself?&lt;br /&gt;
Changing the SDK libraries and drivers is not recommended if you can avoid it.&lt;/p&gt;
&lt;p&gt;Also, when using the SoftDevice you should use sd_app_evt_wait(), rather than calling __WFE() directly.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114125?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 04:10:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c014ff8a-50a3-47c3-a38c-21874b488656</guid><dc:creator>mm81</dc:creator><description>&lt;p&gt;Thanks Torbjørn.
Turns out I discovered my problem is the device got RESET when the advertisement got timeout.&lt;/p&gt;
&lt;p&gt;I suppose this is because I have some ADC operation going on and the timer and ppi wakes up the mcu from deep sleep.&lt;/p&gt;
&lt;p&gt;I have modified ble_advertising.c to change the action of advertising time out from system off to WFE and the problem is solved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114120?ContentTypeID=1</link><pubDate>Tue, 02 Jan 2018 12:46:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a05faf1f-bf9b-48e1-95b8-5277ef36be49</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;When using the SoftDevice you should use the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=3_7_2_1_0_2_7_2_22#ga3e7395f75509209909c47a9dc9fa8a2b"&gt;sd_power_ramon_set()&lt;/a&gt; function to access the RAMON register.&lt;/p&gt;
&lt;p&gt;To enable RAM retention both in system ON and system OFF make sure to set both the OFFRAM0/1 fields and the ONRAM0/1 fields.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn Øvrebekk&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf51822 advertising timeout sleep RAM retention</title><link>https://devzone.nordicsemi.com/thread/114118?ContentTypeID=1</link><pubDate>Wed, 27 Dec 2017 09:06:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c065b30b-f364-4023-a76e-e497496b2cfe</guid><dc:creator>mm81</dc:creator><description>&lt;p&gt;i have put the following code below trying to prevent data loss after advertising timeout but failed...any idea??
// Switch ON both RAM banks when in system OFF mode
NRF_POWER-&amp;gt;RAMON |= (POWER_RAMON_OFFRAM0_RAM0On &amp;lt;&amp;lt; POWER_RAMON_OFFRAM0_Pos) |
(POWER_RAMON_OFFRAM1_RAM1On &amp;lt;&amp;lt; POWER_RAMON_OFFRAM1_Pos);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>