NRF52832 high idle power consumption

I am currently using ncs 2.9.0 on a custom board using the internal ldo and internal clock settings. It is a simple project where I take and indicate an adc and internal temperature measurement every 4 seconds, and toggle a GPIO over BLE. Using the power profiler I get an idle current of around 110 uA when powered at 3.0 V. I believe it is a software problem because around 2 months ago, I used the same PCBs to get an idle current below 5 uA, and after some software changes I am not able to get back to that level again.

I have disabled all unused peripherals including UART in the nrf52dk_nrf52832.overlay file.

/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * Copyright (c) 2022 Nordic Semiconductor ASA
 */

/* STEP 2.2 - Create a zephyr,user node and set it’s io-channels to the ADC channel  */
/ {
	zephyr,user {
		io-channels = <&adc 0>;
	};
};

/* STEP 2.3 -Configure the ADC channel  */
&adc {
	#address-cells = <1>;
	#size-cells = <0>;
	status = "okay";
	channel@0 { // CHANNEL at 0 means we are using ADC0
		reg = <0>;
		zephyr,gain = "ADC_GAIN_1_6";
		zephyr,reference = "ADC_REF_INTERNAL";
		zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
		zephyr,input-positive = <NRF_SAADC_AIN3>; /* P0.02 for nRF52xx, P0.04 for nRF5340 */
		zephyr,resolution = <12>;
	};
};

&uart0 {
    status = "disabled";
};

/*&uart0_default {
	group1 {
		psels = <NRF_PSEL(UART_TX, 0, 6)>,
				<NRF_PSEL(UART_RX, 0, 1)>,
				<NRF_PSEL(UART_RTS, 0, 5)>,
				<NRF_PSEL(UART_CTS, 0, 7)>;
	};
};*/

&pwm0 {
	status = "disabled";
};

&power {
	status = "okay";
};

&led0 {
    status = "disabled";
};

&led1 {
    status = "disabled";
};

&led2 {
    status = "disabled";
};

&led3 {
    status = "disabled";
};

&button0 {
    status = "disabled";
};

&button1 {
    status = "disabled";
};

&button2 {
    status = "disabled";
};

&button3 {
    status = "disabled";
};
&spi0 {
    status = "disabled";
};
&spi1 {
    status = "disabled";
};
&spi2 {
    status = "disabled";
};
&i2c0 {
    status = "disabled";
};
&i2c1 {
    status = "disabled";
};
&i2s0 {
    status = "disabled";
};

I turned off many things in the prj.conf file 

#----------------------------------------
# Disable boot banners and console output
#----------------------------------------
CONFIG_NCS_BOOT_BANNER=n      # Disable NCS-specific banner
CONFIG_BOOT_BANNER=n          # Disable Zephyr’s own boot banner
CONFIG_EARLY_CONSOLE=n
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_RTT_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n

#-----------------------
# Power Management
#-----------------------
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

#-------------------------------------------------
# Clock control (internal RC oscillator settings)
#   for EYSHSNZWZ (Nordic nRF chip)
#-------------------------------------------------
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_LF_ALWAYS_ON=y

#------------------------------
# Logging and Debug Options
#------------------------------
CONFIG_LOG=n
CONFIG_LOG_MODE_MINIMAL=n
CONFIG_PRINTK=n
CONFIG_ASSERT=n
CONFIG_DEBUG_OPTIMIZATIONS=n

# Disable Nordic Cloud logging details
CONFIG_NRF_CLOUD_LOG_OUTPUT_LEVEL=0
CONFIG_NRF_CLOUD_PRINT_DETAILS=n
CONFIG_NRF_CLOUD_VERBOSE_DETAILS=n

# Disable DK library (LEDs, buttons, etc.)
CONFIG_DK_LIBRARY=n

#------------------------------------
# ADC and Floating-Point Support
#------------------------------------
CONFIG_ADC=y
CONFIG_CBPRINTF_FP_SUPPORT=n
CONFIG_FPU=n

#----------------------------
# Bluetooth Configuration
#----------------------------
CONFIG_BT=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n
CONFIG_BT_BAS=n

# Device identification over BLE
CONFIG_BT_DEVICE_NAME="device"
CONFIG_BT_DEVICE_APPEARANCE=768   # 768 = generic thermometer
.  I confirmed in the build->.config file that all logging/printing configurations are not set. 

In the main code, at an attempt to debug, I also manually pulled all unused GPIOs down 

static const struct gpio_dt_spec wrt_spec = {
	.port = DEVICE_DT_GET(DT_NODELABEL(gpio0)),
	.pin = WRITE_GPIO_PIN,
	.dt_flags = GPIO_ACTIVE_HIGH
};

static int init_GPIO(void)
{
	int err;
	int ret;

	// GPIO init and config
	// return 0 means not ready
	err = gpio_is_ready_dt(&wrt_spec);
	if (!err) {
	//LOG_ERR("Error: WRITE GPIO is not ready, err: %d", err);
	return -ENODEV;
	}
	// return 0 means successful
	ret = gpio_pin_configure_dt(&wrt_spec, GPIO_OUTPUT_INACTIVE);
	if (ret < 0) {
		return ret;
		//LOG_ERR("Error: Unable to configure WRITE GPIO pin, err: %d\n", ret);
	}

    /* Configure all other P0.X pins as outputs and drive low */
    for (uint32_t pin = 0; pin < 32; pin++) {
        if (pin == WRITE_GPIO_PIN || pin == 5) {
            continue;
        }
        nrf_gpio_cfg_output(pin);
        nrf_gpio_pin_clear(pin);
    }
	    return 0;

}

Please help!!

Related