<?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>Delay between exiting System OFF and starting main loop</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88979/delay-between-exiting-system-off-and-starting-main-loop</link><description>I&amp;#39;ve been playing around with some code that puts my hardware into System OFF mode to save power, and then will exit this mode and start up when one of three different GPIO&amp;#39;s trigger it. 
 I then attempt to establish which GPIO has caused the exit from</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jul 2022 01:53:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88979/delay-between-exiting-system-off-and-starting-main-loop" /><item><title>RE: Delay between exiting System OFF and starting main loop</title><link>https://devzone.nordicsemi.com/thread/376306?ContentTypeID=1</link><pubDate>Mon, 11 Jul 2022 01:53:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f906b51-bef6-4575-b930-e035b6e3b952</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;OK, for anyone reading this wondering if there was a resolution, there was:&lt;/p&gt;
&lt;p&gt;1. If you are using NCS, then it enables the LFCLK, which means there is a delay of 300-400msec before your main.c code actually starts to run&lt;/p&gt;
&lt;p&gt;2. You can get around this by putting time critical start up code in a SYS_INIT() function, and call this in one of the PRE_KERNAL stages.&lt;/p&gt;
&lt;p&gt;3. If you are implementing OTA DFU, then the Mcuboot that is needed to do image swaps, etc will be run prior to any of the SYS_INIT() stuff, which sort of re-adds the 300-400msec delay to the start up processes.&amp;nbsp;&amp;nbsp;It will also impact the registers, which means when you eventually get around to reading them, they&amp;#39;ll not reflect what GPIO caused the System_Off exit.&amp;nbsp; To get around that, you need to follow Step 4 below:&lt;/p&gt;
&lt;p&gt;4. Disable CONFIG_GPIO in mcuboot. This can be done by creating the folder my_project/child_image/&amp;nbsp; And in the child_image catalog, you create the file &amp;quot;mcuboot.conf&amp;quot; holding:&lt;/p&gt;
&lt;p&gt;CONFIG_GPIO=n&lt;/p&gt;
&lt;p&gt;I was using Retained RAM to store variables when in System Off, and that gets impacted with the above changes.&amp;nbsp; There is potentially a way around it, but I just ended up writing everything to NVS just prior to going back into System Off, and that achieves the same outcome for me.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delay between exiting System OFF and starting main loop</title><link>https://devzone.nordicsemi.com/thread/372581?ContentTypeID=1</link><pubDate>Wed, 15 Jun 2022 13:05:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1248cc22-3290-4b94-9800-740c9b70b30d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Let&amp;#39;s keep this to your other ticket, as the subject is still the same as in your other ticket:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/88311/multiple-gpio-interrupts-from-system_soft_off"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/88311/multiple-gpio-interrupts-from-system_soft_off&lt;/a&gt;&amp;nbsp;&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>