<?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 Zephyr Idle Hooks</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63344/nrf9160-zephyr-idle-hooks</link><description>Hi, 
 Is it possible to be notified when the device is entering/exiting idle? All I can see is that idle thread calling k_cpu_idle which doesn&amp;#39;t appear to have any hooks? I see you can enable CONFIG_SYS_POWER_DEEP_SLEEP_STATES, and CONFIG_HAS_SYS_POWER_STATE_DEEP_SLEEP_1</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Jul 2020 12:39:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63344/nrf9160-zephyr-idle-hooks" /><item><title>RE: NRF9160 Zephyr Idle Hooks</title><link>https://devzone.nordicsemi.com/thread/259686?ContentTypeID=1</link><pubDate>Mon, 13 Jul 2020 12:39:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1783ab87-a938-4abf-9fae-6e812db7551b</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Would this solution work for you:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;One solution could be to create a thread with the lowest priority that executes a loop and when it gets the CPU nothing else is scheduled and you can make your desired action. Then you can sleep in this thread for some time to make sure checks are not done too often.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Or would you rather use some of the already present Zephyr/NCS libraries to achieve this? I have not looked too much into the Power Management library, but I can do some investigation or ask internally if you would like to.&lt;/p&gt;
&lt;p&gt;You could also ask you question &lt;a href="https://lists.zephyrproject.org/g/devel/topics"&gt;here&lt;/a&gt;, since this is a Zephyr related question.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Zephyr Idle Hooks</title><link>https://devzone.nordicsemi.com/thread/259223?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2020 14:01:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4739330-a8d1-4047-9ada-86fff1e776bb</guid><dc:creator>Thomas</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Yes, that&amp;rsquo;s the issue - the power management hooks are only used when entering deep sleep and deep sleep enters the system off mode which is undesirable.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Thomas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Zephyr Idle Hooks</title><link>https://devzone.nordicsemi.com/thread/259162?ContentTypeID=1</link><pubDate>Thu, 09 Jul 2020 11:56:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:907ad170-35f4-4ffa-ac62-4b8aed08b32d</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;One solution could be to create a thread with the lowest priority that executes a loop and when it gets the CPU nothing else is scheduled and you can make your desired action. Then you can sleep in this thread for some time to make sure checks are not done too often.&lt;/p&gt;
&lt;p&gt;However, what do you mean by &amp;quot;external devices&amp;quot;? If you want to control the on-chip peripherals, they have power management hooks that are called when the device enters deep sleep.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Zephyr Idle Hooks</title><link>https://devzone.nordicsemi.com/thread/258718?ContentTypeID=1</link><pubDate>Tue, 07 Jul 2020 06:38:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9f75759-c58b-4a9d-ac6f-a08db483aaa8</guid><dc:creator>Thomas</dc:creator><description>&lt;p&gt;Thank you for the update Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF9160 Zephyr Idle Hooks</title><link>https://devzone.nordicsemi.com/thread/258492?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 02:48:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab97ced3-f6f4-4cd2-951d-d260e4f84140</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I am sorry for the&lt;span&gt;&amp;nbsp;&lt;/span&gt;late reply. A huge portion of the support team is on summer vacation and that causes some delay. I will try to provide you with an answer in the upcoming week.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>