<?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>Lowest power while keeping app timers running</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121449/lowest-power-while-keeping-app-timers-running</link><description>I have an app running the S132 softdevice, doing most of the applicatino work in a routine being called by an 8 Hz app-timer. Under certain conditions that I detect with external hardware, I need to achieve the lowest possible power consumption and turn</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 May 2025 07:02:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121449/lowest-power-while-keeping-app-timers-running" /><item><title>RE: Lowest power while keeping app timers running</title><link>https://devzone.nordicsemi.com/thread/535453?ContentTypeID=1</link><pubDate>Thu, 15 May 2025 07:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d36fbf21-d7c0-4adf-aebc-9409c95cc0e5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The app timer runs independently of the softdevice and they do not share the same IRQ. However, it will stop running if the LFCLK is released when disabling the&amp;nbsp;softdevice (which can happen if you use nrf_sdh_disable_request()).&lt;/p&gt;
&lt;p&gt;You can try using the function below to stop BLE activity before entering the low power mode.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_stop(void)
{
    /* 
     * The default behavior when using the Advertising module is that the
     * advertiser will automatically restart on disconnect, but here
     * we need the advertiser to remain disabled. To acheive this we can set the
     * ble_adv_on_disconnect_disabled flag to &amp;#39;true&amp;#39; in the advertiser configuration.
     * 
     * Important: Remember to reset this flag when exiting low power mode to restore
     *            default behaviour.
     *
     * https://docs.nordicsemi.com/bundle/sdk_nrf5_v17.1.0/page/lib_ble_advertising.html 
     */
    m_advertising.adv_modes_config.ble_adv_on_disconnect_disabled = true;

    (void)sd_ble_gap_adv_stop(0);
    (void)sd_ble_gap_disconnect(0, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Lowest power while keeping app timers running</title><link>https://devzone.nordicsemi.com/thread/535380?ContentTypeID=1</link><pubDate>Wed, 14 May 2025 14:56:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22e3ad51-1222-4b89-afc1-f3c6d59a9822</guid><dc:creator>SteveHx</dc:creator><description>&lt;p&gt;If I understand correctly, disabling the IRQ will also disable my app timer, which needs to keep running to determine when to wake everything back up. It is possible a connection will be active, so what function is the correct one to call to shut down the connection, and what function to stop advertising?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Lowest power while keeping app timers running</title><link>https://devzone.nordicsemi.com/thread/535378?ContentTypeID=1</link><pubDate>Wed, 14 May 2025 14:51:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5a95181-922d-4b7f-9ef8-337e7ffa8fd8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;There isn&amp;#39;t a single function to stop all BLE activities. Is the device always advertising before entering this low power mode, or could it also be in a connection? nrf_sdh_suspend() disables the SoftDevice IRQ which is not what you want in this case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Lowest power while keeping app timers running</title><link>https://devzone.nordicsemi.com/thread/535368?ContentTypeID=1</link><pubDate>Wed, 14 May 2025 14:13:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c7fb6b1-2d79-43c4-bdad-16ec83aa696d</guid><dc:creator>SteveHx</dc:creator><description>&lt;p&gt;Is nrf_sdh_suspend () the correct function to use here, to stop all BLE activities?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Lowest power while keeping app timers running</title><link>https://devzone.nordicsemi.com/thread/535364?ContentTypeID=1</link><pubDate>Wed, 14 May 2025 14:08:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc66e03c-d72a-482a-a4c1-f1cf3f54a9ba</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It is sufficient to stop any ongoing&amp;nbsp;bluetooth activities (such as stopping the advertiser or terminating an active connection). It&amp;#39;s not necessary to disable the softdevice as it won&amp;#39;t affect the idle current.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>