nRF9160 - SYSTEM OFF Mode Current

Dear colleagues,

with the newer SDK (I am now using NCS v2.5.0 and 2.6.0), I have difficulties finding the right SYSTEM OFF mode current.

Code currently looks like as follows:

#include <zephyr/kernel.h>
#include <modem/lte_lc.h>

int main(void)
{
	printk("Hello World! %s\n", CONFIG_BOARD);
	nrf_modem_lib_init();
	printk("Turn off Modem and switch to SYSTEM OFF\n");
	lte_lc_power_off();
    k_sleep(K_MSEC(1000));
    NRF_REGULATORS->SYSTEMOFF = 1;
	return 0;
}


Based on: 

A)  Getting started with current measurements on the nRF9160 

and B)  NRF9160DK & System OFF 

prj.conf was extended to: (does not change anything, I only had the LC layer enabled at first)

# Modem library and link control
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_NRF_MODEM_LIB=y

I initially had no modem lib included/function call in the main.c (this was my setup from previous NCS releases, and it worked fine) - but also with the suggested change in the devzone ticket, I don't see a difference. I am measuring 2.7mA.

What is interesting to note though:

If I would erase the flash, and program the *.hex file from the DevZone guide from Stian, I reach about about 400uA. If I then re-erase the flash, and program my code snippet, I end up at the expected current consumption of 1.4uA.

I cannot explain this behavior though, and wonder how I reach the SYSTEM OFF current without flashing the hex file from the devzone guide first.

Thanks,
Kevin

Parents
  • Hi Kevin,

    I did a try with your codes based on NCS v2.6.1 and nRF9160DK v1.1.0. I think it works as expected.

    Could you try the attached codes? Maybe test with one more nRF9160DK in case it is related to HW?

    ncs261_systemoff.zip

    ncs261_SystemOff.hex

    Best regards,

    Charlie

  • Hi Charlie,

    after back and forth testing, and updating my Toolchain + SDK again, I found out the following:

    • On previous SDK releases, nrf_modem_lib_init() is not required (tested this on NCS v1.8.0)
    • On current SDK releases (tested NCS v2.5.0,v2.6.0,v2.6.1) - nrf_modem_lib_init() is a MUST / requirement
      • Your code provided code in the project *.zip file and the compiled ncs261_systemoff.hex seem to not include this line and thus don't work (for me).
      • You should see a higher current when you fully power down the board and SiP and repower after a few seconds.
      • It will seem to work, when you had a correct code sample flashed initially, and then reflash your code while measuring the current consumption and not going through a full power down cycle.
    • With a working code, I am at around 2uA, testing this with SICA B1, nRF9160 DK v1.0.1
    • I am slightly higher with the old SiP revision but it also works: 2.35 uA on SICA B0, nRF9160 DK v0.14.0
    • CONFIG_LTE_AUTO_INIT_AND_CONNECT was deprecated and removed with NCS v2.6.0 - but the cmake will report this, so its easy to catch if missing it.

    My code looks as follows now. I don't know why I couldn't get the right result previously as I had the modem lib init() call already in my code. A clean SDK & Toolchain installation, plus a pristine build now helped me to find consistent results.

    #include <zephyr/kernel.h>
    #include <modem/lte_lc.h>
    #include <modem/nrf_modem_lib.h>
    
    int main(void)
    {
    	printk("Hello World! %s\n", CONFIG_BOARD);
    	nrf_modem_lib_init();
    	printk("Turn off Modem and switch to SYSTEM OFF\n");
    	lte_lc_power_off();
    	k_sleep(K_MSEC(1000));
        NRF_REGULATORS->SYSTEMOFF = 1;
    	return 0;
    }

    prj.conf:

    # Modem library and link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_NRF_MODEM_LIB=y

    Attaching also my compiled hex file:
    ncs_261_sysoff_modemlib_init.hex

    If someone is interested in NCS v1.8.0 compiled file (code is similar but no modem_lib_init() and the zephyr related includes are different):
    ncs_180_systemoff.hex

    Best,
    Kevin

Reply
  • Hi Charlie,

    after back and forth testing, and updating my Toolchain + SDK again, I found out the following:

    • On previous SDK releases, nrf_modem_lib_init() is not required (tested this on NCS v1.8.0)
    • On current SDK releases (tested NCS v2.5.0,v2.6.0,v2.6.1) - nrf_modem_lib_init() is a MUST / requirement
      • Your code provided code in the project *.zip file and the compiled ncs261_systemoff.hex seem to not include this line and thus don't work (for me).
      • You should see a higher current when you fully power down the board and SiP and repower after a few seconds.
      • It will seem to work, when you had a correct code sample flashed initially, and then reflash your code while measuring the current consumption and not going through a full power down cycle.
    • With a working code, I am at around 2uA, testing this with SICA B1, nRF9160 DK v1.0.1
    • I am slightly higher with the old SiP revision but it also works: 2.35 uA on SICA B0, nRF9160 DK v0.14.0
    • CONFIG_LTE_AUTO_INIT_AND_CONNECT was deprecated and removed with NCS v2.6.0 - but the cmake will report this, so its easy to catch if missing it.

    My code looks as follows now. I don't know why I couldn't get the right result previously as I had the modem lib init() call already in my code. A clean SDK & Toolchain installation, plus a pristine build now helped me to find consistent results.

    #include <zephyr/kernel.h>
    #include <modem/lte_lc.h>
    #include <modem/nrf_modem_lib.h>
    
    int main(void)
    {
    	printk("Hello World! %s\n", CONFIG_BOARD);
    	nrf_modem_lib_init();
    	printk("Turn off Modem and switch to SYSTEM OFF\n");
    	lte_lc_power_off();
    	k_sleep(K_MSEC(1000));
        NRF_REGULATORS->SYSTEMOFF = 1;
    	return 0;
    }

    prj.conf:

    # Modem library and link control
    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_NRF_MODEM_LIB=y

    Attaching also my compiled hex file:
    ncs_261_sysoff_modemlib_init.hex

    If someone is interested in NCS v1.8.0 compiled file (code is similar but no modem_lib_init() and the zephyr related includes are different):
    ncs_180_systemoff.hex

    Best,
    Kevin

Children
  • Hi Kevin,

    Thanks for sharing your experience.

    The specification claim the MCUOFF0 could reach a typical value 1.4uA.

    I added nrf_modem_lib_shutdown(); after modem power off to shut it down, then got around 1.25uA on my nRF9160DK v1.1.0.

    int main(void)
    {
        printk("Hello World! %s\n", CONFIG_BOARD);
        nrf_modem_lib_init();
        printk("Turn off Modem and switch to SYSTEM OFF\n");
        lte_lc_power_off();
        nrf_modem_lib_shutdown();
        k_sleep(K_MSEC(1000));
        NRF_REGULATORS->SYSTEMOFF = 1;
        return 0;
    }
    You can test if it can help to decrease the current on your device further.
    Best regards,
    Charlie
  • Thanks Charlie, good input.

    I will be able to test this next week. If confirmed, we should update our recommended answer/solution to this thread Slight smile

    Best,
    Kevin

Related