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

sd_clock_hfclk_request() hard fault

Hi,

my device does some UART communication. Because temperature drift of HFINT is to large, the external HFXO has to be used. To make things worse, this is a low power device and so HFXO should be started only if UART communication takes place.

Idea is to call sd_clock_hfclk_request() on start of communication and sd_clock_hfclk_release() on end of reception of the response.

Unfortunately sd_clock_hfclk_request() throws a hard fault if called within a RTC2 interrupt context, same valid for the release function - which works if called from the UART interrupt context.

Questions:

  1. when and why is this hard fault happening?
  2. how to prevent this?
  3. when is it safe to call the sd_clock_hfclk_*() functions?
  4. how can one determine if the RTC2 interrupt context is active?

Thanks for help / ideas.

Hardy

Related