This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART deinit does not reduce power consumption and it too big (600uA)

When initializing a UART instance (0 or 1 or both together), the current consumption increases to 600 μA

Then deinitialized UART, but consumption is not reduced!

- I tried not to use EasyDMA

- Tried nrf_drv_uart_rx_disable() before deinitialization

- Tried this: https://devzone.nordicsemi.com/f/nordic-q-a/15243/high-power-consumption-when-using-fpu

- Tried to reinitialize the pins after UART deinitialization

Nothing helps... =(

Code of UART deinit:

nrf_drv_uart_t* nrf_drv_uart_get_instance(uint8_t instance)
{
  if(instance==nRF5x_UART0) return &nrf_drv_uart0;
  return &nrf_drv_uart1;
}

uint8_t nRF5x_UART_deinit(uint8_t instance)
{
  if(instance >= UART_INSTANCE_COUNT) return false;
  if(nRF5x_UART_inited_flag[instance]) {
    nrf_drv_uart_t uart = *nrf_drv_uart_get_instance(instance);
    nrf_drv_uart_rx_disable(&uart);
    nrf_drv_uart_uninit(&uart);
    nRF5x_UART_inited_flag[instance] = 0;
  }
  return !nRF5x_UART_inited_flag[instance];
}

I always use __WFE() without SoftDevice and sd_app_evt_wait() with SoftDevice

SDK15 and S140 v.6.0.0 Production

Related