<?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>NRF9160 Deep Sleep Power Consumption Help</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81744/nrf9160-deep-sleep-power-consumption-help</link><description>Hello, 
 I am using mfw1.3.0 and NCS 1.7.0 developing an application on a custom board implementing the NRF9160 and NRF52820 (The 52820 is put into very low power using nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF);). 
 There is a state</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Dec 2021 07:53:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81744/nrf9160-deep-sleep-power-consumption-help" /><item><title>RE: NRF9160 Deep Sleep Power Consumption Help</title><link>https://devzone.nordicsemi.com/thread/342825?ContentTypeID=1</link><pubDate>Fri, 10 Dec 2021 07:53:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f0354f5-5644-40ef-8d5c-5cf7b803304a</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Thanks. So that&amp;#39;s definitely not the regulator in refresh mode as I mentioned in my last reply. Looks like something is being polled every ~50ms. But, if the nRF91 CPU is waking up I would expect the current to be higher.&lt;/p&gt;
&lt;p&gt;It could be the PWM. Is it enabled?&lt;/p&gt;
&lt;p&gt;Are you sure the nRF91 is causing this? It could be an external sensor or similar, if you have that.&lt;/p&gt;
&lt;p&gt;You are also welcome to send me your board for further debugging, but because of new covid regulations access to the office/lab is restricted at least the next two weeks, so it would have to wait probably until after Christmas. If you choose to do so please create a new private ticket and mention my name.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Deep Sleep Power Consumption Help</title><link>https://devzone.nordicsemi.com/thread/342792?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 20:34:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8be172b5-a526-4860-bb0e-78012ff79cd7</guid><dc:creator>TylerS</dc:creator><description>&lt;p&gt;Ok, Thank you for the information. The fact that it would cause a 500-600 uA draw makes me think UART may not be the issue. Here is a rough capture of the best sleep current we have gotten so far where 1mv = 1uA:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/sleepCapture.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It seems the lower level current is in the 300-400uA range. Most of this is likely caused by other peripherals on the PCB that are consuming power.&lt;br /&gt;&lt;br /&gt;One other note is that we are using the SICA-B1A revision of the 9160. I am unsure if this new revision could change sleep current consumption etc.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Tyler&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Deep Sleep Power Consumption Help</title><link>https://devzone.nordicsemi.com/thread/342674?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 10:41:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7ce91fe-dfdf-4628-b4c8-8feb837b04ef</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;1. In the UART driver *_LOW_POWER, *_OFF and *_SUSPEND leads to the same code, which is disabling the UART:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/18e072b03270436fcd58312217fa8f362abb5ccd/drivers/serial/uart_nrfx_uarte.c#L1871"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/18e072b03270436fcd58312217fa8f362abb5ccd/drivers/serial/uart_nrfx_uarte.c#L1871&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the zephyr documentation they use the definitions &amp;quot;Device context is preserved/lost/may be lost, etc..&amp;quot;. How this exactly translates in the peripheral hardware/low level driver depends on the type of hardware. In the case of the UART, it&amp;#39;s either enabled or disabled. It would be nice to describe how this should be interpreted in the respective peripheral driver documentations. I will create a request for this.&lt;/p&gt;
&lt;p&gt;2. You should expect to see about 600 uA less current consumption. If there is a periodic current draw every 50 ms I don&amp;#39;t think it&amp;#39;s the HF clock. Are you able to post any plots? If the current is in the &amp;lt;10uA range between the spikes and the current goes up to 500-600 uA every 50 ms I&amp;#39;m thinking that this is the regulator in refresh mode (burst mode). The regulator will always draw current in bursts during idle, and the average current including the bursts is what is relevant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Deep Sleep Power Consumption Help</title><link>https://devzone.nordicsemi.com/thread/341928?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 19:14:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6540975b-09fe-4f49-a33c-4cdd5614733e</guid><dc:creator>TylerS</dc:creator><description>&lt;p&gt;Hi Stian,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for the thorough response. It is very helpful. A couple of questions / clarification regarding your response:&lt;br /&gt;&lt;br /&gt;1. You mention that in order to dynamically turn on and off UART we should be using the&amp;nbsp;pm_device_state_set() function. I am still a bit confused about the exact states to use inside of the application. My understanding from your response is that we should first use&amp;nbsp;pm_device_state_set(console, PM_DEVICE_STATE_OFF, NULL, NULL); to disable UART in the application until it is needed. Next to turn it back on we should change the state to:&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/power_management/index.html#c.pm_device_state.PM_DEVICE_STATE_ACTIVE"&gt;&lt;code&gt;&lt;span&gt;PM_DEVICE_STATE_ACTIVE&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;. Lastly, in order to disable UART before sleeping we should change the state to:&amp;nbsp;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/power_management/index.html#c.pm_device_state.PM_DEVICE_STATE_SUSPENDED"&gt;&lt;code&gt;&lt;span&gt;PM_DEVICE_STATE_SUSPENDED&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;. Is this correct? I am a bit confused why we should use both the OFF state as well as the SUSPENDED state and why not just one or the other.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;2. How much current consumption savings should we expect to see after disabling UART and therefore stopping use of the HF clock during deep sleep? Right now we are seeing a periodic current draw where there is about 500-600 uA of draw every 50ms or so. Trying to track that down and see if it is in fact the HF clock.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Thank you again for all of the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Deep Sleep Power Consumption Help</title><link>https://devzone.nordicsemi.com/thread/340590?ContentTypeID=1</link><pubDate>Wed, 24 Nov 2021 16:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:232df082-258e-4354-a115-c1def9448868</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Hi, sorry for the late response.&lt;/p&gt;
[quote user=""]What is the real reason that turning serial off saves power in deep sleep?&amp;nbsp;From looking at other tickets I think that the root cause of the power draw is keeping the HF clock active in deep sleep which can draw a decent amount of current.[/quote]
&lt;p&gt;The UART, more specifically the UART receiver is using the HF clock constantly, because it is always ready to receive data. The UART peripherals are automatically enabled in zephyr, and thus also the UART receivers. This includes the logging module which is using UART0, but also UART1 and UART2, even though they may not be used at all. You will have to explicitly disable these peripherals if they are not used in the .overlay file.&lt;/p&gt;
&lt;p&gt;Using CONFIG_SERIAL=n is a quick way to turn off all UARTs. But as you say, if you are actually going to use any of the UARTs, it can not be used. I would recommend to only use this config in the SPM config file, as this will turn off the logging module in the SPM, and then you can still use UART in the application.&lt;/p&gt;
&lt;p&gt;The HF clock current does not add up when enabling several peripherals that are using the HF clock. So the current will stay at 5-600 uA and not go down until all peripherals requiring the clock are disabled.&lt;/p&gt;
[quote user=""]Are there other peripherals that could be causing the same issue for us still? We use I2C, SPI, UART, PWM, and GPIO in the application. [/quote]
&lt;p&gt;I2C slave, GPIOTE IN event and SPI slave will use a pin sense mechanism which will consume current in the 20-50 uA range. The HF clock will only be started when there is a transaction. PWM and other &amp;quot;master&amp;quot; peripherals will only use the HF clock when they are active (as in ongoing transaction, or PWM output)&lt;/p&gt;
[quote user=""]What is the best way to have serial enabled in the application but turn the peripheral off before sleeping in NCS1.7.0 and mfw1.3.0?[/quote]
&lt;p&gt;&lt;strong&gt;Power management API&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The best way is to use the power management API:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add CONFIG_SERIAL=n to the SPM prj.conf&lt;/li&gt;
&lt;li&gt;Add CONFIG_DEVICE_POWER_MANAGEMENT=y to the application prj.conf&lt;/li&gt;
&lt;li&gt;And the following to main in order to turn off logging (and UART0)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;pm/pm.h&amp;gt;

void main(void)
{
    const struct device *console;
    console = device_get_binding(DT_LABEL(DT_CHOSEN(zephyr_console)));
    pm_device_state_set(console, PM_DEVICE_STATE_OFF, NULL, NULL);
    
    .....
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then you can use the same pm_device_state_set() function to turn the UART1 or UART2 on or off dynamically. Use &lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/power_management/index.html#c.pm_device_state.PM_DEVICE_STATE_SUSPENDED"&gt;&lt;code&gt;&lt;span&gt;PM_DEVICE_STATE_SUSPENDED&lt;/span&gt;&lt;/code&gt;&lt;/a&gt; and &lt;em&gt;&lt;span&gt;&lt;/span&gt; &lt;/em&gt;&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/reference/power_management/index.html#c.pm_device_state.PM_DEVICE_STATE_ACTIVE"&gt;&lt;code&gt;&lt;span&gt;PM_DEVICE_STATE_ACTIVE&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;&lt;code&gt;&lt;span&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using an overlay file&lt;/strong&gt;&lt;code&gt;&lt;span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s also a good idea to use an .overlay file to modify the device tree so that peripherals you are not using are disabled. Below is an example where UART1, UART2, and the receiving part of UART0 is disabled. Now UART0 is available for log output, but the receiver is switched off, which means that UART0 will not request the HF clock and neither will UART1 or UART2, so the current consumption should go down to about 50 uA which is the &amp;quot;enabled only&amp;quot; current for UART0. (Note: You can not disable UART0 completely using the overlay file, as this is used by the logging module, unless you disable the logging module in the config files)&lt;/p&gt;
&lt;p&gt;The overlay file should be named the same as the board you are compiling for, and be put in the project folder. E.g. nrf9160dk_nrf9160ns.overlay&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;amp;uart0 {
    /delete-property/ rx-pin;
};
&amp;amp;uart1 {
    status = &amp;quot;disabled&amp;quot;;
};
&amp;amp;uart2 {
    status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So to summarize:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CONFIG_SERIAL=n only in SPM project&lt;/li&gt;
&lt;li&gt;Use power management API to dynamically power on/off the UARTs. The UART should not consume any current when suspended.&lt;/li&gt;
&lt;li&gt;Use power management API to turn off logging module (UART0), if it&amp;#39;s not needed.&lt;/li&gt;
&lt;li&gt;Use .overlay file to disable unused peripherals.&lt;/li&gt;
&lt;li&gt;Use .overlay file to turn off RX, of you are only using TX. In this mode the peripheral will consume about 50 uA, and you do not have to use the power management API if 50 uA is acceptable. You can use this method on the logging module (UART0)&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Deep Sleep Power Consumption Help</title><link>https://devzone.nordicsemi.com/thread/339312?ContentTypeID=1</link><pubDate>Tue, 16 Nov 2021 22:37:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0150d34a-5f47-4285-a015-f988ff03eebb</guid><dc:creator>TylerS</dc:creator><description>&lt;p&gt;Wanted to add a bit more flavor here, and a quick update. We have gotten the average current draw down to around 500uA by powering down some other SOC peripherals (Accelerometer etc.)&amp;nbsp; I am using a &amp;quot;Current Ranger&amp;quot; to measure the current and hooked up my scope to grab the waveform while it is in deep sleep.&lt;/p&gt;
&lt;p&gt;It seems like some internal system is periodically pulling maybe around 600uA or so at a period of about 25ms. Is this typical of some internal peripheral on the 9160?&lt;/p&gt;
&lt;p&gt;We have also learned that mfw1.3.1 is what will be supported soon by the US carriers so we will be developing on this version going forward.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>