<?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>Device does not come out of low power</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115849/device-does-not-come-out-of-low-power</link><description>We are using nRF52833 with Softdevice S113 for BLE. 
 
 in the OS_Idle function, nrf_pwr_mgmt_run is called. 
 But never comes out of sleep. 
 Is there a need to call nrf_drv_power_sleepevt_init? 
 Are examples available? 
 
 thanks 
 Geert Venken</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Oct 2024 08:26:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115849/device-does-not-come-out-of-low-power" /><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508296?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 08:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecfab2dc-5093-4c53-a9f6-8a9c2f74fa0d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;It&amp;#39;s my bad, I should have&amp;nbsp;referenced the&amp;nbsp;full function name without any abbreviation. Anyway, thanks for confirming that you see the same behavior with __WFI(). This suggests that the issue isn’t with the sleep function (__WFI() or nrf_pwr_mgmt_run()) but rather that the RTC isn’t triggering the wake-up interrupt as expected.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508227?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 16:54:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f7a8f03-5af7-4bbb-8a1a-8e13ddbb45b3</guid><dc:creator>geert_venken</dc:creator><description>&lt;p&gt;Sorry for the misunderstanding.&lt;/p&gt;
&lt;p&gt;Now I got your point. In&amp;nbsp;nrf_pwr_mgmt_run I removed all related to softdevice and always call __WFI.&lt;/p&gt;
&lt;p&gt;No success.&amp;nbsp; Same behavior.&lt;/p&gt;
&lt;p&gt;I also enabled&amp;nbsp;PWR_MGMT_DEBUG_PIN_SET and routed this to a LED.&amp;nbsp; Goes on but never off.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Watchdog&amp;nbsp;resets the system.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508187?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 13:53:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7f73499-9666-4779-a83a-096042f58aa4</guid><dc:creator>geert_venken</dc:creator><description>&lt;p&gt;SD function?&lt;/p&gt;
&lt;p&gt;Do you mean, if I replace WFE by WFI or visa versa in&amp;nbsp;nrf_pwr_mgmt_run?&lt;/p&gt;
&lt;p&gt;This does not make a difference, same behavior.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508183?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 13:42:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eae69b61-4fb8-41be-b2ce-c09dc60ac563</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hm, does it work if you replace the SD function with a __WFE() or __WFI()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508181?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 13:41:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9b6f9ed-c5b9-40bf-bdd4-3b2a8a438fc3</guid><dc:creator>geert_venken</dc:creator><description>&lt;p&gt;Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This line was already in the function&amp;nbsp;OS_InitHW, added it additionally ot main, but no success.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508142?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 12:28:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3fe7d2d-5bf2-4b10-82e8-d7bfe65ba030</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Geert,&lt;/p&gt;
[quote userid="4240" url="~/f/nordic-q-a/115849/device-does-not-come-out-of-low-power/508138"]EDIT: Please enable SEVONPEND to see if it helps. You can do this by adding this line at the beginning of main():[/quote]
&lt;p&gt;This will be needed to wakeup on pending RTC IRQ ( if interrupt is disabled for this IRQ).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508140?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 12:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f14c1e0-f1c5-4b50-a77f-0a4c09c44629</guid><dc:creator>geert_venken</dc:creator><description>&lt;p&gt;Hi Vidar,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We are using embOS and interrupts are enabled.:&lt;/p&gt;
&lt;p&gt;This is the Idle funciton:&lt;/p&gt;
&lt;p&gt;void OS_Idle(void) { // Idle loop: No task is ready to execute&lt;br /&gt;#if USE_TICKLESS_IDLE == 1&lt;br /&gt;&amp;nbsp; if (low_power_enabled) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; OS_INT_IncDI();&lt;br /&gt;&amp;nbsp; &amp;nbsp; OS_TIME idleTicks = OS_TICKLESS_GetNumIdleTicks();&lt;br /&gt;&amp;nbsp; &amp;nbsp; if (idleTicks &amp;gt; RTC_WAKEUP_MIN_TIME) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if (idleTicks &amp;gt; RTC_WAKEUP_MAX_TIME) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; idleTicks = RTC_WAKEUP_MAX_TIME;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if (idleTicks &amp;gt; 1000) { // more than 1 second&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rtc_suspend_interrupt();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; rtc_set_wakeup(idleTicks, &amp;amp;WakeupCallback);&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SysTick-&amp;gt;CTRL = SysTick_CTRL_CLKSOURCE_Msk |&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; SysTick_CTRL_ENABLE_Msk; /* Disable SysTick IRQ */&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; OS_TICKLESS_Start(idleTicks, &amp;amp;EndTicklessMode);&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; &amp;nbsp; OS_INT_DecRI();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;#endif&lt;br /&gt;#if USE_LOAD_MEASUREMENT == 1&lt;br /&gt;&amp;nbsp; while (1) { // Nothing to do ... increment counter for load measurement&lt;br /&gt;&amp;nbsp; &amp;nbsp; OS_INC_IDLE_CNT();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;#else&lt;br /&gt;&amp;nbsp; while (1) { // Nothing to do ... wait for interrupt&lt;br /&gt;&amp;nbsp; if (low_power_enabled) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; nrf_pwr_mgmt_run();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt; }&lt;br /&gt;#endif&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Interrupts are disabled around the RTC calculations and function but not around the nrf_pwr_mgmt_run function.&lt;/p&gt;
&lt;p&gt;What I noticed when the WFE is called (in the debugger)&lt;/p&gt;
&lt;p&gt;:&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1730118366813v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Must these be set to 1?&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Geert&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device does not come out of low power</title><link>https://devzone.nordicsemi.com/thread/508138?ContentTypeID=1</link><pubDate>Mon, 28 Oct 2024 12:16:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ef8b06d-e95c-45c1-9a1f-d5d7e5d578ba</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Are you using embOS and do you know if interrupts are disabled when this function is called?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;EDIT: Please enable SEVONPEND to see if it helps. You can do this by adding this line at the beginning of main():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;SCB-&amp;gt;SCR |= SCB_SCR_SEVONPEND_Msk;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>