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,

    A current consumption of 20 uA is not a number that I would expect for system ON. Normally you should see 2-4 uA, and using additional non-low-power peripherals would increase it significantly more than up to 20 uA. Could it be that this is caused by other components on your board? If not, can you test a simple test firmware that does nothing other than sleeping, and check if you get comparable current consumption on the DK and your custom board? What do you measure then?

  • Thanks - appreciate your quick response.

    I have attached the schematic for my custom board for your reference - you'll see it's very simple.
    I have adapted the Hello World example so that it simply goes to ksleep for 90 seconds. Here is the code i ran (sorry i dont see a way to format this into code):

    #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_enable(NRF_UARTE0);

      while(1) {

        k_sleep(K_MSEC(90000));

      }

    }

    And here is my prj.conf:

    CONFIG_SERIAL=n

    I see a constant usage of 13-15 microamps using this code. This is less than my original code, so there is something that I need to turn off in that one i guess, but it is still not the 2-4uA that you mentioned. It is very difficult to get an accurate consumption reading from the DK because I can't isolate parts of the circuit that I need to, and after speaking to a Nordic engineer before, this involves desoldering etc which I don't really want to do

    Schematic_1_0.pdf

  • Hi einar, I have just seen the typo in my code in hello world:

    nrf_uarte_enable(NRF_UARTE0);

    This should be disable. When disabling it, I am reading 2.4ua in ksleep, which is a normal reading. 

    Therefore based on this we know that it is not the hardware causing the issues. But I can confirm that I disable uart in the same manner in my original code, so that is not the cause of the high usage there...

  • I see. Good to know the HW is OK.

    The value of the current consumption itself does not give much hint, so I suspect the fastest way to narrow this down is to gradually comment out more and more of your code (initializing and uninitializing less and less to see at what point you no longer see the unexpected current consumption. That way you should fairly quickly see what parts is related to the high current consumption.

  • Hi - Simply adding MCUBOOT to the hello_world project config increases power consumption by ~10ua but the consumption then continues to rise, seemingly indefinitely.

Related