nrf5340 Low Frequency Timer (RTC)

Hi,

Is there a known issue with the startup of the LF clock on the nrf5340 app core? I have scanned the nrf5340 errata but do not see anything of note.

I have this code snippet in the Bluetooth stack from our stack vendor:

  /* FIXME workaround for LF OSC startup. */
  nrf_clock_lf_src_set(NRF_CLOCK, NRF_CLOCK_LFCLK_Synth);
  nrfx_clock_lfclk_start();
  while (!nrfx_clock_lfclk_is_running());

With the above code, I was still getting occasional LF clock start up problems so I changed it to:

  /* LFCLKSRC external crystal pin configuration. */
  NRF_P0->PIN_CNF[0] = GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;
  NRF_P0->PIN_CNF[1] = GPIO_PIN_CNF_MCUSEL_Peripheral << GPIO_PIN_CNF_MCUSEL_Pos;

  ...
  
  nrf_clock_lf_src_set(NRF_CLOCK, NRF_CLOCK_LFCLK_Xtal);
  nrfx_clock_lfclk_start();
  while (!nrfx_clock_lfclk_is_running());

Unfortunately, this still has problems with the clock startup.

Do you have any insights in how to start the LF clock cleanly?

Regards,

AC

Parents Reply Children
No Data
Related