<?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>Is there a way to prevent the CPU from automatically entering sleep mode?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111397/is-there-a-way-to-prevent-the-cpu-from-automatically-entering-sleep-mode</link><description>Hi, 
 I understand that by default in the nRF Connect SDK, the CPU automatically enters sleep mode when no threads are running. 
 I find this very convenient and I like it. 
 However, in the product I am working on, there are periods when we don&amp;#39;t want</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 May 2024 07:55:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111397/is-there-a-way-to-prevent-the-cpu-from-automatically-entering-sleep-mode" /><item><title>RE: Is there a way to prevent the CPU from automatically entering sleep mode?</title><link>https://devzone.nordicsemi.com/thread/485735?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 07:55:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9733636c-a58a-4949-8991-8475f74fb1d9</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kentaro&lt;/p&gt;
&lt;p&gt;Yes, it can be easily implemented as a while-loop.&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: Is there a way to prevent the CPU from automatically entering sleep mode?</title><link>https://devzone.nordicsemi.com/thread/485719?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 06:23:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6660c38-2bd8-45be-ba40-a39477ab9595</guid><dc:creator>Kentarou</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thank you for your response. It might be obvious, but just to confirm, the low-priority thread is implemented with a while loop, as I mentioned earlier, to prevent it from going idle, right?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Kentaro&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to prevent the CPU from automatically entering sleep mode?</title><link>https://devzone.nordicsemi.com/thread/485539?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 07:23:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7c33546-3b5f-4952-99dd-76f8ec0ba556</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Kentaro&lt;/p&gt;
&lt;p&gt;After a chat with one of the in-house RTOS experts they also recommend that the easiest/best way to do this is to have a low-priority thread running when you want to avoid the project to go into idle mode.&lt;/p&gt;
&lt;p&gt;There is a complex way to do this as well through the power management using&amp;nbsp;&lt;span&gt;&lt;span dir="ltr"&gt;using &lt;a title="https://github.com/zephyrproject-rtos/zephyr/blob/main/kernel/include/kernel_internal.h#l244" href="https://github.com/zephyrproject-rtos/zephyr/blob/main/kernel/include/kernel_internal.h#L244" rel="noopener noreferrer" target="_blank"&gt;pm_system_suspend&lt;/a&gt;, but there are a lot of things that&amp;nbsp;&lt;strong&gt;could&amp;nbsp;&lt;/strong&gt;go wrong, so we wouldn&amp;#39;t recommend that unless you want some extra (unnecessary) work on your hands.&lt;/span&gt;&lt;/span&gt;&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: Is there a way to prevent the CPU from automatically entering sleep mode?</title><link>https://devzone.nordicsemi.com/thread/485514?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 00:03:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ae46de3-d518-442e-a89c-e3afa05c266b</guid><dc:creator>Kentarou</dc:creator><description>&lt;p&gt;Thank you for your prompt response! I look forward to your reply.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Kentaro&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way to prevent the CPU from automatically entering sleep mode?</title><link>https://devzone.nordicsemi.com/thread/485403?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 12:21:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7eb49ee-58c2-454b-8500-42038938d57a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think there is a way to dynamically enable/disable the automatic sleep mode unfortunately, as this is an inherent behavior in the Zephyr RTOS if I recall correctly. But let me discuss this with a colleague and get back to you with a surefire answer tomorrow. I think having a low-priority thread running would be the way to go though.&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>