1. Is there any document available from Nordic that describes the exact steps to measure power consumption in PSM mode with the Dev Kit? Also, is there a test firmware available to test exactly this?
2. If the answer to #1 is No, then can you check and let me know if the following steps are correct to put the chip into PSM mode (lets say ping the tower every 60 seconds but no data transmission at all) ? (We basically want to see what is the power consumption during sleep and also when pinging the tower and no other other data transfer happens)
Steps I gathered so far:
Adding the CONFIG_SERIAL=n to the SPM prj.conf file. This is located in the SDK_ROOT/nrf/samples/nrf9160/spm folder.
#include <lte_lc.h>
void setup_psm(void)
{
/*
* GPRS Timer 3 value (octet 3)
*
* Bits 5 to 1 represent the binary coded timer value.
*
* Bits 6 to 8 defines the timer value unit for the GPRS timer as follows:
* Bits
* 8 7 6
* 0 0 0 value is incremented in multiples of 10 minutes
* 0 0 1 value is incremented in multiples of 1 hour
* 0 1 0 value is incremented in multiples of 10 hours
* 0 1 1 value is incremented in multiples of 2 seconds
* 1 0 0 value is incremented in multiples of 30 seconds
* 1 0 1 value is incremented in multiples of 1 minute
* 1 1 0 value is incremented in multiples of 320 hours (NOTE 1)
* 1 1 1 value indicates that the timer is deactivated (NOTE 2).
*/
char psm_settings[] = CONFIG_LTE_PSM_REQ_RPTAU;
printk("PSM bits: %c%c%c\n", psm_settings[0], psm_settings[1],
psm_settings[2]);
printk("PSM Interval: %c%c%c%c%c\n", psm_settings[3], psm_settings[4],
psm_settings[5], psm_settings[6], psm_settings[7]);
int err = lte_lc_psm_req(true);
if (err < 0) {
printk("Error setting PSM: %d Errno: %d\n", err, errno);
}
}
{
int ret;
int err;
static enum lte_lc_nw_reg_status status = LTE_LC_FUNC_MODE_POWER_OFF;
handle_bsdlib_init_ret();
ret = dk_leds_init();
if (ret){printk("LED init failed\n");}
if (!IS_ENABLED(CONFIG_AT_HOST_LIBRARY)) {/* Stop the UART RX for power consumption reasons */NRF_UARTE0_NS->TASKS_STOPRX = 1;}
k_sleep(1 * 1000);
setup_psm();
k_sleep(2 * 1000);
// Connect Cat-m1
err = lte_lc_init_and_connect();if (err) {printk("LTE link could not be established.\n"); // wait LED lit for ever if we can't connect to the networkwhile(1){dk_set_led_on(0);dk_set_led_on(1);k_sleep(500);}}
// Flash LEDs to indicate good start.
dk_set_led_on(1);
k_sleep(3 * 1000);
dk_set_led_off(0);
dk_set_led_off(1);
k_sleep(500);
status = LTE_LC_FUNC_MODE_POWER_OFF;
lte_lc_nw_reg_status_get(&status);
/*
{
dk_set_led_off(0);
dk_set_led_off(1);
}
else if(LTE_LC_FUNC_MODE_NORMAL == status)
{
dk_set_led_on(0);
dk_set_led_on(1);
}
else if(LTE_LC_FUNC_MODE_OFFLINE == status)
{
dk_set_led_on(0);
dk_set_led_off(1);
}
else if(LTE_LC_FUNC_MODE_OFFLINE_UICC_ON == status)
{
dk_set_led_off(0);
dk_set_led_on(1);
}
else
{
dk_set_led_off(0);
dk_set_led_off(1);
}