High power consumption after uninit of libuarte

Hi,

currently I'm facing an issue with the power consumption of my pcb. The idle power consumption is at about 20 µA. After initialising the UART it goes up to over 1 mA. If I uninitialise the UART again, the power consumption stays at about 280 µA which is much higher than before. At the moment of the test both pins from the UART were disconnected. 

I'm using SDK5 17.1.0 and the following code snippets to (un-)initialise the UART:

//Definition
NRF_LIBUARTE_ASYNC_DEFINE(uart_gsm, 0, 1, NRF_LIBUARTE_PERIPHERAL_NOT_USED, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);

// Activation
nrf_libuarte_async_config_t nrf_libuarte_async_config = {
                .tx_pin     = PIN_GSM_RX,
                .rx_pin     = PIN_GSM_TX,
                .baudrate   = NRF_UARTE_BAUDRATE_9600,
                .parity     = NRF_UARTE_PARITY_EXCLUDED,
                .hwfc       = NRF_UARTE_HWFC_DISABLED,
                .timeout_us = 100,
                .int_prio   = APP_IRQ_PRIORITY_LOW_MID
            };

uint32_t err_code = nrf_libuarte_async_init(&uart_gsm, &nrf_libuarte_async_config, uart_gsm_event_handler, (void *)&uart_gsm);
APP_ERROR_CHECK(err_code);

nrf_libuarte_async_enable(&uart_gsm);
            
//Deactivation
nrf_libuarte_async_uninit(&uart_gsm);
           
nrf_gpio_input_disconnect(PIN_GSM_TX);
nrf_gpio_input_disconnect(PIN_GSM_RX);

Is there anything I'm missing when deactivating the UART? How can I go back to my idle power consumption?

Best regards,

Christian 

Parents Reply Children
  • Hi Christian,

    Thanks for sharing the project. Unfortunately, I'm currently unable to build Keil projects as I'm running Ubuntu, but I did look at the code and did not spot any errors.

    Please try to add the code snippet below after libuarte uninit and see if it makes any difference. This will help confirm if the UARTE peripheral is the culprit or not.

        /* Power-cycle UARTE0 to force release of HF clock request */
        *(volatile uint32_t *)(NRF_UARTE0_BASE + 0xFFC) = 0;
        *(volatile uint32_t *)(NRF_UARTE0_BASE + 0xFFC);
        *(volatile uint32_t *)(NRF_UARTE0_BASE + 0xFFC) = 1;
    

    Best regards,

    Vidar

  • Hi Vidar, 

    thanks for your support. I tried the code snippet, but nothing changes. So I initialised the UART with two different pins and that led to the correct result. The power consumption was reduced to the expected value after uninit. Obviously, there's an issue with our pcb but that's something I have to discuss with our team. 

    Thanks for your time and your help.

    Best regards,

    Christian

Related