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

Sleep Modes on the nrf9160 DK

Hi All,

I've just received an nrf9160dk, I'm starting to investigate the development of our application while the hardware guys produce a custom board.  

I'm just starting with the power management and sleep modes for the nrf9160. 
The form of the application is as follows:

Most of the time I want the radio off (no PSM or eDRX), I also want the MPU in its lowest power state, with only the RTC running (no other peripherals are needed in sleep) 
Every 5 minutes I want to power on the MPU and sample a couple of sensors and store the results in EEPROM. 
Every 8 hours I want to power on the radio and send the previously buffered results. 

Our previous-gen product used a ublox SARA tied with UART to an STM32 uC. I've come from an STM32 development background and I'm struggling to find the appropriate function calls in the NRF-SKD that puts the nrf9160 into this deep sleep with the RTC running. 

Any help/guidance/pointers are very much apricahated.  

 

  • We don't need the UART in sleep, is there any way to de-init the serial peripheral before sleep that has the same effect as setting the CONFIG_SERIAL=n?


    Aditionally the LPUART sample provided doesn't compile with the below errors:

    3> In file included from C:/Users/josh/ncs/v1.4.0/zephyr/include/arch/arm/aarch32/arch.h:20,
    3>                  from C:/Users/josh/ncs/v1.4.0/zephyr/include/arch/cpu.h:19,
    3>                  from C:/Users/josh/ncs/v1.4.0/zephyr/include/kernel_includes.h:38,
    3>                  from C:/Users/josh/ncs/v1.4.0/zephyr/include/kernel.h:17,
    3>                  from C:/Users/josh/ncs/v1.4.0/zephyr/include/init.h:11,
    3>                  from C:/Users/josh/ncs/v1.4.0/zephyr/include/device.h:22,
    3>                  from C:/Users/josh/ncs/v1.4.0/zephyr/include/drivers/uart.h:26,
    3>                  from C:/Users/josh/ncs/v1.4.0/nrf/drivers/serial/uart_nrf_sw_lpuart.c:7:
    3> C:/Users/josh/ncs/v1.4.0/zephyr/include/devicetree.h:297:40: error: 'DT_N_INST_0_nordic_nrf_sw_lpuart_BUS_P_label' undeclared here (not in a function)


  • Hello again, Skipper!

    I understand. My bad! You can de-init peripherals during runtime. Given that you don't need printk I suggest using 's approach in this thread.

    The developers haven't added support for the non-secure partition of the nRF9160 to that sample from what I can see. It should work if you unzip the attached archive and add the files to the "boards" folder in the sample!

    3568.nrf916ns_conf_overlay.zip

    Best regards,
    Carl Richard

Related