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

what happens if LFCLKSRC that is selected isn't available (for ex:- goes missing)

On nRF52832,

A1> Out of the Softdevice scope: if we are using RTC and have LFCLKSRC configured to XTAL source and if XTAL source gets turned off for some reason what happens. Does the system automatically switch to LFRC source? any NMI or event generated for software to know/handle?

Also when using s132 Softdevice,

B1> what happens if the softdevice is started with LFCLKSRC missing (Configure LFCLKSRC to XTAL and XTAL is not available)?

B2.> what happens if the XTAL goes missing during run time? is there any interrupt generated?

Is there any documentation available that shows the nRF52832 behavior for above scenarios?

Best Regards

Santosh Athuru

  • Thanks, so there is a WFE based wait (based on your response above) and a CPU loop waiting for LFCLKSTAT SRC.

    The former one comes in based on clock_lf_cfg (nrf_sdh.c) and irrespective of LFCLKSRC it doesn't consume extra current because it is WFE based wait. I didn't see the extra current and I didn't see Softdevice running either here, if XTAL is OFF and clock_lf_cfg.source = 1.

    The latter one, however, puts the CPU in a spin loop which results in extra current draw, if XTAL is not available when LFCLKSRC is set to 1.

    Is my understanding right?

    Best Regards

    Santosh Athuru

  • Is my understanding right?

    Yes. If the SoftDevice is the one starting the LFCLK, it will wait for LFCLKSTARTED with WFE. But if the application itself started the LFCLK with source XTAL, before enabling the SD with source clock_lf_cfg.source=1 (XTAL), the SoftDevice will detect that the application already started the LFCLK, and will then just loop waiting for LFCLKSTAT SRC to change from RC to XTAL.(and this will never happen if XTAL is missing). If you want to avoid this in your application, then you should wait for LFCLKSTARTED(with WFE) in the application before enabling the SoftDevice.

  • Hi Sigrud,

    sounds good. Thanks for the confirmation.

    -Santosh Athuru

Related