<?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 cannot wake up from sleep mode.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95750/nrf52840-cannot-wake-up-from-sleep-mode</link><description>Hi friend, 
 I am using SDK16.0, and the version of softdevice is S140 V7.0.1. The MCU can enter sleep mode. But it cannot wake up after entering sleep mode. My code is as follows. What is wrong with my code? Can someone help me? 
 Thank you very much</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 18 Jan 2023 09:31:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95750/nrf52840-cannot-wake-up-from-sleep-mode" /><item><title>RE: nrf52840 cannot wake up from sleep mode.</title><link>https://devzone.nordicsemi.com/thread/405412?ContentTypeID=1</link><pubDate>Wed, 18 Jan 2023 09:31:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7cca561-9798-41f3-a6bb-8f3006f5116e</guid><dc:creator>Sigurd</dc:creator><description>[quote user="lerrywu"]nrf_gpio_cfg_sense_input(0x21, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW)[/quote]
&lt;p&gt;If you ground pin P1.1 this should have waken up the chip. (HEX 0x21 is DEC 33. I recommend using NRF_GPIO_PIN_MAP(port,pin) here )&lt;/p&gt;
[quote user="lerrywu"]Is it correct to define BTN_ID_WAKEUP as 0?[/quote]
&lt;p&gt;Yes, but then you should use this API to set the pin as wake-up pin: bsp_wakeup_button_enable().&lt;/p&gt;
&lt;p&gt;Take a look at e.g. this example on how to use it:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/pwr_mgmt_example.html"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/pwr_mgmt_example.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Button id 0 is default pin 11 on the nRF52840-DK.&lt;/p&gt;
&lt;p&gt;from pca10056.h&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1674034258529v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 cannot wake up from sleep mode.</title><link>https://devzone.nordicsemi.com/thread/405348?ContentTypeID=1</link><pubDate>Wed, 18 Jan 2023 02:20:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9da616e-49f6-4b9e-9efb-2f03ad265826</guid><dc:creator>Ted</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I want to use&amp;nbsp;BSP_BUTTON_TRIGGER pin to wake up the system. It still can&amp;#39;t be woken up even if I change the code to nrf_gpio_cfg_sense_input(0x21, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);&amp;nbsp;Is there any other error in my code? Is it correct to define BTN_ID_WAKEUP as 0?&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;/p&gt;
&lt;p&gt;Ted Wu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52840 cannot wake up from sleep mode.</title><link>https://devzone.nordicsemi.com/thread/405266?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2023 13:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a128f1d6-97bd-43cd-bdde-c0045b54101e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Looks like you are trying to use pin 0 for this.&lt;/p&gt;
&lt;p&gt;This pin is default used for the LF crystal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>