<?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>nRF52840 SDK16 - Cannot enter System OFF</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/63763/nrf52840-sdk16---cannot-enter-system-off</link><description>Hi everyone, 
 I am facing a kind of a strange problem. I want the system to enters system OFF mode when a certain pins goes to LOW. For that reason I have include code section below inside the main for(;;) loop. 
 When the WC_CHG pin goes to LOW I want</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Jul 2020 10:49:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/63763/nrf52840-sdk16---cannot-enter-system-off" /><item><title>RE: nRF52840 SDK16 - Cannot enter System OFF</title><link>https://devzone.nordicsemi.com/thread/260970?ContentTypeID=1</link><pubDate>Tue, 21 Jul 2020 10:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32efac54-c49a-426f-9633-ec819ec7760e</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;You can try calling idle_state_handle(void) at the top in the for loop in main(), that way the log will be processed before you go to system off.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - Cannot enter System OFF</title><link>https://devzone.nordicsemi.com/thread/260605?ContentTypeID=1</link><pubDate>Fri, 17 Jul 2020 13:45:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51440199-a63b-4c53-ada5-337163f5731a</guid><dc:creator>Nikosant03</dc:creator><description>&lt;p&gt;Hi Jared and thank you for your responce.&lt;/p&gt;
&lt;p&gt;Well, I was using deferred processing and it seems that this is the source for all the problems. I don&amp;#39;t know why and how but as soon as I used in place processing everthing seems to work fine..&lt;/p&gt;
&lt;p&gt;I was using the&amp;nbsp;&lt;a class="el" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.2.0/group__nrf__log__ctrl.html#gaea4ee51a39f70f14ad2e3213fa497ade"&gt;NRF_LOG_PROCESS&lt;/a&gt;&amp;nbsp;to process the NRF_LOGS&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void idle_state_handle(void) {
  if (!NRF_LOG_PROCESS()) { 
    nrf_pwr_mgmt_run(); 
  }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Sould I also use the NRF_LOG_PROCESS somewhere else inside my code? Can you think any reason that could be responsible for these problems in order to avoid it in the future?&lt;/p&gt;
&lt;p&gt;I prefere to use the&amp;nbsp;&lt;span&gt;deferred processing&amp;nbsp;as I&amp;#39;ve read that is safer.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;Nick&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 SDK16 - Cannot enter System OFF</title><link>https://devzone.nordicsemi.com/thread/260321?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 09:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6436b3ff-1a1d-43bd-8cc4-99b2dff82709</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]The strange thing is that while advertising and the WC_CHG pin goes to LOW the system normaly enters &lt;strong&gt;system OFF&lt;/strong&gt; mode but when the peripheral is get connected with the central the system won&amp;#39;t enter&amp;nbsp;&lt;span&gt;&lt;strong&gt;system OFF&lt;/strong&gt; mode anymore. I noticed that when I add the&amp;nbsp;NRF_LOG_INFO(&amp;quot;Print here&amp;quot;); line the code works fine and I cannot understand how does it related with my problem.&lt;/span&gt;[/quote]
&lt;ol&gt;
&lt;li&gt;&amp;nbsp;Set a breakpoint at line 10 and see if the program enters the if statement, if it doesn&amp;#39;t then it&amp;#39;s because the conditional statement isn&amp;#39;t true.&lt;/li&gt;
&lt;li&gt;Are you using deferred processing or in-place processing?&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>