<?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>sd_power_system_off() interfere with GPIOTE port interrupts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25154/sd_power_system_off-interfere-with-gpiote-port-interrupts</link><description>I am using NRF52 SDK14.0 and SoftDevice S132 v5.0.0. I am using GPIOTE low level port interrupt to wake the system from SysOff mode. If SoftDevice is enabled and I put the system to SysOff by calling NRF_POWER-&amp;gt;SYSTEMOFF = POWER_SYSTEMOFF_SYSTEMOFF_Enter;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Sep 2017 11:34:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25154/sd_power_system_off-interfere-with-gpiote-port-interrupts" /><item><title>RE: sd_power_system_off() interfere with GPIOTE port interrupts</title><link>https://devzone.nordicsemi.com/thread/99079?ContentTypeID=1</link><pubDate>Fri, 15 Sep 2017 11:34:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:577945d8-4df3-4ff6-a9aa-fd5cd7755e71</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you want to use sd_ function calls within the FreeRTOS context, then setting it to 5 is the correct option. See this figure &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/processor_avail_interrupt_latency/exception_mgmt_sd.html?cp=2_3_0_0_15_1"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_power_system_off() interfere with GPIOTE port interrupts</title><link>https://devzone.nordicsemi.com/thread/99080?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 14:08:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5133650-7329-4e7f-9758-aa296b6fbf74</guid><dc:creator>Mindaugas Tinteris</dc:creator><description>&lt;p&gt;By making &lt;code&gt;#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5&lt;/code&gt; in &lt;code&gt;FreeRTOSConfig.h&lt;/code&gt; now &lt;code&gt;sd_power_system_off()&lt;/code&gt; works fine, but I am not sure if it&amp;#39;s the right option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_power_system_off() interfere with GPIOTE port interrupts</title><link>https://devzone.nordicsemi.com/thread/99077?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 13:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d37006fd-0239-4d25-bc83-0b165a001184</guid><dc:creator>Mindaugas Tinteris</dc:creator><description>&lt;p&gt;&lt;code&gt;GPIO_BUTTON_MAIN is 20&lt;/code&gt;. Yes I checked, &lt;code&gt;NRF_P0-&amp;gt;PIN_CNF[GPIO_BUTTON_MAIN]&lt;/code&gt; is indeed &lt;code&gt;0x0003000C&lt;/code&gt;. I&amp;#39;ll add one important thing to the whole story: I call &lt;code&gt;sd_power_system_off()&lt;/code&gt; from FreeRTOS idle task hook. Afte looking more carefully I discovered, that system goes to Hard Fault Handler after calling &lt;code&gt;sd_power_system_off()&lt;/code&gt; and it seems to me that I can find the answer to this &lt;a href="https://devzone.nordicsemi.com/question/28125/sd_power_system_off-hardfault/"&gt;here&lt;/a&gt;. Now it&amp;#39;s only unclear, how to change IDLE task interrupt priority level in FreeRTOS. Any hints would be appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_power_system_off() interfere with GPIOTE port interrupts</title><link>https://devzone.nordicsemi.com/thread/99076?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 13:10:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bd09032-12ca-4cec-9ce6-b13169f1484f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;I just tested the code you provided, and it worked fine to exit sleep mode with it. The &lt;code&gt;sd_power_system_off()&lt;/code&gt; does not interfere with any GPIOTE interrupt settings.&lt;/p&gt;
&lt;p&gt;What pin is &lt;code&gt;GPIO_BUTTON_MAIN&lt;/code&gt; ? Could you debug/print the GPIO configuration register value of the pin you use, and see if it&amp;#39;s correctly configured before you enter system off?&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;NRF_P0-&amp;gt;PIN_CNF[GPIO_BUTTON_MAIN]&lt;/code&gt; should be &lt;code&gt;0x0003000C&lt;/code&gt; if configured correctly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_power_system_off() interfere with GPIOTE port interrupts</title><link>https://devzone.nordicsemi.com/thread/99078?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 12:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f172ecb3-e830-48df-8caf-eadf33f3ea32</guid><dc:creator>Mindaugas Tinteris</dc:creator><description>&lt;p&gt;Please, read my post original carefully. I do use Sense functionality, and it is working fine unless I use &lt;code&gt;sd_power_system_off()&lt;/code&gt;. I am aware of the issue that I should not access POWER register directly when using SoftDevice, that&amp;#39;s why I am asking this question. I use this code to setup a pin:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_gpiote_in_config_t in_config_button = GPIOTE_CONFIG_IN_SENSE_HITOLO(false);
in_config_button.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrf_drv_gpiote_in_init(GPIO_BUTTON_MAIN, &amp;amp;in_config_button, ButtonInterruptHandler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(GPIO_BUTTON_MAIN, true);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I&amp;#39;ll repeat myself. The system wakes up if going to SysOff by using POWER reg. This doesn&amp;#39;t work only if I use &lt;code&gt;sd_power_system_off()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sd_power_system_off() interfere with GPIOTE port interrupts</title><link>https://devzone.nordicsemi.com/thread/99075?ContentTypeID=1</link><pubDate>Thu, 14 Sep 2017 10:55:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d24ab6eb-1a21-48e9-b9cb-f4c777f1949d</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When in System OFF mode, the device can be woken up through one of the following signals:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The DETECT signal, optionally generated by the GPIO peripheral&lt;/li&gt;
&lt;li&gt;The ANADETECT signal, optionally generated by the LPCOMP module&lt;/li&gt;
&lt;li&gt;The SENSE signal, optionally generated by the NFC module to “wake-on-field”&lt;/li&gt;
&lt;li&gt;A reset&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;GPIOTE will not wake the processor up from SYSTEM OFF, the sense mechanism in the GPIO peripheral will. If you enable the sense mechanism, a DETECT signal will be generated if the correct sense is detected on one of the pins.&lt;/p&gt;
&lt;p&gt;Try to configure the pin you want to use to wake the chip up like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_gpio_cfg_sense_input(PIN NUMBER, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Also note that when the SoftDevice is enabled, &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.sds/dita/softdevices/s130/sd_resource_reqs/hw_block_interrupt_vector.html?cp=2_3_0_0_6_0"&gt;the POWER register is restricted&lt;/a&gt;, and should not be accessed directly. When the SoftDevice is enabled, you should therefore only use the &lt;code&gt;sd_power_system_off()&lt;/code&gt; function to go to sleep.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>