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
  • Hi,

    Is there a known issue with the startup of the LF clock on the nrf5340 app core?

    No.

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

    The Zephyr kernel system clock starts the LF clock for you at PRE_KERNEL_2 level. If you for some reason wants to use internal 32 kHz synthesizer from HFCLK system clock as the LF clock soruce, then set CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y in your prj.conf file

Reply
  • Hi,

    Is there a known issue with the startup of the LF clock on the nrf5340 app core?

    No.

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

    The Zephyr kernel system clock starts the LF clock for you at PRE_KERNEL_2 level. If you for some reason wants to use internal 32 kHz synthesizer from HFCLK system clock as the LF clock soruce, then set CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y in your prj.conf file

Children
Related