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

nRF52840 power questions: DC/DC converter and powering down the system

I've got a couple of puzzles relating to a 52840 design that evolved from an 52832 design, belonging to a customer. 

1) following the suggestions at https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/optimizing-power-on-nrf52-designs #1, I verified that the DC/DC converter is populated as suggested in the datasheet.  I then went into the sdk_config.h file and turned on NRFX_POWER_ENABLED, NRF_POWER_CONFIG_DEFAULT_DCDCEN, and left NRF_POWER_DEFAULT_DCDENHV turned off. Quiescent power (with no BLE communications) went up from 1.2mA to 1.9mA. This seems counterintuitive - are there additional configuration options that we should be paying attention to if we turn on NRFX_POWER? Or is this actually the correct way to enable the DC/DC converter?

2) after calling sd_power_system_off() we still see 1mA of power usage, with the peripherals around the chip being identical to those used with the 52832, where calling that same function drops the usage down to about 20uA.  After reading somewhere that EASY_DMA might prevent sleep, we explicitly turn off the UART with 

NRF_UART0->ENABLE = (0 << UART_ENABLE_ENABLE_Pos);

and turn off the SPI with 

nrf_drv_spi_uninit(&spi);

but these don't seem to help. What else might be holding the power high at this point?

Thanks!

Pierre

Parents
  • Hi

    Thank you for your feedback. There are indeed some SoftDevice specific functions like sd_power_dcdc_mode_set() and sd_power_system_off() for instance. The DCDC behavior you're explaining seems very strange to me, as it definitely shouldn't be higher with the DCDC enabled. What kind of radio activity is your application doing, BLE advertising?

    2. Can you provide a snippet of code showing how exactly you disable your peripherals and put your device to sleep? I would suggest using the Power Profiling application example in our SDK for reference on how to put your application into system OFF mode.

  • We are doing basic advertising and not much else at that stage.  However, due to your suggestion, I started looking at the power profiling example, and it is clear that none of the nrf_pwr_mgmt  functions are currently in the project, so I'm going to start experimenting with them. 

    Can I ask you to please explain which of the following would be more correct (or do we not need both?):

    nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF);
    sd_power_system_off();

    or:

    sd_power_system_off();
    nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF);

    Thanks!

  • So it turns out things are not that simple.  Calling:

        ret_code_t err_code = 0;
    err_code = nrf_pwr_mgmt_init();
    APP_ERROR_CHECK(err_code);

    reliably fails and quickly reboots from the APP_ERROR_CHECK:

    00> <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at :0
    00> PC at: 0x00000000

    The docs at https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__pwr__mgmt.html suggest: "

    Warning
    Depending on configuration, this function sets SEVONPEND in System Control Block (SCB). This operation is unsafe with the SoftDevice from interrupt priority higher than SVC."

    without giving much of a hint how to deal with the issue.  So the question remains: can power management library be used with S140 device, and if so, what do we need to do to allow that?  For a bit of background, we did migrate this project from what was originally SDK12.2, so the various interrupt priority levels are set to 7, while in the example's config.sdk, many (most?) appear to have been raised to 6.  The docs unfortunately don't give enough info to know which priority level might be the problem.

    Thanks!

Reply
  • So it turns out things are not that simple.  Calling:

        ret_code_t err_code = 0;
    err_code = nrf_pwr_mgmt_init();
    APP_ERROR_CHECK(err_code);

    reliably fails and quickly reboots from the APP_ERROR_CHECK:

    00> <error> app: ERROR 8 [NRF_ERROR_INVALID_STATE] at :0
    00> PC at: 0x00000000

    The docs at https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__pwr__mgmt.html suggest: "

    Warning
    Depending on configuration, this function sets SEVONPEND in System Control Block (SCB). This operation is unsafe with the SoftDevice from interrupt priority higher than SVC."

    without giving much of a hint how to deal with the issue.  So the question remains: can power management library be used with S140 device, and if so, what do we need to do to allow that?  For a bit of background, we did migrate this project from what was originally SDK12.2, so the various interrupt priority levels are set to 7, while in the example's config.sdk, many (most?) appear to have been raised to 6.  The docs unfortunately don't give enough info to know which priority level might be the problem.

    Thanks!

Children
No Data
Related