How to achive power optimisation in NRF5340

Hi,

We are trying to attain power optimization in our project, which uses the nRF5340 board. In our code we have implimented RTOS, BLE for data transfer and are using i2c and spi for other device communication, uart for data logging.
 We tried enabling the System and Device power management in our prj.conf file as mentioned in the post optimizing-power-on-nrf53-designs  but found no difference in the current consuption.    

  1. By testing, we have found that calling the function k_sleep() decreases the current consumption. What is the relevance of k_sleep() in power consumption?
  2. The RTOS waits for events to be set to execute the necessary process in our project. Does the device go to sleep while waiting for the event?
  3. If a pin is undefined, is there any chance it draws current via the pin? Some of the pins, we are not using in the code—do we need to undefine those pins?
  4. Does UART logging consume more power?
  5. What is the minimum power consumption we can achieve with this device configuration?
  6. How can we control power management in the device?

  • Hi,
    As mentioned before when we dissabled every peripheral we are getting base current in custom board to be 85uA  range

    And when enabling BLE the average current raises to 1.6mA range. Keeping all peripherals disabled.

    These are our .config and main files when enabling BLE
    37048.prj.conf

    /*
     * Copyright (c) 2016 Intel Corporation
     *
     * SPDX-License-Identifier: Apache-2.0
     */
    
    #include <zephyr/kernel.h>
    #include <zephyr/bluetooth/bluetooth.h>
    #include <zephyr/bluetooth/hci.h>
    #include <zephyr/bluetooth/conn.h>
    #include <zephyr/bluetooth/uuid.h>
    #include <zephyr/bluetooth/gatt.h>
    #include <zephyr/settings/settings.h>
    
    /* 1000 msec = 1 sec */
    #define SLEEP_TIME_MS   1000
    
    static const struct bt_data ad[] = {
    	BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
    	BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(BT_UUID_DIS_VAL)),
    };
    
    static void connected(struct bt_conn *conn, uint8_t err)
    {
    	if (err) {
    		printk("Connection failed (err 0x%02x)\n", err);
    	} else {
    		printk("Connected\n");
    	}
    }
    
    static void disconnected(struct bt_conn *conn, uint8_t reason)
    {
    	printk("Disconnected (reason 0x%02x)\n", reason);
    }
    
    BT_CONN_CB_DEFINE(conn_callbacks) = {
    	.connected = connected,
    	.disconnected = disconnected,
    };
    
    static int settings_runtime_load(void)
    {
    #if defined(CONFIG_BT_DIS_SETTINGS)
    	settings_runtime_set("bt/dis/model",
    			     "Zephyr Model",
    			     sizeof("Zephyr Model"));
    	settings_runtime_set("bt/dis/manuf",
    			     "Zephyr Manufacturer",
    			     sizeof("Zephyr Manufacturer"));
    #if defined(CONFIG_BT_DIS_SERIAL_NUMBER)
    	settings_runtime_set("bt/dis/serial",
    			     CONFIG_BT_DIS_SERIAL_NUMBER_STR,
    			     sizeof(CONFIG_BT_DIS_SERIAL_NUMBER_STR));
    #endif
    #if defined(CONFIG_BT_DIS_SW_REV)
    	settings_runtime_set("bt/dis/sw",
    			     CONFIG_BT_DIS_SW_REV_STR,
    			     sizeof(CONFIG_BT_DIS_SW_REV_STR));
    #endif
    #if defined(CONFIG_BT_DIS_FW_REV)
    	settings_runtime_set("bt/dis/fw",
    			     CONFIG_BT_DIS_FW_REV_STR,
    			     sizeof(CONFIG_BT_DIS_FW_REV_STR));
    #endif
    #if defined(CONFIG_BT_DIS_HW_REV)
    	settings_runtime_set("bt/dis/hw",
    			     CONFIG_BT_DIS_HW_REV_STR,
    			     sizeof(CONFIG_BT_DIS_HW_REV_STR));
    #endif
    #endif
    	return 0;
    }
    
    int main(void)
    {
    	bt_enable(NULL);
    
    	if (IS_ENABLED(CONFIG_BT_SETTINGS)) {
    		settings_load();
    	}
    	settings_runtime_load();
    
    	bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
    
    	while(1)
    	{
    		k_msleep(2000);	
    	}
    
    	return 0;
    }
    
    

    • Is there any low power ble example code we could try? 

    We tried the sample code provided by zephyr "peripheral_dis" . Still we are observing current range around 1.6mA in our board

    • Base current should be less than 100uA right?

    Since we achieved lower power in the same board we believe this current increase is due to ble enabling other than that we are not enabling anything.

    • have we done any mistake in the configuration of ble as we are getting the base current to be in 1.5mA range when enabling ble?

    Thanks,
    Maya

  • Hi,
    We were able to reduce the current range in our board when we changed our childimage with a different one
    4657.hci_rpmsg.conf

    Now the current consumption is around 245uA range with only the ble enabled.

  • Hi,

    Maybe you could try to add the following in the while loop in the main():

    while (1) {
    pm_power_state_force((struct pm_state_info){ PM_STATE_SOFT_OFF, 0, 0 });
    k_msleep(SLEEP_TIME_MS);
    }

    just to make sure that the system enters sleep modes properly when idle. 

    -Priyanka

Related