<?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>Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89326/low-power-mode-using-app-uart-example</link><description>Hello , 
 I on the DK nRF52840, I wanted to manage the sleep mode and measure the current consumed by the microcontroller.

I started with example uart, I cut the PCB track courting solder bridge SB40 and I soldered a 10 Ω resistor . the current measured</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Jun 2022 12:41:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89326/low-power-mode-using-app-uart-example" /><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374909?ContentTypeID=1</link><pubDate>Thu, 30 Jun 2022 12:41:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a9533b7-f18b-4513-8ec8-f86e1d7325d1</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ATYQ"]&lt;div style="max-width:100%;overflow:auto;max-height:none;"&gt;&lt;pre dir="ltr"&gt;&lt;span lang="en"&gt;&lt;span&gt;when I wake up I have to reconfigure the clocks, uart, led .. but I have no idea, do you have an example please?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div style="max-width:100%;overflow:auto;max-height:none;"&gt;&lt;pre dir="ltr"&gt;&lt;span lang="en"&gt;Should I configure uart , led .. on receiving event NRF_LIBUARTE_ASYNC_EVT_RX_DATA ?&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;[/quote]
&lt;p&gt;You will not get events from libuarte (like NRF_LIBUARTE_ASYNC_EVT_RX_DATA) event when the UART / libuarte is disabled(), so as long as you need to communicate over UART, it needs to be enabled. If you always needs to be able to receive data on UART, it needs to always be enabled, and you will never be able to go to a very low power mode (even if the CPU sleeps, the HF clock needs to run for the UART peripheral, GPIOTE and PPI.&lt;/p&gt;
&lt;p&gt;If possible, what you can do it to call&amp;nbsp;nrf_libuarte_async_uninit() when you don&amp;#39;t need UART communication, and call&amp;nbsp;nrf_libuarte_async_init()etc. when you need it again. From a UART perspective, there is not anything else you need to do.&lt;/p&gt;
&lt;p&gt;What to do with your LEDs etc. is application specific. Lighting a LED consumes a lot of current, so generally you do not want to do use that more than necessary. That also applies to all other resources. All this is highly application specific though so I cannot provide very specific advice, other than to make sure you only enable peripherals etc when you need them, and disable them when not needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374743?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 13:02:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:781957d5-0858-4d7d-8eb9-cd30b2d8ed74</guid><dc:creator>Lora</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your help and your feedback .&lt;/p&gt;
&lt;pre class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traduction"&gt;&lt;span class="Y2IQFc" lang="en"&gt;low power consumption modes on nRF52
--------------------------------------------------

System Mode ON :

System on, no RAM retention, wake on any event.

UART ON and LED ON:

consumption measured with the multimeter: 0.97 mA

I receive and send the data and the consumption measured is: 0.97 mA ( I think that &lt;/span&gt;the microcontroller does not go into sleep )&lt;/pre&gt;
&lt;pre class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traduction"&gt;&lt;span class="Y2IQFc" lang="en"&gt;UART DISABLED and LED OFF: &lt;br /&gt;&lt;br /&gt;-- I send data but I do not receive anything &lt;br /&gt;-- I measure 0mv on the multimeter&lt;br /&gt;&lt;br /&gt;&lt;span&gt;when I wake up I have to reconfigure the clocks, uart, led .. but I have no idea, do you have an example please?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traduction"&gt;&lt;span class="Y2IQFc" lang="en"&gt;Should I configure uart , led .. on receiving event NRF_LIBUARTE_ASYNC_EVT_RX_DATA ?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traduction"&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;Thank you .&lt;br /&gt;&lt;br /&gt;Best regards &lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2018 - 2021, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/** @file
 * @defgroup libuarte_example_main main.c
 * @{
 * @ingroup libuarte_example
 * @brief Libuarte Example Application main file.
 *
 * This file contains the source code for a sample application using libuarte.
 *
 */

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;nrf_libuarte_async.h&amp;quot;
#include &amp;quot;nrf_drv_clock.h&amp;quot;
#include &amp;lt;bsp.h&amp;gt;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;
#include &amp;quot;nrf_queue.h&amp;quot;

NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 0, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);

static uint8_t GOING_TO_SLEEP[] = &amp;quot;Going to Sleep \r\n&amp;quot;;
static uint8_t length_sleep = sizeof(GOING_TO_SLEEP);

static uint8_t WAKEUP[] = &amp;quot;Wakeup \r\n&amp;quot;;
static uint8_t length_wakeup = sizeof(WAKEUP);

static volatile bool m_loopback_phase;

typedef struct {
    uint8_t * p_data;
    uint32_t length;
} buffer_t;

uint8_t u8wakeupOK = false;



NRF_QUEUE_DEF(buffer_t, m_buf_queue, 10, NRF_QUEUE_MODE_NO_OVERFLOW);

void uart_event_handler(void * context, nrf_libuarte_async_evt_t * p_evt)
{
    nrf_libuarte_async_t * p_libuarte = (nrf_libuarte_async_t *)context;
    ret_code_t ret;

    switch (p_evt-&amp;gt;type)
    {
        case NRF_LIBUARTE_ASYNC_EVT_ERROR:
            bsp_board_led_invert(0);
            break;
        case NRF_LIBUARTE_ASYNC_EVT_RX_DATA:
            ret = nrf_libuarte_async_tx(p_libuarte,p_evt-&amp;gt;data.rxtx.p_data, p_evt-&amp;gt;data.rxtx.length);
            if (ret == NRF_ERROR_BUSY)
            {
                buffer_t buf = {
                    .p_data = p_evt-&amp;gt;data.rxtx.p_data,
                    .length = p_evt-&amp;gt;data.rxtx.length,
                };

                ret = nrf_queue_push(&amp;amp;m_buf_queue, &amp;amp;buf);
                APP_ERROR_CHECK(ret);
            }
            else
            {
                APP_ERROR_CHECK(ret);
            }
            bsp_board_led_invert(1);
            m_loopback_phase = true;
            u8wakeupOK = true;
            break;
        case NRF_LIBUARTE_ASYNC_EVT_TX_DONE:
            if (m_loopback_phase)
            {
                nrf_libuarte_async_rx_free(p_libuarte, p_evt-&amp;gt;data.rxtx.p_data, p_evt-&amp;gt;data.rxtx.length);
                if (!nrf_queue_is_empty(&amp;amp;m_buf_queue))
                {
                    buffer_t buf;
                    ret = nrf_queue_pop(&amp;amp;m_buf_queue, &amp;amp;buf);
                    APP_ERROR_CHECK(ret);
                    UNUSED_RETURN_VALUE(nrf_libuarte_async_tx(p_libuarte, buf.p_data, buf.length));
                }
            }
            bsp_board_led_invert(2);
            break;
        default:
            break;
    }
}

void libuart_disabled()
{
    nrf_libuarte_async_uninit(&amp;amp;libuarte);
    
    *(volatile uint32_t *)0x40002FFC = 0;
    *(volatile uint32_t *)0x40002FFC;
    *(volatile uint32_t *)0x40002FFC = 1;
}

void clock_disable(void)
{
    nrf_drv_clock_uninit();

    nrf_drv_clock_lfclk_release();
}



void uart_config(void)
{
    ret_code_t err_code;

    nrf_libuarte_async_config_t nrf_libuarte_async_config = {
        .tx_pin     = NRF_GPIO_PIN_MAP(1,2),
        .rx_pin     = NRF_GPIO_PIN_MAP(1,3),
        .baudrate   = NRF_UARTE_BAUDRATE_115200,
        .parity     = NRF_UARTE_PARITY_EXCLUDED,
        .hwfc       = NRF_UARTE_HWFC_DISABLED,
        .timeout_us = 100,
        .int_prio   = APP_IRQ_PRIORITY_LOW
    };

    err_code = nrf_libuarte_async_init(&amp;amp;libuarte, &amp;amp;nrf_libuarte_async_config, uart_event_handler, (void *)&amp;amp;libuarte);

    APP_ERROR_CHECK(err_code);

    nrf_libuarte_async_enable(&amp;amp;libuarte);
}

/**@brief Function for initializing low-frequency clock.
 */
void lfclk_config(void)
{
    ret_code_t err_code = nrf_drv_clock_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_clock_lfclk_request(NULL);
}

/**
 * @brief Function for main application entry.
 */
int main(void)
{
    bsp_board_init(BSP_INIT_LEDS);
    
    lfclk_config();

    ret_code_t err_code = NRF_LOG_INIT(app_timer_cnt_get);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();

    uart_config();

    err_code = nrf_libuarte_async_tx(&amp;amp;libuarte, GOING_TO_SLEEP, length_sleep);
    APP_ERROR_CHECK(err_code);

    libuart_disabled();

    while(1)
    {
      // Clear the internal event register.
      __SEV();
      __WFE();
      // Wait for an event.
      __WFE();
    }
}


/** @} */
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Lora &lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374672?ContentTypeID=1</link><pubDate>Wed, 29 Jun 2022 07:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7843b200-3da0-42c3-9efd-4f2006cd19bb</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You have a simple while(1); at the end of your main loop, which causes the CPU to spend time doing nothing. To put the CPU in sleep mode you should instead make your main loop look something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    while(1)
    {
        // Clear the internal event register.
        __SEV();
        __WFE();
        // Wait for an event.
        __WFE();
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(Note that if you had been using a SoftDevice you should use sd_app_evt_wait() instead of WFE).&lt;/p&gt;
&lt;p&gt;Note that even though the CPU sleeps (after WFE) the HF clock and UARTE peripheral ect will consume a significant amount of current while the UART is enabled, so you probably want to disable libuarte as well when you no longer need it (using&amp;nbsp;nrf_libuarte_async_uninit()).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374596?ContentTypeID=1</link><pubDate>Tue, 28 Jun 2022 15:04:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:331e452f-017d-46ed-886c-361a603e3624</guid><dc:creator>Lora</dc:creator><description>&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;,&lt;/span&gt;&lt;/p&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traduction"&gt;&lt;span class="Y2IQFc" lang="en"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;I want to manage the sleep mode specially from the system ON wake-up mode to wake up with an interrupt or event rx.
&lt;/span&gt;
&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;actually i used libuarte library using DMA to wake up when i get data on the uart.
&lt;/span&gt;
&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;could you look with why i don&amp;#39;t go to sleep or do you have an example of libuarte + low power mode (system on mode )&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Thank you for your help .&lt;/p&gt;
&lt;p&gt;Best regards.&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2018 - 2021, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/** @file
 * @defgroup libuarte_example_main main.c
 * @{
 * @ingroup libuarte_example
 * @brief Libuarte Example Application main file.
 *
 * This file contains the source code for a sample application using libuarte.
 *
 */

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;nrf_libuarte_async.h&amp;quot;
#include &amp;quot;nrf_drv_clock.h&amp;quot;
#include &amp;lt;bsp.h&amp;gt;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;
#include &amp;quot;nrf_queue.h&amp;quot;

NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 0, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);

static uint8_t GOING_TO_SLEEP[] = &amp;quot;Going to Sleep \r\n&amp;quot;;
static uint8_t length_sleep = sizeof(GOING_TO_SLEEP);

static uint8_t WAKEUP[] = &amp;quot;Wakeup \r\n&amp;quot;;
static uint8_t length_wakeup = sizeof(WAKEUP);

static volatile bool m_loopback_phase;

typedef struct {
    uint8_t * p_data;
    uint32_t length;
} buffer_t;

uint8_t u8wakeupOK = false;



NRF_QUEUE_DEF(buffer_t, m_buf_queue, 10, NRF_QUEUE_MODE_NO_OVERFLOW);

void uart_event_handler(void * context, nrf_libuarte_async_evt_t * p_evt)
{
    nrf_libuarte_async_t * p_libuarte = (nrf_libuarte_async_t *)context;
    ret_code_t ret;

    switch (p_evt-&amp;gt;type)
    {
        case NRF_LIBUARTE_ASYNC_EVT_ERROR:
            bsp_board_led_invert(0);
            break;
        case NRF_LIBUARTE_ASYNC_EVT_RX_DATA:
            ret = nrf_libuarte_async_tx(p_libuarte,p_evt-&amp;gt;data.rxtx.p_data, p_evt-&amp;gt;data.rxtx.length);
            if (ret == NRF_ERROR_BUSY)
            {
                buffer_t buf = {
                    .p_data = p_evt-&amp;gt;data.rxtx.p_data,
                    .length = p_evt-&amp;gt;data.rxtx.length,
                };

                ret = nrf_queue_push(&amp;amp;m_buf_queue, &amp;amp;buf);
                APP_ERROR_CHECK(ret);
            }
            else
            {
                APP_ERROR_CHECK(ret);
            }
            bsp_board_led_invert(1);
            m_loopback_phase = true;
            u8wakeupOK = true;
            break;
        case NRF_LIBUARTE_ASYNC_EVT_TX_DONE:
            if (m_loopback_phase)
            {
                nrf_libuarte_async_rx_free(p_libuarte, p_evt-&amp;gt;data.rxtx.p_data, p_evt-&amp;gt;data.rxtx.length);
                if (!nrf_queue_is_empty(&amp;amp;m_buf_queue))
                {
                    buffer_t buf;
                    ret = nrf_queue_pop(&amp;amp;m_buf_queue, &amp;amp;buf);
                    APP_ERROR_CHECK(ret);
                    UNUSED_RETURN_VALUE(nrf_libuarte_async_tx(p_libuarte, buf.p_data, buf.length));
                }
            }
            bsp_board_led_invert(2);
            break;
        default:
            break;
    }
}

void libuart_disabled()
{
    nrf_libuarte_async_uninit(&amp;amp;libuarte);
    
    *(volatile uint32_t *)0x40002FFC = 0;
    *(volatile uint32_t *)0x40002FFC;
    *(volatile uint32_t *)0x40002FFC = 1;
}

void clock_disable(void)
{
    nrf_drv_clock_uninit();

    nrf_drv_clock_lfclk_release();
}



void uart_config(void)
{
    ret_code_t err_code;

    nrf_libuarte_async_config_t nrf_libuarte_async_config = {
        .tx_pin     = NRF_GPIO_PIN_MAP(1,2),
        .rx_pin     = NRF_GPIO_PIN_MAP(1,3),
        .baudrate   = NRF_UARTE_BAUDRATE_115200,
        .parity     = NRF_UARTE_PARITY_EXCLUDED,
        .hwfc       = NRF_UARTE_HWFC_DISABLED,
        .timeout_us = 100,
        .int_prio   = APP_IRQ_PRIORITY_LOW
    };

    err_code = nrf_libuarte_async_init(&amp;amp;libuarte, &amp;amp;nrf_libuarte_async_config, uart_event_handler, (void *)&amp;amp;libuarte);

    APP_ERROR_CHECK(err_code);

    nrf_libuarte_async_enable(&amp;amp;libuarte);
}

/**@brief Function for initializing low-frequency clock.
 */
void lfclk_config(void)
{
    ret_code_t err_code = nrf_drv_clock_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_clock_lfclk_request(NULL);
}

/**
 * @brief Function for main application entry.
 */
int main(void)
{
    bsp_board_init(BSP_INIT_LEDS);
    
    lfclk_config();

    ret_code_t err_code = NRF_LOG_INIT(app_timer_cnt_get);
    APP_ERROR_CHECK(err_code);

    NRF_LOG_DEFAULT_BACKENDS_INIT();

    uart_config();

    err_code = nrf_libuarte_async_tx(&amp;amp;libuarte, GOING_TO_SLEEP, length_sleep);
    APP_ERROR_CHECK(err_code);

    libuart_disabled();

    // Clear the internal event register.
    __SEV();
    __WFE();
    // Wait for an event.
    __WFE();

    uart_config();

    err_code = nrf_libuarte_async_tx(&amp;amp;libuarte, WAKEUP, length_wakeup);
    APP_ERROR_CHECK(err_code);

    while(1);
}


/** @} */
&lt;/pre&gt;&lt;/p&gt;
&lt;div id="gtx-trans" style="left:263px;position:absolute;top:123.333px;"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374395?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 16:35:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36f9cd1b-ec62-44d7-9088-e0d50acbfe80</guid><dc:creator>Lora</dc:creator><description>&lt;h1 id="mcetoc_1g6j092dq0"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;font-size:75%;"&gt;Thank you very much &lt;a href="https://devzone.nordicsemi.com/members/eith"&gt;Einar Thorsrud&lt;/a&gt;&amp;nbsp;for your help .&lt;/span&gt;&lt;/h1&gt;
&lt;div id="gtx-trans" style="left:328px;position:absolute;top:86.0781px;"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374391?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 16:01:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59286b57-5633-4cdd-8f98-c5987b845d5d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Lora,&lt;/p&gt;
&lt;p&gt;Yes, that is a measurement result which is in the right ballpark. The blinky example is as simple as possible, so the CPU never goes to sleep, so it will consume some mA (see the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/_tmp/nrf52840/autodita/CURRENT/parameters.i_cpu.html?cp=4_0_0_4_1_0_2"&gt;CPU running&amp;nbsp;current consumption scenario&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374295?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 09:01:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c1edae-f4b9-47b6-a3be-465dd6e48546</guid><dc:creator>Lora</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thank you for your feedback .&lt;/p&gt;
&lt;p&gt;With the a multimeter, i flash blinky_example the simple application in SDK 17.1.0 , and i have 3,8 mA .&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is it normal ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Lora&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374293?ContentTypeID=1</link><pubDate>Mon, 27 Jun 2022 08:45:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98190b89-6700-4cfb-9399-49eeac579560</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I see.. Could it be that you have shorted something on your DK, and that causes an excessive current consumption? Or perhaps you have configured the oscilloscope to multiply up the voltage by (a high) number which does not&amp;nbsp;reflect the attenuation of the probe you are using? Can you double check by&amp;nbsp;measuring with a simple&amp;nbsp;multimeter or similar and see if you get numbers in the same ballpark to rule that out?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374209?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 17:03:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2fe7018-645e-4357-a2d5-b073726972b5</guid><dc:creator>Lora</dc:creator><description>&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Hi Einar,&lt;/span&gt;&lt;/p&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traduction"&gt;&lt;span class="Y2IQFc" style="font-family:arial, helvetica, sans-serif;" lang="en"&gt;by information, I powered the card with a 3.3v battery, SW9 on VDD, SW6 on DEFAULT .&lt;br /&gt;&lt;br /&gt;Thank you&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374208?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 16:55:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0698fbf-f61c-480b-9014-ed56f8b4462f</guid><dc:creator>Lora</dc:creator><description>&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Hi Einar,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Yes&amp;nbsp;I just measured the resistance with a multimeter I am at 10 ohms .&lt;/span&gt;&lt;/p&gt;
&lt;pre id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traduction"&gt;&lt;span class="Y2IQFc" style="font-family:arial, helvetica, sans-serif;" lang="en"&gt;yes I am using an oscillator to measure the voltage .&lt;br /&gt;&lt;br /&gt;Thank you .&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/WhatsApp-Image-2022_2D00_06_2D00_24-at-18.52.57.jpeg" /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/WhatsApp-Image-2022_2D00_06_2D00_24-at-18.52.49.jpeg" /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Low Power Mode using app uart example</title><link>https://devzone.nordicsemi.com/thread/374205?ContentTypeID=1</link><pubDate>Fri, 24 Jun 2022 16:35:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e1b4944-f207-47d2-bf49-ae65fb7e8ebf</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think you need to look more closely at how you measure the current before you look at the SW.&amp;nbsp; You are seeing over 200 mA and is an&amp;nbsp;enormous current consumption, which you should never see regardless of the state of the nRF, so i very. much suspect a measurement&amp;nbsp;setup issue of some sort. Are you sure the resistor is 10 ohm? Can you double check? Or could there be an issue in how you measure the voltage over it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>