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

SoftDevice in Low Power device

Hello,

I use the LAIRD module BL652 with an nRF52832 with the SoftDevice 14.0.0 (old version…).

The application use the BLE with the SoftDevice.

We have mesured the device consumption and we arrive to the value of 0.6 mA.

The application do each second some treatment (very little) and go into the low power mode with the command "sd_power_mode_set(NRF_POWER_MODE_LOWPWR);". So, it work fine.

But when we see the current of the device, we see that the BL652 wake up sometime but not with the 1 second timer.

I means that the softDevice generate this wake up ?! (because the application do Nothing so the SoftDevice do this).

Question : Into the configuration file (sdk_config.h), it exist a part or parameters to changes the wake-up time of the softDevice ??

(we have increase the advertising at 1.5 seconds, all timers are cut off, the ADC is used but the application start the ADC to do the measument, the PWM is cut off, the RTC is cut off too)

If you can help me to decrease the current consumption of the device, it will be great.

Thank you,

Best regards,

Damien ALTMANN

  • Hi,

    We have mesured the device consumption and we arrive to the value of 0.6 mA.

    A current consumption in this order indicate that the HF clock is running. This is typically because a peripheral that use the HF clock has not been disabled, or you are seeing erratum 89.

    The application do each second some treatment (very little) and go into the low power mode with the command "sd_power_mode_set(NRF_POWER_MODE_LOWPWR);". So, it work fine.

    There is no need to call sd_power_mode_set() to set NRF_POWER_MODE_LOWPWR, as this is the default configuration.

    Question : Into the configuration file (sdk_config.h), it exist a part or parameters to changes the wake-up time of the softDevice ??

     The SoftDevice will only wake up on these occasions:

    • Processing needed due to BLE events
    • Regular calibration of the LFRC clock (if not using 32 kHz crystal). The calibration interval depends on the configuration of NRF_SDH_CLOCK_LF_RC_CTIV in sdk_config.h.
    If you can help me to decrease the current consumption of the device, it will be great.

    You should generally disable all peripherals that use the HF clock, and any other peripherals you don't need. However, an internal RTC instance has a negligible current consumption of 0.1 μA, since the 32 kHz clock is anyway running (as well as RTC0) because it is needed for SoftDevice timing, so there is no need to stop that. Then just call sd_app_evt_wait() in the main loop, either directly, or via nrf_pwr_mgmt_run().

  • Hi,

    Thank you for the response.

    a) Perhaps that exist a some running peripheral because we use the ADC, the PWM, the GPIO....but during a low power mode, this peripheral not switch off ??

    b) Yes, in end of main loop, I call the "sd_power_mode_set" function + "nrf_pwr_mgmt_run" to enter in low power mode.

    c) Into the sdk_config.h, I put the value 16 into the "NRF_SDH_CLOCK_LF_RC_CTIV". So, I hope that the softDevice do the good crystal calibration.

    I have the "#define NRF_SDH_CLOCK_LF_SRC 1" to execute the external Crystal.

    I have the "#define CLOCK_CONFIG_LF_SRC 1" too.

    Is it better to use the RC internal oscillator for the SoftDevice ?? and the peripheral ??

    d) For exemple, to cut off the PWM peripheral when I not use, I call the function "pwm_uinit();".

    Is it a good function ?? or I shall be cut the PWM clock too ??

    Thank you,

    Best regards,

    Damien ALTMANN

  • Hi,

    d.altmann said:
    a) Perhaps that exist a some running peripheral because we use the ADC, the PWM, the GPIO....but during a low power mode, this peripheral not switch off ??

    The peripherals are not automatically turned off when you enter system off low power mode. That only makes the CPU sleep, but you are responsible for disabling any other peripherals. If any peripheral that need the HF clock is active, then you should expect a current consumption in the order of 0.5 mA.

    d.altmann said:
    b) Yes, in end of main loop, I call the "sd_power_mode_set" function + "nrf_pwr_mgmt_run" to enter in low power mode.

    That's good. All you need i to call nrf_pwr_mgmt_run() in the end of your main loop. You can skip the call to sd_power_mode_set() though, as it does not have any use here (as described in my previous reply).

    d.altmann said:
    c) Into the sdk_config.h, I put the value 16 into the "NRF_SDH_CLOCK_LF_RC_CTIV". So, I hope that the softDevice do the good crystal calibration.

    There is no calibration when you have set NRF_SDH_CLOCK_LF_SRC to 1, as that specifies that you will use the 32.768 kHz crystal as reference (which does not need calibration). Calibration is automatically handled by the SoftDevice when you select RC oscillator by setting NRF_SDH_CLOCK_LF_SRC to 0.

    d.altmann said:
    Is it better to use the RC internal oscillator for the SoftDevice ?? and the peripheral ??

    If you have a crystal on board, you should use that as it leads to a reduced average current consumption, particularly when you are in a BLE connection. This is not related to the 0.6 mA current consumption you see though, as the LFCLK has a far lower current consumption regardless of using RC or xtal.

    d.altmann said:
    d) For exemple, to cut off the PWM peripheral when I not use, I call the function "pwm_uinit();".

    Yes, that is correct. You should call the _uninit() function for any peripherals you do not need running during sleep, and definitely any peripheral that use the HF clock (which is most of them).

    If you still have problems after making sure you disable peripherals before going to sleep, I suggest you comment out parts of your code so that you don't use any peripherals and measure current. Then add things back until you get the high sleep current. Once you know what causes the high sleep current you can move on to fixing it, which is then usually not a big problem. (Sometimes you need to dos something similar to the workarounds for erratum 89, which can also affect other peripherals than what is currently documented).

  • Hi,

    Thank you for your helps.

    I have now a very low power product (after many test).

    I fact, I have many part with "high" current.

    a) I have put the pin 27 in input with "nrf_gpio_cfg_input(27, NRF_GPIO_PIN_NOPULL);" and this function make a high current so I disable it (I not use this pin now…)

    b) When I configure the ADC, I use an example with PPI and Timer with "nrf_drv_timer_init" and this timer consume a lot. So I disable this timer and use another timer which works fine.

    At final, the product have a 100/200 µA of current so it's very nice for us.

    Thank you for your helps.

    Best regards,

    Damien ALTMANN

  • Hi,

    I am glad to hear you got the current consumption down.

    d.altmann said:
    a) I have put the pin 27 in input with "nrf_gpio_cfg_input(27, NRF_GPIO_PIN_NOPULL);" and this function make a high current so I disable it (I not use this pin now…)

    There should not be anything special with pin 27 (other than that it is close t the radio). However, if you use a input pin without a pull resistor you must make sure that the external circuitry prevents the pin from floating. If the external circuitry does not always cause a pin voltage within the logic 0 or logic 1 levels, you should use a pull resistor to prevent the pin from floating. A floating pin can result in undefined behavior and high current consumption.

    d.altmann said:
    b) When I configure the ADC, I use an example with PPI and Timer with "nrf_drv_timer_init" and this timer consume a lot. So I disable this timer and use another timer which works fine.

     It is difficult to say what this other timer is, but if it is an RTC that makes sense. In that case, that is the same as what you get if you use the SAADC driver in low power mode (set low_power_mode in the nrfx_saadc_config_t instance passed to nrfx_saadc_init()).

Related