<?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>NUS shut down &amp;amp; restart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123418/nus-shut-down-restart</link><description>I&amp;#39;ve built a project based on the peripheral_uart appliction. This is working well, but I need to now sort out the lowpower mode. My product is battery powere &amp;amp; I need to turn everything off when the power button is pressed. 
 Is there a deffined way</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Oct 2025 11:46:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123418/nus-shut-down-restart" /><item><title>RE: NUS shut down &amp; restart</title><link>https://devzone.nordicsemi.com/thread/552148?ContentTypeID=1</link><pubDate>Wed, 22 Oct 2025 11:46:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba3fd04e-0605-40e4-ad45-74f533e337c6</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;Apologies for the delayed response.&lt;/p&gt;
[quote user="John Galvin"] get round this by waiting for the wrong button to be released before going back to sleep. This fixed my problem.[/quote]
&lt;p&gt;This sounds like a good solution and sounds fine.&lt;/p&gt;
&lt;p&gt;-Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS shut down &amp; restart</title><link>https://devzone.nordicsemi.com/thread/550777?ContentTypeID=1</link><pubDate>Tue, 07 Oct 2025 08:31:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:412078ac-97a9-468d-be92-cdeceb2b9051</guid><dc:creator>John Galvin</dc:creator><description>&lt;p&gt;I was able to use the restart option by chaning my software to allow a restart to test the buttons. How I get excellent power off current (~300nA)&lt;/p&gt;
&lt;p&gt;One note. If I press the wrong button to wake it up, then realse this &amp;amp; press the correct button, it doesn&amp;#39;t wake. I&amp;#39;m guessing I needed to clear the IRQ before going back to sleep after the wrong button press. Howver, I get round this by waiting for the wrong button to be released before going back to sleep. This fixed my problem.&lt;/p&gt;
&lt;p&gt;Can you see any reason why this may not be a suitable solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS shut down &amp; restart</title><link>https://devzone.nordicsemi.com/thread/547510?ContentTypeID=1</link><pubDate>Tue, 02 Sep 2025 13:41:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69064240-1c48-4e59-adab-0cf36f7dcea7</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
[quote user="John Galvin"]&lt;div&gt; It seams to reset my code &amp;amp; run from the begining?&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Is that correct?&lt;/div&gt;[/quote]
&lt;p&gt;Yes you can see here &lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/reset/doc/reset.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf5340/page/chapters/reset/doc/reset.html&lt;/a&gt;&amp;nbsp;&amp;nbsp;that the device resets when waking up from System OFF, so then it starts from the main().&lt;/p&gt;
[quote user="John Galvin"]does &amp;quot;sense-edge-mask&amp;nbsp;=&amp;nbsp;&amp;lt;0x01800000&amp;gt;;&amp;nbsp;/* 1&amp;lt;&amp;lt;24 | 1 &amp;lt;&amp;lt;23 */&amp;quot; solve this issue?[/quote]
&lt;p&gt;The higher idle current come from using GPIOTE IN channels for GPIO interrupts. Switching those pins to use the GPIO SENSE/PORT event path usually fixes it. That’s exactly what the sense-edge-mask devicetree property does.&lt;/p&gt;
&lt;p&gt;-Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS shut down &amp; restart</title><link>https://devzone.nordicsemi.com/thread/546179?ContentTypeID=1</link><pubDate>Wed, 20 Aug 2025 11:54:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b487a78f-95a9-4983-ad9c-baa42b291d9b</guid><dc:creator>John Galvin</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Priyanka,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;ve now finally got back on to this. I&amp;#39;m using the dk_buttons library&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;gpio_pin_set_dt(&amp;amp;j3pins[2], 1); //### test probe: set high when enter poweroff
sys_poweroff();
gpio_pin_set_dt(&amp;amp;j3pins[2], 0); //### test probe: set low when exit poweroff&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Monitoring my test probe pin it goes high as expected when entering sys_poweroff() &amp;amp; when I press my button my test probe goes low as expected, but it doesn&amp;#39;t carry on running from where it left off. I then put a break point at the system start which it hit. It seams to reset my code &amp;amp; run from the begining?&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Is that correct?&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Also I noticed your comment in the other ticket saying that&amp;nbsp;&lt;span&gt;dk_buttons_and_leds.c library you see a higher IDLE current.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;does &amp;quot;sense-edge-mask&amp;nbsp;=&amp;nbsp;&amp;lt;0x01800000&amp;gt;;&amp;nbsp;/* 1&amp;lt;&amp;lt;24 | 1 &amp;lt;&amp;lt;23 */&amp;quot; solve this issue? If so, are this bits related for their GPIO pins (23 &amp;amp; 24)?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NUS shut down &amp; restart</title><link>https://devzone.nordicsemi.com/thread/544462?ContentTypeID=1</link><pubDate>Mon, 04 Aug 2025 12:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9127d54c-50c2-489d-8297-487e1783b2a5</guid><dc:creator>Priyanka</dc:creator><description>&lt;p&gt;Hi John,&lt;/p&gt;
&lt;p&gt;You could use the&lt;a href="https://docs.nordicsemi.com/bundle/zephyr-apis-latest/page/group_sys_poweroff.html#gaf4552a8ea40b4adb94f85b0a1ff06e39"&gt; sys_poweroff() API&lt;/a&gt; for the same.&lt;/p&gt;
&lt;p&gt;First configure the button GPIO as input and set the sense mechanism (so it can wake the device from System OFF). Then call sys_poweroff() to enter System OFF mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/122546/nrf5340-wake-from-sys_poweroff?ReplySortBy=CreatedDate&amp;amp;ReplySortOrder=Ascending"&gt;This ticket &lt;/a&gt;could help you get a idea.&lt;/p&gt;
&lt;p&gt;-Priyanka&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>