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

Zephyr/nRF Connect on custom board - 20 microamps in ksleep()

Hi, 

I am using Zephyr to do some action in a main loop and ksleep for 30 seconds. While in ksleep(), I can see that the consumption is 20ua. The board is a very small simple board which only has a button and four LEDs on it. The LED's are off in ksleep. Things that I have tried:

1) Turned off UART

2) CONFIG_SERIAL = n

3) Turned off debug/logging and disconnected debug tools (JLINK) and power cycled

4) The code advertises in BLE before the ksleep, but i make sure to shut down advertising before sleeping by running  bt_le_adv_stop();

What could be causing it?

  • Hi,

    Is this the same situation as in the original question? nRF52832? Which nRF Connect SDK version are you using?

  • Hi, yes andrew is working on this with me - i have been testing many situations and have found that MCUMGR/MCUBoot being enabled is increasing consumption by around 10ua. I was using zephyr 2.3.99, and i'm pretty sure it's the latest NCS version - how can i check?

  • Hi Einar,

    In order to test this scenario, I have fully upgraded to the very latest NCS version, and can confirm this issue persists. Please can you try to reproduce it to confirm my suspicions? Here is how:

    1. Adapt the "Hello World" Zephyr sample to turn off uart, and have a while loop with a sleep:

      #include <zephyr.h>

      #include <sys/printk.h>

      #include <hal/nrf_uart.h>

      #include <hal/nrf_uarte.h>

      void main(void)

      {

        printk("Hello World! %s\n", CONFIG_BOARD);

        nrf_uarte_disable(NRF_UARTE0);

        while(1) {

          k_sleep(K_MSEC(30000));

        }

      }

    2. Add CONFIG_SERIAL=n to prj.conf, and monitor the consumption. It should use around 2-3ua in ksleep.
    3. Add CONFIG_BOOTLOADER_MCUBOOT=y to the prj.conf. You will see it uses at least 11ua in this scenario
  • Hi,

    I am not able to reproduce this on a DK when I test the hello world sample from NCS 1.3 with your changes. Regardless of using mcuboot or not ("CONFIG_BOOTLOADER_MCUBOOT=y" in prj.conf commented or not), the current consumption is the same at about 2-3 μA. Are you able to reproduce this on the DK, or only on your custom board?

  • Hi, sorry for the late reply I have been doing some in-depth testing.

    We have found that, after adapting our current project to do the same as this, we are seeing the same results as you. However, when running the below line when setting up an interrupt on the button pin, it increases the consumption by about 17ua:

    gpio_pin_interrupt_configure(button, SW0_GPIO_PIN, GPIO_INT_EDGE_TO_ACTIVE);

    In order to test this, I span up the basic button sample from Zephyr, and can see that the consumption on this is very high too (after disabling uart and bringing the main loop sleep to 30 seconds). It seems that this function call increases consumption - are you seeing the same?  

Related