<?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>FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14275/freertos-tickless-idle-vs-tick-current-consumption</link><description>We have been comparing the current consumption of the nRF52 running FreeRTOS Tickless Idle versus a constant tick and using the idle task to sleep and the results are interesting, see below. 
 June 7th Edit: SDK 11, SoftDevice S132 2.0.0.0, Silicon is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Oct 2018 15:47:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14275/freertos-tickless-idle-vs-tick-current-consumption" /><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/153320?ContentTypeID=1</link><pubDate>Wed, 17 Oct 2018 15:47:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1033ef3a-d328-4c60-aea0-8d143432da31</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/inghowe83"&gt;inghowe83&lt;/a&gt; I forgot to mention that the ~110uA I quoted was on a design where most of the current was due to a lot of leakage through various protection circuits.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/153232?ContentTypeID=1</link><pubDate>Wed, 17 Oct 2018 12:34:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:057bfb4e-03ee-4878-ace1-146931df6886</guid><dc:creator>inghowe83</dc:creator><description>&lt;p&gt;Thanks! It does help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/149927?ContentTypeID=1</link><pubDate>Mon, 24 Sep 2018 06:02:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b672ddb1-e406-4704-b694-6adb0996a6cf</guid><dc:creator>mtsunstrum</dc:creator><description>&lt;p&gt;From&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/35386/application-with-freertos---lowest-possible-current-in-idle"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/35386/application-with-freertos---lowest-possible-current-in-idle&lt;/a&gt;&amp;nbsp;it looks like one was able to get down to 9uA (when no advertising)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/142465?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 15:45:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b7df661-7cd9-4f69-bec2-9b8735baebd7</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/inghowe83"&gt;inghowe83&lt;/a&gt; I don&amp;#39;t have updated results in a form that I can share at the moment.&amp;nbsp; This post is quite old and used very early versions of the S132 and SDK for the nRF52832.&amp;nbsp; What I can tell is that for a recent project using S132 4.0.3 and SDK 13.0.0 which uses FreeRTOS in tickless idle we were getting an average quiescent current of ~110uA at 2.5V for normal operation with no advertising.&lt;/p&gt;
&lt;p&gt;Does this help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/142273?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 00:58:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:944d335a-a972-4c1f-8d96-4346b5a904af</guid><dc:creator>inghowe83</dc:creator><description>&lt;p&gt;Hi Darren,&lt;/p&gt;
&lt;p&gt;May I know what was the latest current consumption for your tickless project? What will be the current difference between system on Idle vs freeRTOS tickless?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54488?ContentTypeID=1</link><pubDate>Sat, 11 Jun 2016 07:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b74a43ea-1176-4c19-b082-c7c4f80dd18e</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I don&amp;#39;t think that&amp;#39;s a problem, there&amp;#39;s no guarantee that sd_app_evt_wait(), which is what&amp;#39;s in the middle of the tickless idle loop, will actually sleep the chip. Much like WFE, you may have to call it twice in succession to start with for it to actually wait. If that&amp;#39;s all that&amp;#39;s happening, ie at the start of every tickless idle period you&amp;#39;re going into tickless idle twice, I think that&amp;#39;s fine, as long as it&amp;#39;s only once every time, ie the second entry actually waits.&lt;/p&gt;
&lt;p&gt;Probably if you instrumented the idle tick sd_app_evt_wait() you&amp;#39;d see something similar, two calls before it waits.&lt;/p&gt;
&lt;p&gt;That doesn&amp;#39;t explain the trace at the top still which has spikes all over the place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54487?ContentTypeID=1</link><pubDate>Sat, 11 Jun 2016 06:02:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4f5d49a-7832-4229-9279-87726507476a</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;RK,&lt;/p&gt;
&lt;p&gt;So I have some more to add to this thread thanks to your blog post on the Segger SystemView &lt;a href="https://devzone.nordicsemi.com/blogs/952/instrumenting-with-segger-systemview/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; see above for a snapshot from a run with tickless idle enabled (the idle task hook is disabled).  &lt;strong&gt;Note&lt;/strong&gt; I re-purposed the FreeRTOS configPreSleepProcessing(x) and configPostSleepProcessing(x) to record the expected number of sleep ticks.  It appears that FreeRTOS prepares to go to sleep, enters sleep and then immediately wakes up for some un-instrumented reason and then goes back to prepares to go back to sleep and succeeds.&lt;/p&gt;
&lt;p&gt;Any thoughts would be greatly appreciated.
Thanks,
Darren&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54486?ContentTypeID=1</link><pubDate>Sat, 11 Jun 2016 06:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37e303bb-2913-47a4-9fb0-9bf94be55ef2</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/SystemView-Tickless-Capture.PNG" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54485?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 02:42:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd163c95-db35-437a-abe4-137136f7dd82</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;still  makes no sense. And you missed a bit &amp;quot;at the ADC task frequency of 160ms and the  .. &amp;quot; and the what?&lt;/p&gt;
&lt;p&gt;if all you&amp;#39;ve done is put sd_app_evt_wait() into the IDLE function then as long as you are actually getting into tickless idle mode (ie a long wait) the two tests are doing almost basically the same thing, because in the middle of the tickless loop in the port is just sd_app_evt_wait(). So the IRQ fires, you go around the scheduler loop once and back into tickless mode, unless an event is scheduled within a tick or two at which point it busy idles.&lt;/p&gt;
&lt;p&gt;At this point I suggest you hook RTT up to both setups and log a minimal set of milestones along with the value of the cycle counter to work out when you are getting interrupted, when you enter the idle loop and when you start and end tickless mode and when you drop out of sd_app_evt_wait() in the idle loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54484?ContentTypeID=1</link><pubDate>Wed, 08 Jun 2016 00:05:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:674c4b86-4068-41a4-aa8a-7899c552e714</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;RK, Anders,&lt;/p&gt;
&lt;p&gt;Thanks for your thoughts.&lt;/p&gt;
&lt;p&gt;In these tests the system is running using timed tasks the only peripherals running is the ADC and RTC1 for FreeRTOS.  The debugger is disconnected and the UART is disabled. This is the case for both above traces.  The spikes that RK asked about are at the ADC task frequency of 160ms and the .  The ADC is configured for scan mode but has NRF_52_PAN28 defined.  These tests are being run on QFAABB or Rev C silicon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54482?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2016 12:03:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a09dd54-0daa-4bf2-8b1c-f1623eb680d0</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;This is why I wanted to know what code is running, is it just timed code, at which point it will only task switch at a tick and I&amp;#39;d expect the bottom trace, or are there async events at which point I&amp;#39;d expect something like the top trace (assuming the async events call the yield function properly).&lt;/p&gt;
&lt;p&gt;The only case in the middle is where it&amp;#39;s timed code but the expected timeout is always one tick, so tickless mode never actually goes tickless and runs around the idle loop. I suppose running tickless and also putting sd_app_evt_wait() in the idle loop might be an interesting test, if it then looks like the bottom trace that would indicate that tickless mode isn&amp;#39;t ever really being entered.&lt;/p&gt;
&lt;p&gt;But yes knowing whether the code is just timer based or there&amp;#39;s an async part to it would be rather helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54483?ContentTypeID=1</link><pubDate>Tue, 07 Jun 2016 10:38:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b05daaf6-305f-4f6c-9be9-7bb694d9f9d6</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;When doing tickless idle, the port sets up a wakeup timer to wake up in time for the next rtos event. In your case, you are just going to sleep and &amp;quot;hope&amp;quot; that something wakes you up at some point. It could just be that the rtos &amp;quot;oversleeps&amp;quot; because there is no mechanism to wake it up in time. So the question is: What is waking up the CPU after sleeping in idle task?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54481?ContentTypeID=1</link><pubDate>Sat, 04 Jun 2016 01:08:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2287a067-6a3d-45f7-a805-308a5861f423</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;... ( I hate that comments are limited) ... and the tickless function is called from the tick idle, just with the tick turned off and a compare interrupt turned on for a future time. So what you&amp;#39;re doing sleeping in the idle handler is a superset of what tickless idle is doing, assuming you&amp;#39;re even getting into tickless idle mode.&lt;/p&gt;
&lt;p&gt;The bottom trace, are those spikes at your RTC tick frequency, it&amp;#39;s tempting to assume they are, but perhaps they are only every 10 or 20 ticks. How often are you doing work, every tick? Less than 2-3 ticks of idle, you&amp;#39;re not actually getting into sleep mode.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve just spent bits of this week instrumenting things with SystemViewer, not only Nordic&amp;#39;s FreeRTOS port but my own and also the softdevice itself. Would be interesting to apply that analysis, although having the debugger attached may mess up the results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54480?ContentTypeID=1</link><pubDate>Sat, 04 Jun 2016 00:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:501ce8af-e452-478a-9db0-00f83f2cbfb2</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I can&amp;#39;t think up a scenario which would give those results. OK so the SD is on but not even advertising, which means it generates no interrupts, it&amp;#39;s really doing nothing at all. What code do you have running, just a few tasks which run on a timed basis or are there async bits to it, like external interrupts, SPI/TWI/UART data transfers etc? If it&amp;#39;s just tasks running on timers, there&amp;#39;s nothing to cause the chip to wake from sleep apart from the RTC tick, which runs (in the nordic port) at the RTOS tick rate.&lt;/p&gt;
&lt;p&gt;I wondered if the tick idle was being entered with interrupts turned off (BASEPRI set) but if that were the case, the RTC tick wouldn&amp;#39;t wake you either, so that can&amp;#39;t be it.&lt;/p&gt;
&lt;p&gt;I assume in the idle handler you&amp;#39;re just calling sd_app_event_wait(). The reason it makes no sense is because the Nordic RTOS port also just calls sd_app_event_wait() in the tickless function ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54479?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2016 22:50:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eff50de9-00a7-41a0-b4fe-849453a7ec82</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;RK,&lt;/p&gt;
&lt;p&gt;Yes, we are sure we have the test right the results can be easily duplicated.  Yes, the softdevice is loaded and active but advertising is disabled.&lt;/p&gt;
&lt;p&gt;As I said above the only difference is tick mode is using the idle task and is calling sd_app_evt_wait()
where as tickless idle has the idle task disabled and is using Nordic&amp;#39;s implementation of vPortSuppressTicksAndSleep()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54477?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2016 22:47:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d942ee6-c2b8-4a8d-b0e8-0dfef686acb9</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;We are instrumenting the floating point interrupt to see how often it&amp;#39;s triggering but I can tell you that we don&amp;#39;t have a lot of floating point operations.  We are not using Systick since it&amp;#39;s clocked with the processor core in this part, we are using one of the RTC clocked from 32.768kHz.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know if the tickless idle period is actually being calculated correctly what&amp;#39;s the best way to this?&lt;/p&gt;
&lt;p&gt;From a test perspective the the system is configured in the exact same way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54478?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2016 10:53:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29ade235-6b55-4da4-b4fa-03f43d794d45</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I also can&amp;#39;t figure out what on earth would produce those results.&lt;/p&gt;
&lt;p&gt;What&amp;#39;s running on the chip, do you have the softdevice loaded and active, is it doing anything at all? The tickless mode should be showing less than the other one, if it has nothing scheduled then it should put itself to sleep for seconds or minutes or basically forever.&lt;/p&gt;
&lt;p&gt;Are you sure you&amp;#39;ve got this test right? Because it really makes no sense at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FreeRTOS Tickless Idle vs Tick Current Consumption</title><link>https://devzone.nordicsemi.com/thread/54476?ContentTypeID=1</link><pubDate>Fri, 03 Jun 2016 08:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6a38fe4-1d80-43ed-9fd8-d9a8ce3a0d41</guid><dc:creator>www.FreeRTOS.org</dc:creator><description>&lt;p&gt;From a first glance, the two plots do not appear to be showing the same execution pattern, assuming the current spikes are where interrupts are being executed.  The bottom plot shows a regular periodic current spike, which I am assuming is the tick interrupt.  The top plot is showing current spikes with no determinable pattern, so what is being processed during the current spikes?  If these spikes are interrupts other than the tick interrupt being processed, then why do those interrupts not show on the bottom plot too?&lt;/p&gt;
&lt;p&gt;How often are the floating point interrupts being generated?  If it is at a rate greater than the setting of &lt;a href="http://www.freertos.org/low-power-tickless-rtos.html"&gt;configEXPECTED_IDLE_TIME_BEFORE_SLEEP&lt;/a&gt; then there is no point in using tickless idling - but that would not explain the lack of these current spikes in the bottom plot.&lt;/p&gt;
&lt;p&gt;Are you sure the tickless idle period is actually being calculated correctly, and you not seeing spikes when the system is coming out of tickless mode at an erroneous time?&lt;/p&gt;
&lt;p&gt;When you use tickless idle, with a clock other than the SysTick, you have the opportunity to enter a much deeper sleep that if you either use the SysTick or use the idle task as per the lower plot.  That is because you have the opportunity to turn more clocks off.  Are you making use of a deep sleep mode in the tickless idle case?  Note again though, that entering a deep deep sleep mode takes time to enter and exit, so the benefits are obtained when you are sleeping for long periods, not when continuously processing other interrupts that bring you out of sleep mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>