<?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>Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119198/deep-sleep-mode-in-nrf54l15</link><description>Hello, I am using nRF Connect SDK v2.9.0. While working on the nRF52840 board, I used sys_poweroff() to put the board in deep sleep mode. But before calling it, I called 
 
 nrf_power_rampower_mask_on (NRF_POWER, 0 , NRF_POWER_RAMPOWER_S0POWER_MASK);</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Mar 2025 11:27:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119198/deep-sleep-mode-in-nrf54l15" /><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/525482?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2025 11:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8efe6ddb-a7cb-4c9e-bdb1-372a57d60e22</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes. As long as some threads have work to do (i.e. is not sleeping), the idle thread will not run. This is the same as for any other RTOS. So if you for insance want to wait/sleep, use k_sleep, as that will allow systme on sleep. If you instead with with for instance a loop (i.e. &amp;quot;busy wait&amp;quot;), the idle thread will not run, and the current consuption will be high. I recommend you go throught the nRF Connect fundamentals and intermediate courses (particularily &lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-1-zephyr-rtos-advanced/"&gt;Lesson 1 – Zephyr RTOS: Beyond the basics&lt;/a&gt;&amp;nbsp;of the intemetiade course) to learn about this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/525392?ContentTypeID=1</link><pubDate>Sun, 02 Mar 2025 09:47:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:204fc885-8e88-4146-8918-22cf22719ed5</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;Yes, I mean&amp;nbsp;system ON idle mode. Does that mean if I need to implement a function that enters the system in this mode, I should call&amp;nbsp;&lt;span&gt;k_sleep for all threads?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/525099?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2025 14:34:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b65f7086-d00d-4318-a684-003208adf1e8</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;By sleep, do you mean system OFF sleep mode (where wakeup is in form of a reset), normal system ON sleep mode?&lt;/p&gt;
&lt;p&gt;System On sleep is auomatically entered by the Zephyr idle thread, whenever there is no work to be done. That is for instance if all threads call k_sleep or are waiting for something.&lt;/p&gt;
&lt;p&gt;For system off you can call sys_poweroff() as is demonstrated in the system off sample you have been looking at.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/525024?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2025 10:31:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c18f19e-9a7e-43bf-8217-6b76fdc9bcf6</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;OK, thank you for this information.&lt;br /&gt;But I have another question, please, if I need to implement a function that enters the system in sleep mode, is there any way rather than calling&amp;nbsp;&lt;span&gt;k_sleep&lt;/span&gt;&lt;span&gt;(K_FOREVER);&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524978?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2025 07:48:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26348c95-4b09-4763-be96-18ae9f94c09f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The nrf_power_rampower_mask_on() function is more low level and is used under the hood. The method demonstrated in the System OFF sample is using the Zephyr APIs. The retained region is specified in the devicetree (see &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/0a2e205750dc7eff8767afa543b2fd23a1fbb332/samples/boards/nordic/system_off/boards/nrf54l15dk_nrf54l15_cpuapp.overlay"&gt;the overlay file&lt;/a&gt; for the board under &amp;quot;boards&amp;quot;, where yuo have this for the nRF54L15 DK:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
	cpuapp_sram@2002e000 {
		compatible = &amp;quot;zephyr,memory-region&amp;quot;, &amp;quot;mmio-sram&amp;quot;;
		reg = &amp;lt;0x2002e000 DT_SIZE_K(4)&amp;gt;;
		zephyr,memory-region = &amp;quot;RetainedMem&amp;quot;;
		status = &amp;quot;okay&amp;quot;;

		retainedmem0: retainedmem {
			compatible = &amp;quot;zephyr,retained-ram&amp;quot;;
			status = &amp;quot;okay&amp;quot;;
		};
	};

	aliases {
		retainedmemdevice = &amp;amp;retainedmem0;
	};
};

&amp;amp;cpuapp_sram {
	/* Shrink SRAM size to avoid overlap with retained memory region */
	reg = &amp;lt;0x20000000 DT_SIZE_K(184)&amp;gt;;
	ranges = &amp;lt;0x0 0x20000000 0x2e000&amp;gt;;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is the recommende approach.&lt;/p&gt;
&lt;p&gt;If you are interested, you can follow this further down by inspecting code or debugging, and then you should see that then the implementation for nrf for the Zephyr retained mem driver in &lt;a href="https://devzone.nordicsemi.com/support-private/support/341160/zephyr/drivers/retained_mem/retained_mem_nrf_ram_ctrl.c"&gt;zephyr/drivers/retained_mem/retained_mem_nrf_ram_ctrl.c&lt;/a&gt;&amp;nbsp;is used, and this calls&amp;nbsp;nrfx_ram_ctrl_retention_enable_set(). In there, you can see that a function pointer to&amp;nbsp; ram_ctrl_block_section_retention_enable_set() is passed to&amp;nbsp;ram_ctrl_block_section_iterate(), and within&amp;nbsp;nrfx_ram_ctrl_section_retention_mask_enable_set(),&amp;nbsp;nrf_power_rampower_mask_on() is called.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524925?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 19:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6edcae7e-1ab1-4027-9072-3d2567fb89ff</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;The example in&amp;nbsp;zephyr/samples/boards/nordic/system_off/ worked for me. But I need to know what the difference is between&amp;nbsp;nrf_power_rampower_mask_on and the code in the example. Are they both used to keep the RAM content in Deep Sleep mode?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524789?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 11:18:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b88f22f-c00c-4e79-9fe4-a264ea9d1b5c</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;Yes, I added it in the prj.conf file. But the system_off sample I used is from nrf/samples/nfc/system_off/&lt;br /&gt;I will try another system_off sample now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524760?ContentTypeID=1</link><pubDate>Wed, 26 Feb 2025 09:04:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dd2932f-784d-47ba-9ec1-5c7f00b7e476</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That is odd. It works on my end, and is an important part of the sample. Did you put&amp;nbsp;CONFIG_APP_USE_RETAINED_MEM=y in prj.conf? Also, can you confirm that the system_off sample you are using is the one under&amp;nbsp;zephyr/samples/boards/nordic/system_off/?&lt;/p&gt;
&lt;p&gt;If it still does not work, can you share the full sample project with your modification as well as the build output so that I see exactly what you are doing and can attempt to reproduce on my end?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524655?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2025 15:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e798b594-2be3-4db1-9a8f-7ad80bed483b</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;I set&amp;nbsp;&lt;span&gt;CONFIG_APP_USE_RETAINED_MEM= y in the system_off sample but unfortunately, I got the same error &amp;quot;attempt to assign the value &amp;#39;y&amp;#39; to the undefined symbol APP_USE_RETAINED_MEM&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524129?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 14:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec8f32fc-ed48-4931-81a4-39d9007396eb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;CONFIG_APP_USE_RETAINED_MEM configuration is only valid in the sytem off demo. To use it outside of the demo, you can refer to the code that is included when you have it enabled (that means that &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/1f8f3dc291420c70cd39e77a5cdc954561d4a08f/samples/boards/nordic/system_off/CMakeLists.txt#L9"&gt;retained.c is included in the build &lt;/a&gt;so refer to that, and see the code snippets in main.c that are included,&amp;nbsp;CONFIG_APP_USE_RETAINED_MEM.&lt;/p&gt;
&lt;p&gt;I suggest you experiment with the sample first, and observe that it works there, and then you will see how you can include thsi in your own project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524100?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 13:40:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e9e7899-b7ff-4342-b9f1-d7bb726bb8be</guid><dc:creator>Nedaa_H_Ahmed</dc:creator><description>&lt;p&gt;When I added&amp;nbsp;&lt;span&gt;CONFIG_APP_USE_RETAINED_MEM=y, I got &amp;quot;attempt to assign the value &amp;#39;y&amp;#39; to the undefined symbol APP_USE_RETAINED_MEM&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Also, I want to&amp;nbsp;configure&amp;nbsp;the&amp;nbsp;retention&amp;nbsp;in the running time before calling&amp;nbsp;sys_poweroff()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In the reset reason, when I used&amp;nbsp;&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/7787b264984022cda64d9629278942053e6462a5/samples/nfc/system_off/src/main.c#L158"&gt;print_reset_reason() function&lt;/a&gt;, I Got the same errors&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1740145241098v1.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Deep Sleep mode in nRF54l15</title><link>https://devzone.nordicsemi.com/thread/524089?ContentTypeID=1</link><pubDate>Fri, 21 Feb 2025 13:20:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da750fee-ef36-488f-896c-487118bd6aa2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;HI,&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/0a2e205750dc7eff8767afa543b2fd23a1fbb332/samples/boards/nordic/system_off"&gt;system off&amp;nbsp;demo&lt;/a&gt;&amp;nbsp;demonstrate retention if build with&amp;nbsp;&lt;code&gt;CONFIG_APP_USE_RETAINED_MEM=y&lt;/code&gt;. The &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/chapters/power-and-clock/reset/doc/reset.html#ariaid-title13"&gt;RESETREAS&lt;/a&gt; exist on nRF54L15 as well, but is handled a bit differently in the SDK. You can refer to&amp;nbsp;the &lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/7787b264984022cda64d9629278942053e6462a5/samples/nfc/system_off/src/main.c#L158"&gt;print_reset_reason() function&lt;/a&gt;&amp;nbsp;in the NFC system off sample which show how you can read it (the sample only decodes reasons relevant for the NFC sample, though).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>