Low power modes management

Hi,

I need to implement low power mode in my project with an nRF52832. From a general perspective, I want to:

1) boot the device,

2) initialise stuff/peripherals,

3) advertise for a number of milliseconds (or a number of advertisement cycles, still need to define this),

4) put peripherals into low power for waiting for interrupts from external sources, one of which is an RTC for time-keeping and periodic 1Hz high-accuracy interrupts,

5) go to low power (system on)

6) restart cycle on step 2) when awaken by an interrupt from the RTC IRQ GPIO.

I've tried to create this logic going to System Off mode, but the time it takes to the 32KHz oscillator to start every time the system wakes from system off is too long (0.25s according to specs, by I measured >300ms), so I've decided to move to System ON low power mode.

My questions are. How do I do for properly shutting down advertising? How do I do for properly entering System On low power mode?

I'm using nRF Connect SDK version 1.9.1

BR

Parents
  • I'll share some results, for just in case they're useful for anyone else.

    There's nothing to do for entering low power, system on, in zephyr. Only thing is to put all threads to sleep and zephyr will do the rest. Trying to enter low power using the combination { __WFE(); __SEV(); __WFE(); } will not work as the CPU will be constantly taken out of low power by events which are controlled by zephyr.

    For going to low power, wake-up periodically, then go to low power again, a simple loop in main() does the trick.

        while (true)
    	{
    		k_sleep(K_SECONDS(1));
    
    		// Do some stuff every one second
    		// ... 
    	}

    Here is a current consumption frame captured with a PPK-II corresponding to the moment an advertisement is sent. Average current seems to be large, but it is due to averaging only 17ms. It goes down to 23.7uA when averaging for a 2min period.

    This far, my question "How do I do for properly entering System On low power mode?" is solved, by I still have others.

    In the call to bt_le_adv_start(), I specify params as: BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, BT_GAP_ADV_SLOW_INT_MIN, BT_GAP_ADV_SLOW_INT_MAX, NULL).

    How do I configure for advertising periods longer than 1 second?

    How do I do for properly shutting down advertising and updating the advertisement data?

    Thanks in advance.

    BR

  • Hello,

    For configuring the advertising period you can actually make use of the periodic advertising function where you can set the parameters in the function bt_le_ext_adv_set_param(). You can refer the sample program in Connect SDK folder  ncs\v1.9.1\zephyr\samples\bluetooth\periodic_adv.

    And for shutting down the advertising bt_le_adv_stop() works.

     Please see our optimizing power on nRf52 page.

    Kind Regards,

    Abhijith

  • Hello, Menon,

    I've been playing with referenced sample code (periodic_adv), but I don't think it's what I'm looking for, at least not exactly, yet it has been useful for understanding a bit more about this ecosystem.

    AFAIK, extended advertisements are not connectable and, indeed, if I specify option BT_LE_ADV_OPT_CONNECTABLE, bt_le_per_adv_set_param() fails with error code EINVAL. My device is required to allow connections.

    BR

Reply
  • Hello, Menon,

    I've been playing with referenced sample code (periodic_adv), but I don't think it's what I'm looking for, at least not exactly, yet it has been useful for understanding a bit more about this ecosystem.

    AFAIK, extended advertisements are not connectable and, indeed, if I specify option BT_LE_ADV_OPT_CONNECTABLE, bt_le_per_adv_set_param() fails with error code EINVAL. My device is required to allow connections.

    BR

Children
No Data
Related