<?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>High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100723/high-power-consumption---system-on</link><description>Hi, We are currently migrating our nrf5 SDK code to NCS (2.2.0 currently) on a custom nrf52833 board. 
 While in system off we have been able to achieve our expected sub-uA average consumption (between 0.5 and 0.8), we have been unable to reach our system</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Jun 2023 14:32:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100723/high-power-consumption---system-on" /><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/433496?ContentTypeID=1</link><pubDate>Wed, 28 Jun 2023 14:32:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c04b729e-dc97-4fa2-8321-820e8ca5a8bd</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sorry for the late reply, was away for few days.&lt;/p&gt;
[quote user="Roiger"]3.8 uA is great for us, but to achieve this we need to add an IDLE state sleep of 600 ms, which is what I was asking if this is standard[/quote]
&lt;p&gt;Ideally in Zephyr RTOS, if you have all threads behaving (yielding) properly, then you should not need to add additional sleep at all.&amp;nbsp;You should make sure that the idle thread in the Zephyr RTOS is able to run most of the time when there is nothing else to do on your application. The only way the idle thread runs is when all the other threads in your application have yielded properly (by k_yield, k_sleep, waiting for semaphore/mutex etc).&lt;/p&gt;
&lt;p&gt;The fact that you need to add additional sleep outside the idle thread means that atleast one of your application thread is not yielding. I would try to plug your application to &lt;a href="https://www.segger.com/products/development-tools/systemview/"&gt;Segger SystemView&lt;/a&gt;&amp;nbsp;and see if there are any threads that are running longer than it should without your additional sleep of 600ms.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/432226?ContentTypeID=1</link><pubDate>Wed, 21 Jun 2023 08:43:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bde41ba4-4bb5-413f-8bd4-fe9075fdec6f</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;We are using k_msleep as you say &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;p&gt;3.8 uA is great for us, but to achieve this we need to add an IDLE state sleep of 600 ms, which is what I was asking if this is standard&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/432223?ContentTypeID=1</link><pubDate>Wed, 21 Jun 2023 08:36:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9182a845-dc03-4aae-a4c9-b62270b68b7f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;In zephyr, the sleep is automatically done in the idle thread. So I am not really sure how you are forcing the sleep?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Making the device go to sleep in main might not be a best way to do it. It is better to use &lt;a href="https://docs.zephyrproject.org/apidoc/latest/group__thread__apis.html#ga51307cdfe153ab3e918b18755d97c5d9"&gt;k_mssleep&amp;nbsp;&lt;/a&gt;(if you are not using it already).&amp;#39;&lt;/p&gt;
&lt;p&gt;Also 3.8uA of current in system on sleep is not bad. How much is your goal to achieve with the RTOS and application running?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/432104?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 15:52:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36d53d41-3295-42e8-8167-017aa79ff1a1</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;We have managed to get down to around 3.8 uA average by changing our sleep logic to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sleep X=70 MS every main loop&lt;/li&gt;
&lt;li&gt;In addition, if there is no work to do, sleep an additional Y=600 MS every main loop.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This seems like a high amount of sleep to us to acheive this - is this what is to be expected on zephyr?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/431901?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 08:31:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eba430a3-5d23-4d6c-a73d-505233889930</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;As said above, the higher consumption is in system on only.&lt;/p&gt;
&lt;p&gt;System off is even slightlu better on our board on zephyr (~0.5 uA ) than on nrf5 sdk (~0.8 uA).&lt;/p&gt;
&lt;p&gt;Also as said - the measured 5.8 average is with a peripheral device that uses about 1.5 uA avg, but this overhead exists on our 3.3 uA measurement as well. With the peripheral device off, we acheive 1.8 uA on nrf5 sdk, but 4.3 uA on zephyr.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/431824?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2023 15:06:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa9fc87f-40ab-4825-8b08-eb4ff6ca6bfe</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am sorry for late reply,&amp;nbsp;That power consumption does not make sense.Either you have to test this on nRF52833 DK or help me reproduce it at my desk. I do not know any ERRATA that has about 4.5uA of increased current consumption in system off mode on nRF52833.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/431036?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 13:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0faabe66-430f-4d86-93d4-0fcb94f732b7</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;I thought it best to update that I also tried with a custom_board (as opposed to an overlay on nrf52833dk_nrf52833, and got the same measurements.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430799?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 14:23:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a99abfc1-5a28-4d7c-b525-4a4f36b0cfa3</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;For reference I have tried NCS 2.4.0 and the power consump even goes up a bit (5.9 uA average)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430760?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 12:40:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ccc16d31-879e-4634-8464-b9ec270a0db4</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;I have attempted to turn off everything in overlay that was not turned off in build/zephyr/zephyr.dts:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;nvic {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;i2c0 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;temp {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;gpiote {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;timer0 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;timer1 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;timer2 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;timer3 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;timer4 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;rtc0 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;rtc1 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;ecb {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;ccm {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;egu0 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;egu1 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;egu2 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;egu3 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;egu4 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;egu5 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;pwm0 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;acl {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;ppi {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;mwu {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;usbd {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;uart1 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;spi3 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;wdt0 {
    status = &amp;quot;disabled&amp;quot;;
};

&amp;amp;rng_hci {
    status = &amp;quot;disabled&amp;quot;;
};
&amp;amp;ieee802154{
    status = &amp;quot;disabled&amp;quot;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The only things not disabled are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;FICR&lt;/li&gt;
&lt;li&gt;UICR&lt;/li&gt;
&lt;li&gt;Clock&lt;/li&gt;
&lt;li&gt;Power&lt;/li&gt;
&lt;li&gt;Radio&lt;/li&gt;
&lt;li&gt;SPI1 - since we are using this for 2 peripherals&lt;/li&gt;
&lt;li&gt;ADC - we use this to measure battery every X hours&lt;/li&gt;
&lt;li&gt;RNG&lt;/li&gt;
&lt;li&gt;RTC2 - see above&lt;/li&gt;
&lt;li&gt;GPIO0&lt;/li&gt;
&lt;li&gt;GPIO1&lt;/li&gt;
&lt;li&gt;pinctrl&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;The average power consumption remains 5.8 uA&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430732?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:53:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8a549ec2-2c45-4e02-b119-2fa0cb291d65</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;As said we have tested this - but I will check again to make sure we have not missed anything &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;/li&gt;
&lt;li&gt;We were instructed by Nordic personnel to try and stay on the same release we started with for development stage - hence 2.2.0&lt;/li&gt;
&lt;li&gt;The level is constant - there are not peaks, it is just that the average is 5.8 instead of 3.3, but the graph seems the same shape in both cases&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430729?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:48:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:831ce010-d5d2-4e1a-8963-5c752a6a0172</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;The only things I can think about with the info you provided is&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Some peripheral might still be enabled. You can check the build\zephyr\zephyr.dts to see if there are any other peripheral that are kept enabled which were not enabled in nRF5SDK.&lt;/li&gt;
&lt;li&gt;maybe some errata workaround is missing that you applied in nRF5SDK? We have released NCSv2.4.0 which is more latest. When you are already putting efforts to move from nRF5SDK to NCS, why not move to the latest?&lt;/li&gt;
&lt;li&gt;can you connect the power profiler to the app based on nRF5SDK and the app based on NCS and see where the difference in power consumption happens? Do you see any particular spikes or increased current or the increased power is constant over time? It will help us understand the nature of the increase and hence might help us narrow down this to a peripheral that consumes the extra power.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430721?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:36:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81fada15-ac0c-49fb-9ded-13dcdd0f343f</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What are you referring to when you mean RTOS timing?&lt;/li&gt;
&lt;li&gt;regarding the disable - this is how it was on nrf5SDK - I can try without&lt;/li&gt;
&lt;li&gt;I have tried without the RTC(2) instance as well as turning off in prj.conf - the same level (5.8 uA average) occurrs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430705?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 11:15:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a05b937-330d-43eb-8aea-861ca01ddc9b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hmm,&lt;/p&gt;
&lt;p&gt;I do not see your flags handling and I assume that you handle them well without introducing any race conditions.&lt;/p&gt;
&lt;p&gt;You seems to need dedicated instance of RTC peripheral (RTC2), can&amp;#39;t you use the RTOS timing features instead of having a dedicated RTC in this case?&lt;/p&gt;
&lt;p&gt;Regarding below&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;	nrfx_rtc_tick_enable(&amp;amp;rtc, true);
    nrfx_rtc_overflow_enable(&amp;amp;rtc, true);
    nrfx_rtc_tick_disable(&amp;amp;rtc);
    nrfx_rtc_enable(&amp;amp;rtc);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Why do you enable and disable the tick immediately?&lt;/p&gt;
&lt;p&gt;What is the current you observe without initializing this addtional RTC(2) instance?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430694?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 10:58:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f86ea6b-84be-4f63-b436-73a21c5a4784</guid><dc:creator>Roiger</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;I cannot upload the code itself, but I can outline what is running when I measure these levels:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Within main loop:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Checking boolean flags - in 99% of the cases the work portion does not happen:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;			if(flag1 || flag2 || flag3){
				//work
			}&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;k_msleep&lt;/span&gt;&lt;span&gt;(100);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;Async during main loop:&lt;/strong&gt;&lt;/span&gt;
&lt;ul&gt;
&lt;li&gt;Two buttons awaiting interrupts - awaiting on GPIO_INT_LEVEL_ACTIVE&lt;/li&gt;
&lt;li&gt;Single shot timer is running, and is restarted every minute:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;//definition
K_TIMER_DEFINE(sleep_timer, sleep_timer_elapsed, sleep_timer_stopped);

// start logic
k_timer_start(&amp;amp;sleep_timer, K_MINUTES(1), K_NO_WAIT);&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;RTC2 is running with 511 prescaler:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;const nrfx_rtc_t rtc = NRFX_RTC_INSTANCE(2);

    int ret;
    nrfx_rtc_config_t config = {.prescaler = SYS_TIME_PRESCALER, .reliable = false, .tick_latency = 1,
                                .interrupt_priority = NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY};


    ret = nrfx_rtc_init(&amp;amp;rtc, &amp;amp;config, rtc_handler);
    	if (ret &amp;lt; 0) {
		return;
	}
	nrfx_rtc_tick_enable(&amp;amp;rtc, true);
    nrfx_rtc_overflow_enable(&amp;amp;rtc, true);
    nrfx_rtc_tick_disable(&amp;amp;rtc);
    nrfx_rtc_enable(&amp;amp;rtc);&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Roi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Power Consumption - System On</title><link>https://devzone.nordicsemi.com/thread/430684?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 09:48:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4b450ed-4477-4863-8dfb-e1b4976da34d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;What is the main application doing? Since you achieved lower currents in nRF5SDK, it most likely is a configuration issue rather than any hw/sw issue.&lt;/p&gt;
&lt;p&gt;But it is hard for me to narrow down the problem with the information given. Can you please provide me the whole application project so that I can try to debug that here?&lt;/p&gt;
&lt;p&gt;Also there might be little more overhead in kernel tick handling which might consume little more power than the bate metal examples. I have not benchmarked how much more but should be that big difference like you are observing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>