<?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>How do I put nRF52805 into low-power sleep mode with the ability to wake up to a button press (GPIOs going low to create interrupt)?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/117321/how-do-i-put-nrf52805-into-low-power-sleep-mode-with-the-ability-to-wake-up-to-a-button-press-gpios-going-low-to-create-interrupt</link><description>I am writing software for a battery-powered device that needs to go into the lowest power possible sleep mode when not in use and be able to wake up with one of 8 buttons are pressed so that it can transmit a Bluetooth BLE transmission to a receiver and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 28 Dec 2024 23:33:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/117321/how-do-i-put-nrf52805-into-low-power-sleep-mode-with-the-ability-to-wake-up-to-a-button-press-gpios-going-low-to-create-interrupt" /><item><title>RE: How do I put nRF52805 into low-power sleep mode with the ability to wake up to a button press (GPIOs going low to create interrupt)?</title><link>https://devzone.nordicsemi.com/thread/516426?ContentTypeID=1</link><pubDate>Sat, 28 Dec 2024 23:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:563b4ece-1fde-4ea7-a44a-3fb98470b2b8</guid><dc:creator>Integrity Circuits</dc:creator><description>&lt;p&gt;I hired an experienced firmware engineer to debug the BLE connection issue. He found the following fix, and now the BLE connection works. I&amp;#39;ve included the corrected code in the attached zip file.&lt;/p&gt;
&lt;p&gt;1) In main.c, replace bt_le_adv_start (line 58) with this err = bt_le_adv_start(BT_LE_ADV_CONN_ONE_TIME, ad, ARRAY_SIZE(ad), sd, ARRAY_SIZE(sd));&lt;/p&gt;
&lt;p&gt;2) In the pro.conf file, this parameter was added: CONFIG_BT_PERIPHERAL=y&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/system_5F00_off_5F00_advertising_5F00_Solved.zip"&gt;devzone.nordicsemi.com/.../system_5F00_off_5F00_advertising_5F00_Solved.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I put nRF52805 into low-power sleep mode with the ability to wake up to a button press (GPIOs going low to create interrupt)?</title><link>https://devzone.nordicsemi.com/thread/516414?ContentTypeID=1</link><pubDate>Sat, 28 Dec 2024 08:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d76d503-8921-4e88-bfad-0c925237a5f7</guid><dc:creator>Integrity Circuits</dc:creator><description>&lt;p&gt;Thanks Runar. Using your &amp;quot;system_off_advertising&amp;quot; example code on the nRF52-DK evaluation board along with the&amp;nbsp;&lt;span&gt;&amp;quot;nRF52&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Connect&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;for&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Desktop&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;nbsp;dongle&amp;nbsp;&lt;/span&gt;&lt;span&gt;tool to monitor the BLE activity, the advertisement shows up on the&amp;nbsp;&amp;quot;nRF52&amp;nbsp;Connect&amp;nbsp;for&amp;nbsp;Desktop&amp;quot;, but when I select &amp;quot;Connect&amp;quot; from the&amp;nbsp;&amp;quot;nRF52&amp;nbsp;Connect&amp;nbsp;for&amp;nbsp;Desktop&amp;quot; too, it fails to connect and times out. &lt;br /&gt;&lt;br /&gt;Any ideas why it will not connect? If you have a&amp;nbsp;nRF52-DK board, could you try to replicate this issue on your side?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I put nRF52805 into low-power sleep mode with the ability to wake up to a button press (GPIOs going low to create interrupt)?</title><link>https://devzone.nordicsemi.com/thread/515228?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2024 08:15:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee780273-732a-439b-979c-c07f41e2f597</guid><dc:creator>runsiv</dc:creator><description>[quote user="Integrity Circuits"]Hi Runar. Thanks for the prompt response. I was using Chat GPT for debugging to save time and only included&amp;nbsp;&lt;span&gt;CONFIG_BT_LL_SW_SPLIT, per the AI&amp;#39;s suggestion.&amp;nbsp;&lt;br /&gt;&lt;/span&gt;[/quote]
&lt;p&gt;Aha&lt;/p&gt;
[quote user="Integrity Circuits"]&lt;strong&gt;Q1)&lt;/strong&gt; What do you recommend I change in my prj.conf file?&lt;br /&gt;[/quote]
&lt;p&gt;I think I would change it to something like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;prj.conf File Contents

# Enable GPIO
CONFIG_GPIO=y

# Clock configuration
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y  # Use RC oscillator for LFCLK
CONFIG_SYS_CLOCK_EXISTS=y  # Ensure low-power idle mode

# Configure power management
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_RUNTIME_EXCLUSIVE=y

# Enable Bluetooth for BLE operations
CONFIG_BT=y
#CONFIG_BT_SETTINGS=y #if you want to store the bt connection settings

CONFIG_TICKLESS_KERNEL=y

# Basic stack sizes
CONFIG_IDLE_STACK_SIZE=256
CONFIG_MAIN_STACK_SIZE=1024


# Logging and Debugging
# Disable logging and UART to reduce periodic activity
CONFIG_LOG_BACKEND_RTT=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG=y #I am a big fan of logging during development and debugging
CONFIG_PRINTK=y  # Minimal runtime print support

CONFIG_WATCHDOG=n # Ensure no unnecessary peripherals are active.


# Debugging Optimizations
CONFIG_DEBUG_OPTIMIZATIONS=y
CONFIG_DEBUG_THREAD_INFO=y
# Enable Debugging for Power Management
CONFIG_PM_LOG_LEVEL_DBG=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The Konfig will of course need to be adjusted to the behavior of your application. If you are not to familiar with our BLE stack I would suggest take a look at our &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/"&gt;BLE course&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="Integrity Circuits"]How do I use&amp;nbsp;the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/zephyr/samples/boards/nordic/system_off/README.html"&gt;system_off sample&lt;/a&gt;&amp;nbsp;function, and does it require any prerequisite setups? When I try to use this function, I get a build error. Do I need to include a header file to use it?[/quote]
&lt;p&gt;The system off sample should work straight of the box. Are you developing on a DK(like the nrf52832 emulating 52805) then it should compile straight out of the box. Can you upload the errors you see?&lt;/p&gt;
[quote user="Integrity Circuits"]&lt;p&gt;&lt;span&gt;&lt;strong&gt;Q3)&lt;/strong&gt; Could you point me to an example program that goes to sleep until a button is pressed and then wakes up to transmit a BLE signal?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/system_5F00_off_5F00_advertising.zip"&gt;devzone.nordicsemi.com/.../system_5F00_off_5F00_advertising.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think there is a specific sample for it. But you can have a look at this project. I have just added advertisement to the system off sample&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I put nRF52805 into low-power sleep mode with the ability to wake up to a button press (GPIOs going low to create interrupt)?</title><link>https://devzone.nordicsemi.com/thread/515199?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 21:53:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9be8e2cc-d432-479c-8bc3-fcfd525f1897</guid><dc:creator>Integrity Circuits</dc:creator><description>&lt;p&gt;Hi Runar. Thanks for the prompt response. I was using Chat GPT for debugging to save time and only included&amp;nbsp;&lt;span&gt;CONFIG_BT_LL_SW_SPLIT, per the AI&amp;#39;s suggestion.&amp;nbsp;&lt;br /&gt;&lt;strong&gt;Q1)&lt;/strong&gt; What do you recommend I change in my prj.conf file?&lt;br /&gt;&lt;strong&gt;Q2)&lt;/strong&gt; How do I use&amp;nbsp;the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/zephyr/samples/boards/nordic/system_off/README.html"&gt;system_off sample&lt;/a&gt;&amp;nbsp;function, and does it require any prerequisite setups? When I try to use this function, I get a build error. Do I need to include a header file to use it?&lt;br /&gt;&lt;strong&gt;Q3)&lt;/strong&gt; Could you point me to an example program that goes to sleep until a button is pressed and then wakes up to transmit a BLE signal?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;br /&gt;JasonS&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I put nRF52805 into low-power sleep mode with the ability to wake up to a button press (GPIOs going low to create interrupt)?</title><link>https://devzone.nordicsemi.com/thread/515091?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2024 12:20:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9d129dd-ebd4-43fa-bb88-14637c6b2515</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi Jason&lt;/p&gt;
&lt;p&gt;Just a few question to start off with.&lt;/p&gt;
&lt;p&gt;1. I see that you have both&amp;nbsp;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT&lt;/span&gt;&lt;span&gt;=n and&amp;nbsp;CONFIG_BT_LL_SW_SPLIT. The&amp;nbsp;CONFIG_BT_LL_SW_SPLIT depends on CONFIG_BT so it seems a bit strange to me. What is reason behind this?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;2. CONFIG_PM=y should give you a warning as it has been deprecated&amp;nbsp;for over a year&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;3.&amp;nbsp;k_cpu_idle should not be used unless absolutely necessary. In normal system the idle thread will take care of power management including idling&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;4. If you want the system to go as low as possible I would suggest having a look at the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.8.0/page/zephyr/samples/boards/nordic/system_off/README.html"&gt;system_off sample&lt;/a&gt; where the device is put into system off and awaken with external input(button press)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Runar&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>