suspend i2c does NOT reduce current?

Hi,

The custom board is 52832 with st lsm6dsr sensor.

I tried to suspend i2c by this code: 

#define I2C_INST DT_NODELABEL(i2c0)
const struct device *const i2c = DEVICE_DT_GET(I2C_INST);
int rc = pm_device_action_run(i2c, PM_DEVICE_ACTION_SUSPEND);
	if (rc < 0) {
		LOG_ERR("Could not suspend i2c (%d)\n", rc);
	}

It worked with no errors. 

But when I measure the current, its the same whether the i2c is suspended or resumed. There is NO power saving at all. I checked the config, it has following:
CONFIG_I2C_NRFX=y
CONFIG_I2C_NRFX_TRANSFER_TIMEOUT=500
CONFIG_I2C_0_NRF_TWI=y
CONFIG_I2C_INIT_PRIORITY=50 

Questions:
1. How to reduce current by suspend i2c/twi? Is there any configuration I should do?  When with SDK, disable twi can reduce significant current. 

2. For 52832, how to make it into low power mode?

Thanks,

Parents Reply
  • Hi,

    Here is my full project conf:

    CONFIG_BT=y
    CONFIG_BT_SMP=n
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DIS_PNP=n
    CONFIG_BT_BAS=y
    CONFIG_BT_ATT_ENFORCE_FLOW=n
    CONFIG_CBPRINTF_FP_SUPPORT=y
    CONFIG_ADC=y

    CONFIG_SENSOR=y
    CONFIG_I2C=y
    CONFIG_PINCTRL=y
    CONFIG_GPIO=y

    #power mgmt
    CONFIG_PM_DEVICE=y
    CONFIG_PM=y
    CONFIG_PM_DEVICE_RUNTIME=y

    #throughput
    CONFIG_BT_PERIPHERAL_PREF_MIN_INT=6
    CONFIG_BT_PERIPHERAL_PREF_MAX_INT=6
    CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=400


    CONFIG_BT_BUF_ACL_RX_SIZE=502
    CONFIG_BT_ATT_PREPARE_COUNT=2
    CONFIG_BT_L2CAP_TX_BUF_COUNT=10
    CONFIG_BT_L2CAP_TX_MTU=498
    CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
    CONFIG_BT_CONN_TX_MAX=10
    CONFIG_BT_BUF_ACL_TX_COUNT=10
    CONFIG_BT_BUF_ACL_TX_SIZE=502

    CONFIG_BT_CTLR_DATA_LENGTH_MAX=251

    Other than the power management documents, I also read source code of twi related and found the twi is disabled after each single transfer. So the issue is 52832 doesn't lower down current after i2c operation,  I tested and just one single read/write through i2c the current rised and not back.

    I am using twi, not twim, so it shouldn't be erratum 89 issue.

    So anything wrong with my configuration?

    Thanks,

Children
Related