<?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>Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100138/low-power-mode-on-nrf5340-dk-with-uart-disable</link><description>Hello, 
 
 I am using nrf5340 DK with SDK version 2.1.0. I am trying to implement a low-power mode functionality where I would like the execution flow to return to the same place after the device wakes up. I have gone through the state.h file. I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 May 2023 08:36:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100138/low-power-mode-on-nrf5340-dk-with-uart-disable" /><item><title>RE: Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/thread/428080?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 08:36:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f225722-9859-449c-bbc2-0d72d38792fb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="Dip1993"]You mean to say if I required low power mode without RESET the device I just need to disable/suspend the resources that are taking more power, &lt;strong&gt;this will save the power consumption of the battery&lt;/strong&gt;. CPU will automatically go into sleep mode.[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
[quote user="Dip1993"]&lt;p&gt;Can you please enlighten why there are different modes, When to use them? like,&amp;nbsp;PM_STATE_RUNTIME_IDLE,&amp;nbsp;PM_STATE_SUSPEND_TO_IDLE,&amp;nbsp;PM_STATE_STANDBY and&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;PM_STATE_SUSPEND_TO_RAM.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;You can refer to the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/pm/index.html"&gt;power management documentation&lt;/a&gt; for a description of the states (specifically the definition of the enum &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/pm/api/index.html#c.pm_state"&gt;pm_state&lt;/a&gt;).&amp;nbsp;A key thing to remember here is that these are Zephyr concepts, and Zephyr is an RTOS with support for many different devices from many different vendors, so with much of the Zephyr APIs, some features etc are not implemented or relevant on certain devices. As mentionned, you need to ensure that you power down peripherals when not needed. For instance, for UART something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uart_rx_disable(uart_dev);
k_sleep(K_MSEC(100));
err = pm_device_action_run(uart_dev, PM_DEVICE_ACTION_SUSPEND);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As mentioned, the only thing you need to do to put the CPU in sleep is not using it, and it will automatically be put to sleep (WFE state) by the idle thread. The only time you need to explicitly do something with the CPU sleep state is if you want to use system off low power mode, where wakeup is in form of a reset and there are only a few wake-up sources available. That hat it&amp;#39;s uses, but is not used in most products. If you want to see how that is used, you can refer to the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/boards/nrf/system_off/README.html"&gt;nRF5x System Off demo&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/thread/427971?ContentTypeID=1</link><pubDate>Mon, 29 May 2023 08:36:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91ac2a0b-58cb-4358-8de8-33525ef08194</guid><dc:creator>Dker19</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;Do you have any more thoughts on the above points?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/thread/427866?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 15:08:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22030852-6231-4e8e-a377-bab3c1fd4271</guid><dc:creator>Dker19</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;That&amp;#39;s great info. Thanks for that info.&lt;/p&gt;
&lt;p&gt;You mean to say if I required low power mode without RESET the device I just need to disable/suspend the resources that are taking more power, &lt;strong&gt;this will save the power consumption of the battery&lt;/strong&gt;. CPU will automatically go into sleep mode.&lt;/p&gt;
&lt;p&gt;Can you please enlighten why there are different modes, When to use them? like,&amp;nbsp;PM_STATE_RUNTIME_IDLE,&amp;nbsp;PM_STATE_SUSPEND_TO_IDLE,&amp;nbsp;PM_STATE_STANDBY and&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;PM_STATE_SUSPEND_TO_RAM.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/thread/427845?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 14:23:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a6fe778-c3c1-44e5-b837-60f4b2713a24</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;PM_STATE_SOFT_OFF represents system off mode, where wakeup is in form of a reset. The normal idle mode is (sometimes referred to as system ON idle mode) is that the CPU is sleeping waiting for event. That is used by default when there is no CPU activity. So, you just need to disable/suspend resources you don&amp;#39;t need in sleep (like UART for instance), and don&amp;#39;t do any work. Then rest will be handled automatically by the idle thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/thread/427816?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 13:08:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb525371-eb06-471f-976c-34304311b3dc</guid><dc:creator>Dker19</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;, Thanks for the answers.&lt;/p&gt;
&lt;p&gt;For 2nd point, I required the device should be run in low power mode when there is no work to do. so I gone through the state.h and found that there are different states. So I choose&amp;nbsp;&amp;nbsp;PM_STATE_RUNTIME_IDLE or PM_STATE_SUSPEND_TO_IDLE so just curious like if I select one of them then on some event how to wakeup the device to a normal state.&lt;/p&gt;
&lt;p&gt;Also is there any best state other than PM_STATE_SOFT_OFF which help my device to save more power without losing its context?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/thread/427777?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 11:49:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb2e7e8c-bef8-4f4e-a03b-68fcdbea660d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1. When the UART is suspended, it cannot detect any Rx data and you will not get any UART interrupts (the peripheral is not active at this point). So you will need some other mechanism to wake up. If you need to wake up on activity on the UART Rx pin, you could configure it as GPIO. But you will not be able to receive that data. UART was never intended to be low power, and there is no standardized concept of low-pwer UART communication. If you control both ends (both are nRF devices), you could use the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/drivers/uart_nrf_sw_lpuart.html"&gt;Low power UART driver&lt;/a&gt;, which use separate lines to state that there is data to send (so sort of the opposite of flow control, which is sued to signal that a device is ready to receive data).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. You don&amp;#39;t normally need to think about runtime idle. The idle thread puts the CPU is idle whenever there is no work to do, and any configured interrupts or events will wake up the device. Perhaps you can elaborate a bit more what you are after here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power mode on nrf5340 DK with uart disable</title><link>https://devzone.nordicsemi.com/thread/427719?ContentTypeID=1</link><pubDate>Fri, 26 May 2023 09:19:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9164f35e-73ff-42bf-94ce-95c9ca3424ac</guid><dc:creator>amar_d11</dc:creator><description>&lt;p&gt;hey , how did you manage to use&amp;nbsp;&lt;span&gt;PM_STATE_RUNTIME_IDLE? can you please share your code.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>