Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Detect whether HFXO or HFINT is clocking the HFCLK Controller?

nRF52840, SDK 16.0.0, SD132v7.0.1

What's the correct way to tell whether HFXO or HFINT is clocking the HFCLK controller? I'm able to start and stop the HFCLK controller, but how do I find out whether the crystal or internal oscillator is clocking it?

Thanks,

Charles

Parents
  • Thanks for the quick response. Just to be very explicit here, so I understand, it looks like there's a discrepancy between the data sheet and the function name there, right?

    HFCLK is described in the nRF52840 datasheet as a controller that can be clocked either by HFXO or HFINT. I see in https://devzone.nordicsemi.com/f/nordic-q-a/55424/hfclk-hfxo-failure-detection that it's not possible to query the case where HFXO has failed (detached during a drop event or something).

    We're performing reliability and system tests and I have a request from that team to detect whether the HFXO is still physically attached and operating.

    sd_clock_hfclk_is_running() claims to tell me if the HFXO is running, despite the name describing HFCLK. SoftDevice appears to only function against HFXO, so the system seems to assume that if SoftDevice is running, HFCLK must be powered by HFXO. The link I posted above indicates that this isn't a correct assumption; SoftDevice does not appear to be capable of understanding that HFXO has failed and that HFINT has taken over as the oscillator source.

    Is there a way to detect whether HFCLK is being clocked by the HFXO or HFINT?

Reply
  • Thanks for the quick response. Just to be very explicit here, so I understand, it looks like there's a discrepancy between the data sheet and the function name there, right?

    HFCLK is described in the nRF52840 datasheet as a controller that can be clocked either by HFXO or HFINT. I see in https://devzone.nordicsemi.com/f/nordic-q-a/55424/hfclk-hfxo-failure-detection that it's not possible to query the case where HFXO has failed (detached during a drop event or something).

    We're performing reliability and system tests and I have a request from that team to detect whether the HFXO is still physically attached and operating.

    sd_clock_hfclk_is_running() claims to tell me if the HFXO is running, despite the name describing HFCLK. SoftDevice appears to only function against HFXO, so the system seems to assume that if SoftDevice is running, HFCLK must be powered by HFXO. The link I posted above indicates that this isn't a correct assumption; SoftDevice does not appear to be capable of understanding that HFXO has failed and that HFINT has taken over as the oscillator source.

    Is there a way to detect whether HFCLK is being clocked by the HFXO or HFINT?

Children
Related