power consumption of I2C and bootloader?

Hello,

Im trying to get my system on idle current as low as possible on my nRF52840.

I am testing this with a program with just k_sleep() in the main function, nothing else.

I noticed that when I add CONFIG_I2C=y, the idle current rises by about 7uA. why is that and how can I get rid of the extra current?

adding to that, I found out that enabling CONFIG_BOOTLOADER_MCUBOOT=y adds a lot of noise and about 500uA of extra current. I dont get why though, as this option really only adds the bootloader to the image? Does McuBoot configure something and then doesnt turn it off?

to test, just use the system off demo and remove everything except for the k_sleep.

Kind regards,

Jonas Woerner

Parents
  • Hello,

    I am using NCS 2.4.2, NRF52DK (nrf52832 SoC)

    Using the system off demo

    As per your case, removing everything but the k_sleep and the empty loop:

    With CONFIG_I2C=y in the prj.conf and measuring using PPK2.

    The average current is 3.23mA

    Without CONFIG_I2C, the average current is 2.96mA

    The difference of using I2C Config is +270uA average current.

    Now, because when the CONFIG_I2C is not used, still the I2c0 is enabled. So, here I disabled I2c0 using the overlay as well, and measured for the peripheral and config enabled and disabled:

    (Average current in mA measured using PPK2)

    If you want to use the I2c, then both the config and peripheral should be enabled.

    If you plan not to use the i2c, then both should be disabled.

    Regarding the CONFIG_BOOTLOADER_MCUBOOT, I believe it would have different dependencies and bootloader would have its own configs that would enable different peripherals or parts. For example, it selects "USE_DT_CODE_PARTITION", which would depend on the FLASH.

    You may compile the project with and without this config and check the resultant configuration in the ./zephyr/.config.

    /BR, Naeem

Reply
  • Hello,

    I am using NCS 2.4.2, NRF52DK (nrf52832 SoC)

    Using the system off demo

    As per your case, removing everything but the k_sleep and the empty loop:

    With CONFIG_I2C=y in the prj.conf and measuring using PPK2.

    The average current is 3.23mA

    Without CONFIG_I2C, the average current is 2.96mA

    The difference of using I2C Config is +270uA average current.

    Now, because when the CONFIG_I2C is not used, still the I2c0 is enabled. So, here I disabled I2c0 using the overlay as well, and measured for the peripheral and config enabled and disabled:

    (Average current in mA measured using PPK2)

    If you want to use the I2c, then both the config and peripheral should be enabled.

    If you plan not to use the i2c, then both should be disabled.

    Regarding the CONFIG_BOOTLOADER_MCUBOOT, I believe it would have different dependencies and bootloader would have its own configs that would enable different peripherals or parts. For example, it selects "USE_DT_CODE_PARTITION", which would depend on the FLASH.

    You may compile the project with and without this config and check the resultant configuration in the ./zephyr/.config.

    /BR, Naeem

Children
  • Hello Naeem,

    thanks for your detailed reply!

    I am wondering, why do you have 2-3mA of current while sleeping? is that because its the nRF52832 instead of 40? I only get <10uA even with I2C on.

    But your tests are Interesting nontheless! Do you know if its possible to deactivate the I2C peripheral at runtime? I am using it, but it would be nice to be able to disable it while sleeping.

    EDIT: I just tried this using the runtime_pm API, but nothing has changed. I am using the lm75 sensor driver and saw that in the driver, the runtime_pm functions are basically no-ops. I then tried to put I2C directly to sleep with pm_device_runtime_put, but that did nothing. Im guessing because the usage count is still >0 because of the sensor? how can I get this to work?

    Regarding MCUboot, I know that the bootloader enables its own peripherals, but shouldnt it also disable them when starting the main application? The way it is now, we cant use the bootloader because of this high current consumption..

    Kind regards,

    Jonas

  • Hello Jonas,

    jonas.woerner said:
    am wondering, why do you have 2-3mA of current while sleeping?

    I had the infinite empty for loop still there. Can you check with and without the loop?

    jonas.woerner said:
    Do you know if its possible to deactivate the I2C peripheral at runtime?

    I think you can use zephyr power management api given that the device driver supports it. Please have a look at zephyr samples like: Zephyr Power Management

    This ticket also discusses the same regarding the use of PM API: Dynamically-Disable-i2c

Related