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

NRF52 enters WFE deadlock depending on power source!? Maybe a softdevice power management issue?

I am programming a BL652 module (contains an nRF52832 with populated DC/DC inductors). I am programming it through the nRF52 DK in SEGGER studio.

When I run the blank (no softdevice) peripheral/gpiote example, everything works fine, independently of the chosen power supply.

However, the weirdest issue appears with the ble_app_beacon project (and other ble projects).

When I program the module and leave it connected (GND, SWDIO, SWDCLK, VDD+VTG are all connected to the module) everything works fine.

However, when I use an external power supply (GND, SWDIO, SWDCLK are still connected to the module, and VDD+VTG are bridged together but not connected to the module), the module enters an infinite loop. The debugger reports that it loops infinitely in these four instructions (but it does not give the corresponding source code):

I double checked that the external power source is not compromised. The issue happens on a 3.3v regulator, it happens on a 2.88v bench supply, and on a couple other supplies. But it works if powered directly from the nRF52 DK board!? How is it possible that it notices that it is powered from the DK board and not the 2.88v bench supply, when it gets the very same voltage!?
Could it be some weird issue with how the nr52 DK ramps up its VCC? Are there any softdevice settings I can look into, to see whether it is related to power management? Generally, what could cause such an infinite loop?

P.S. I dug through the call stack to see where exactly this happens. The call stack looks like this:

main() -> ble_stack_init() -> nrf_sdh_enable_request()

Inside that last function there are these lines:

CRITICAL_REGION_ENTER();
#ifdef ANT_LICENSE_KEY // THIS IS NOT EVALUATED
    ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler, ANT_LICENSE_KEY);
#else // THIS IS EVALUATED
    ret_code = sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler);
#endif
    m_nrf_sdh_enabled = (ret_code == NRF_SUCCESS);
CRITICAL_REGION_EXIT();

CRITICAL_REGION_EXIT() is never reached.

sd_softdevice_enable() calls SVCALL(SD_SOFTDEVICE_ENABLE, ...), however at that point it stops providing source code break points.

Parents
  • HI Krastanov, 

    when the application code is hanging at sd_softdevice_enable(), then its usually due to the wrong LF clock source being configured. It appears that the BL652 does not have a 32kHz crystal so I could be that the SoftDevice is waiting for the LF clock to start up. Could you post the clock_lf_cfg configuration you're using?

    Best regards

    Bjørn

  • Hello, Bjorn,

    This was indeed the source of the issue. I was using the defaults for the Nordic dev board config, not anything modified for the BL652.

    Originally it was

    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    #define NRF_SDH_CLOCK_LF_SRC 1

    The only change I made after your suggestion was

    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    #define NRF_SDH_CLOCK_LF_SRC 0
    
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16

    This still does not really explain why it was working fine with a certain power source and not working with all the other power sources, but it does not really matter - I should not have expected it to work at all.

    Thanks for the help!

Reply
  • Hello, Bjorn,

    This was indeed the source of the issue. I was using the defaults for the Nordic dev board config, not anything modified for the BL652.

    Originally it was

    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    #define NRF_SDH_CLOCK_LF_SRC 1

    The only change I made after your suggestion was

    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    #define NRF_SDH_CLOCK_LF_SRC 0
    
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16

    This still does not really explain why it was working fine with a certain power source and not working with all the other power sources, but it does not really matter - I should not have expected it to work at all.

    Thanks for the help!

Children
No Data
Related