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.