<?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>Going low power in freertos app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39918/going-low-power-in-freertos-app</link><description>Hi, 
 
 I have an app based on freertos_hrs example (nRF52832, SDK14.2) 
 I&amp;#39;m trying to get it into low power(sleep) mode, however the idle task keep on running and the system consumes ~4.5mA constantly (ble is off most of the time) 
 
 I tried the following</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Feb 2021 15:13:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39918/going-low-power-in-freertos-app" /><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/294672?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 15:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0f968a6-45ef-40a0-a04b-6fd4dd27a668</guid><dc:creator>Jens Hauke</dc:creator><description>&lt;p&gt;This code fragment uses approach 3 of the verified answer, but without the need of editing SDK source code. It injects the workaround with the help of a &amp;quot;configPRE_SLEEP_PROCESSING&amp;quot; macro in &lt;strong&gt;config/FreeRTOSConfig.h&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/* Fix for Errata #87 nrf52832 */                                       \
#define configPRE_SLEEP_PROCESSING(xMIdleTime) if ( xMIdleTime &amp;gt; 0 ) {  \
        __set_FPSCR(__get_FPSCR() &amp;amp; ~(0x0000009F));                     \
        (void) __get_FPSCR();                                           \
         NVIC_ClearPendingIRQ(FPU_IRQn);                                \
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the summarizing answer!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/157311?ContentTypeID=1</link><pubDate>Wed, 14 Nov 2018 13:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5fe0036-7480-47a1-adc5-28c117fc2e8f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Thanks for coming back with good suggestions. We really value users like you who do care for others and help them to avoid similar problems. One upvote to you from my side :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/156779?ContentTypeID=1</link><pubDate>Sun, 11 Nov 2018 10:31:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64001ba3-6871-4f41-bce7-30142d455cff</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Hi Susheel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For the sake of other fellow developers here is a summary of the issue and the solution that worked for me.&lt;/p&gt;
&lt;p&gt;The problem stems from the FPU generating an exception when doing floating point math. This interrupt can not be masked out as described in &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.Rev1.errata%2Fanomaly_832_87.html&amp;amp;cp=2_1_1_0_1_24"&gt;Errata 87&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As the FPU interrupt is pending, the &amp;#39;go to sleep&amp;#39; call sd_app_evt_wait() which DO get called when freertos goes idle (in tickles mode), does practically nothing as it wakes up immediately due to the pending FPU interrupt.&lt;/p&gt;
&lt;p&gt;To tackle this you should clear pending interrupt before calling&amp;nbsp;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;sd_app_evt_wait()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;There are 3 ways&amp;nbsp; to do so:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Clear the FPU interrupt immediately by hooking on&amp;nbsp;FPU_IRQHandler() as described in your post above; OR&lt;/li&gt;
&lt;li&gt;Clear it before idle task calls&amp;nbsp;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;sd_app_evt_wait()&lt;/span&gt; the way described in Errata 87 in port_cmsis_systick.c in&amp;nbsp;vPortSuppressTicksAndSleep() just before calling&amp;nbsp;sd_app_evt_wait(); OR&lt;/li&gt;
&lt;li&gt;Mimic the powering down sequence of non-freertos applications. This is done in nrf_power_mgmt_run() in nrf_pwr_mgmt.c&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I choose to go with option 3 and add the&amp;nbsp;PWR_MGMT_FPU_SLEEP_PREPARE() macro (with its &amp;#39;implementation&amp;#39;) to vPortSuppressTicksAndSleep() just before calling&amp;nbsp;sd_app_evt_wait().&lt;/p&gt;
&lt;p&gt;It worked extremely well for me, hopefully for other fellow developers.&lt;/p&gt;
&lt;p&gt;I would &lt;strong&gt;highly recommend&lt;/strong&gt; Nordic to implement this/similar fix on future version of the SDK\freertos examples&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;THANK YOU for your ongoing support.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2018_2D00_11_2D00_11-12_5F00_26_5F00_51_2D00_Window.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/156289?ContentTypeID=1</link><pubDate>Wed, 07 Nov 2018 11:58:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0a43b28-5048-4054-a932-cf492731e836</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="eyalasko"]how do I register an ISR? (so it appears in the vector table)[/quote]
&lt;p&gt;&amp;nbsp;make sure that that there is an entry in startup.s files in your project where we populate the vector table and it DOES NOT have default do nothiing logic with it. Since those entry in startup files are weak declaration any new declaration of the same function will override those implemenation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155810?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 16:52:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ed01417-d145-42f7-a7a4-975ceb4c4b30</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Hi Susheel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you feel that &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.Rev1.errata%2Fanomaly_832_87.html&amp;amp;cp=2_1_1_0_1_24"&gt;this &lt;/a&gt;may be the problem ?&lt;/p&gt;
&lt;p&gt;I can see that PWR_MGMT_FPU_SLEEP_PREPARE macro &lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;(that seems to workaround PAN87) &lt;/span&gt;is called in nrf_pwr_mgmt_run() just before sd_app_evt_wait() in &amp;#39;standard&amp;#39; app but NOT in freertos based app....&lt;/p&gt;
&lt;p&gt;Will update as soon as I get back to the office...&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;btw,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I feel silly to ask, but how do I register an ISR? (so it appears in the vector table)&lt;/p&gt;
&lt;p&gt;I only used event handlers in Nordic SDK so far.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155754?ContentTypeID=1</link><pubDate>Fri, 02 Nov 2018 12:53:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40d241f6-1e68-495a-8805-95b7863f8d27</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;This seems to be due to the fact that we did not handle any floating point exceptions.&lt;/p&gt;
&lt;p&gt;We can do one experiment&lt;/p&gt;
&lt;p&gt;Can you implement the FPU_IRQHandler and see if the power consumption goes low. Add below to your code and make sure that your vector table has&amp;nbsp;FPU_IRQHandler in its FPU IRQ address&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void FPU_IRQHandler(void)
{
    uint32_t *fpscr = (uint32_t *)(FPU-&amp;gt;FPCAR+0x40);
    (void)__get_FPSCR();

    *fpscr = *fpscr &amp;amp; ~(FPU_EXCEPTION_MASK);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155652?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 18:59:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:944291e5-5069-4ae2-8046-5b6814e1fcea</guid><dc:creator>eyalasko</dc:creator><description>&lt;div&gt;and its getting weirder &amp;hellip;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;On my post yesterday I&amp;#39;ve mentioned a &amp;#39;binary search&amp;#39;. What I did was to run my app with the ble stuff disabled - idle task hook was not triggered. Than I&amp;#39;ve re-enabled the ble stuff and the comb in the photo above appeared.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;Today I did the opposite - started with the ble stuff enabled and disabled all the application code. Everything looks fine.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;Than I&amp;#39;ve started to add my code - first all initialization code (still not creating tasks). Everything still looks OK.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Now I&amp;#39;m adding the first createTask() statement and the pulse train comes out again.&lt;br /&gt;I carefully comment out larger and larger sections of the &amp;#39;offending task&amp;#39; code till I get to a single line in a function that is called as part of the task&amp;#39;s initialization (before the while(1) loop)&lt;br /&gt;This is the &amp;quot;suspicious line&amp;quot;:&lt;/div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
thisObj-&amp;gt;_.numSamplesInBlock = (uint32_t)(TSAMPLE2SEC(thisObj-&amp;gt;cfg-&amp;gt;tInterval) * ACC_SAMPLE_RATE_Hz);&lt;/pre&gt;&lt;br /&gt;this long expression is merely a floating point calculation casted to uint32.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;I&amp;#39;ve replaced this line with&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;thisObj-&amp;gt;_.numSamplesInBlock = 7800;&lt;/pre&gt;&lt;br /&gt;and surprisingly (for me :) the system behave nice. No pulse train from the idle task hook !&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Now I start to play around and &amp;#39;strip down&amp;#39; the complex term above. nothing seems to help.&lt;br /&gt;Just out of curiosity I added a &amp;#39;dummy&amp;#39; float calculation -&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; float val = (float)300000; 
 val *= (float)1e-3; 
 thisObj-&amp;gt;_.numSamplesInBlock = 7800;&lt;/pre&gt;&lt;br /&gt;and the &amp;#39;beast&amp;#39; rises again&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;So here I&amp;#39;m standing - a na&amp;iuml;ve floating point calculation in the initialization code in one of my tasks (I have ton of places with floating calculation) seem to drive the system crazy.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Furthermore, I&amp;#39;ve deleted the 2 offending lines (float val ..&amp;amp; val *= ...) and copied them to main.c , just before&amp;nbsp;nrf_sdh_freertos_init() and the system behaves nicely (no pulses)&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Now I&amp;#39;m not sure if this plethora of information is helpful or not, but I&amp;#39;m scratching my head (or better said banging).&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;It has been a long post. phew...&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;btw, same behavior when pulses are driven from&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;vPortSuppressTicksAndSleep&lt;/span&gt;()&lt;/div&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: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155645?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 18:09:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50234df1-c8cc-4593-a744-91865e71d2be</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;same behavior when I toggle the bit in&amp;nbsp;vPortSuppressTicksAndSleep()...&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2018_2D00_11_2D00_01-20_5F00_06_5F00_46_2D00_C_5F005F00_DevTools_5F00_Nordic_5F00_nRF5_5F00_SDK_5F00_14.2.0_5F00_17b948a_5F005F00_projetcs_5F00_ble_5F00_peripheral_5F00_SmokeBeat_5F00_fr.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_20181101_5F00_200723.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155621?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 16:07:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f97da0b3-27f8-4daa-9be4-0bd5982f2bdf</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;something is weird with application idle hook here, but can you not use application idle hook and toggle the pin after the system wakes up in&amp;nbsp;vPortSuppressTicksAndSleep?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;make sure you disable application idle hook in FreeRTOSConfig.h file&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155604?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 15:09:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79c95b0f-271b-47ec-972d-5cba635d41c9</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;you are correct.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When I define BLE_DISABLE idle task hook is not being called (as expected).&lt;/p&gt;
&lt;p&gt;The problem occurs when the BLE stack is initialized - ble_stack_init() and softdevice task is created -&amp;nbsp;nrf_sdh_freertos_init(), then the idle task hook is constantly been called every ~23us....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155601?ContentTypeID=1</link><pubDate>Thu, 01 Nov 2018 14:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05a5f20a-cee5-4ac0-9fe1-eac7bb95ab40</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am guessing that since nothing is expected to happen, the wakeup time is programmed to be large and there is absolutely no activity on your chip when you define BLE_DISABLE and the chip does not wake up from __WFE&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155431?ContentTypeID=1</link><pubDate>Wed, 31 Oct 2018 20:11:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b21e8bc2-b9f7-412b-aeff-8e99ad18932b</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Hi Susheel&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve done some &amp;#39;binary search&amp;#39;, deactivarting increasing pieces of my code, eventually I&amp;#39;ve found that the problems lies with the &amp;#39;ble related&amp;#39; functionality - specifically softdevice_task.&lt;/p&gt;
&lt;p&gt;When the full app is running, the idle task hook is called every ~23us (~43KHz) (its only toggling a pin for debug) even if there&amp;#39;s no ble activity (advertising/connection)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void vApplicationIdleHook( void )
{
	static uint32_t cnt = 0;
	static TickType_t ticks = 0;
	
//#if NRF_LOG_ENABLED		
//        NRF_LOG_FLUSH();
//#endif	
//	(void) sd_app_evt_wait();
//	do{
//		__WFE();
//	} while (0 == (NVIC-&amp;gt;ISPR[0] | NVIC-&amp;gt;ISPR[1]));	

	nrf_gpio_pin_set(BSP_TP1);
	nrf_gpio_pin_clear(BSP_TP1);
	cnt++;
	ticks = xTaskGetTickCount();

}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When &amp;#39;ble stuff&amp;#39; (below) is left out, the idle task hook does not run at all (app&amp;#39;s 4 tasks are blocked and so is the idle task and timer task)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
#define BLE_DISABLE
#ifndef BLE_DISABLE	
    ble_stack_init();
#endif

    // Initialize modules.
	buttons_leds_init();
	
#ifndef BLE_DISABLE	
	timers_init();    
    gap_params_init();
    gatt_init();
    services_init();	// services_init() preceeds advertising_init() as it defines vendor speciic uuid that is used in 
    advertising_init();
    conn_params_init();

    // Create a FreeRTOS task for the BLE stack.
    // The task will run advertising_start() before entering its loop.
    //nrf_sdh_freertos_init(advertising_start, &amp;amp;erase_bonds);	// don&amp;#39;t erase bonds
	nrf_sdh_freertos_init(NULL, NULL);	// don&amp;#39;t start with advertising
#endif	
	
    // Start FreeRTOS scheduler.	
    vTaskStartScheduler();

    while (true)
    {
        APP_ERROR_HANDLER(NRF_ERROR_FORBIDDEN);
    }
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using sdk 14.2 on nRF52832&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What can be the reason for that ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/155025?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 08:51:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94bcb888-ab48-4014-8587-27003554c711</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;For me it looks like&lt;/p&gt;
&lt;p&gt;0x02002801 are&lt;/p&gt;
&lt;p&gt;0- POWER/CLOCK,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;11 - RTC0&lt;/p&gt;
&lt;p&gt;13 RNG&lt;/p&gt;
&lt;p&gt;25 SWI5&lt;/p&gt;
&lt;p&gt;all of which should owned by softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am sorry, there is a flaw in my suggestion, if your application has any higher priority interrupt that is waking your system then our breakpoint here will not work as that interrupt will already have been serviced by the time your breakpoint is hit.&lt;/p&gt;
&lt;p&gt;Can you start by looking at NVIC-&amp;gt;ISER[0] bit to see which application interrupts are enabled and start by&amp;nbsp; disabling those interrupts from your application at the peripheral level. I mean you need to disable that application interrupt inside the peripheral module that is generating that interrupt (NRF_XXX-&amp;gt;INTENCLR) and leave it as it is in NVIC. This way we disable the interrupt at the source one by one to see which interrupt is causing your system to wake that frequently.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/154922?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 15:54:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb643e8c-815a-403a-aa04-1c3fbe7dd3f8</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I followed your advice and placed a breakpoint right after&amp;nbsp;sd_app_evt_wait()&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;__NRF_NVIC_SD_IRQS_0&lt;/span&gt; (nrf_nvic.h) calculated value is : 0x4200F903&lt;/li&gt;
&lt;li&gt;NVIC-&amp;gt;ISPR[0] (@0xE0000100) = 0x02002801 / 0x02000801&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It seems that all NVIC&amp;#39;s bits are SD related (&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;RNG(occasional), RTC0, RADIO &amp;amp; NVMC_IRQ).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In this case shouldn&amp;#39;t the app remain a sleep ?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/2018_2D00_10_2D00_29-17_5F00_47_5F00_22_2D00_Window.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/154909?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 14:36:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9ab0b7a-a176-4063-92c9-54da386ff723</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You should be able to tell by looking into below registers immediately after &lt;span&gt;sd_app_evt_wait&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;(NVIC-&amp;gt;ISPR[0] | NVIC-&amp;gt;ISPR[1])&lt;/p&gt;
&lt;p&gt;and exclude softdevice specific bits __NRF_NVIC_SD_IRQS_0 (in&amp;nbsp;&lt;span&gt;NVIC-&amp;gt;ISPR[0]&amp;nbsp;&lt;/span&gt; ) and&amp;nbsp;__NRF_NVIC_SD_IRQS_1 (in &lt;span&gt;NVIC-&amp;gt;ISPR[1]&lt;/span&gt;) mentioned in nrf_nvic.h&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/154896?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 13:55:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:806712e8-0b1b-492d-b42d-a70199c57eff</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Hi Susheel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve added the 1st snippet to the idle task hook, unfortunately its still in the mA region..&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Is there a way to tell what was the event that caused &lt;/span&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;sd_app_evt_wait() to return ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/154848?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 11:54:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8aa2ab5-aa29-4176-95b7-0a3fee250a53</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Hi Susheel,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;your 2nd code snippet is in the &amp;#39;heart&amp;#39; of vPortSuppressTicksAndSleep() in port_cmsys_systick.c which is part of the freertos package (sort of &amp;#39;system file&amp;#39; in higher OSes)&lt;/p&gt;
&lt;p&gt;Do you mean to replace this in place (&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;vPortSuppressTicksAndSleep&lt;/span&gt;()) or add the 1st snippet to&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;vApplicationIdleHook&lt;/span&gt;() which is in the application file (main.c)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Going low power in freertos app</title><link>https://devzone.nordicsemi.com/thread/154846?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 11:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47db4538-8c01-4d4b-9240-9a12fb309859</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;which device are you running this on?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;instead of calling sd_app_evt_wait in&amp;nbsp;&lt;span&gt;vApplicationIdleHook, can you try to call below&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;                do{
                    __WFE();
                } while (0 == (NVIC-&amp;gt;ISPR[0] | NVIC-&amp;gt;ISPR[1]));
                &lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;instead of&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;            if (nrf_sdh_is_enabled())
            {
                uint32_t err_code = sd_app_evt_wait();
                APP_ERROR_CHECK(err_code);
            }&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>