nRF5340 LFCLK sources control

Hi,

I would like to ask when using zephyr's k_timer it uses a clock from LFCLK, then it can be generated in the following three ways:

32.768 kHz RC oscillator (LFRC)
32.768 kHz crystal oscillator (LFXO)
32.768 kHz synthesized from HFCLK (LFSYNT)

Is the following configuration OK when I need an LFXO?

CONFIG_RTC=y
CONFIG_COUNTER=y
CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y  
CLOCK_CONTROL_NRF_K32SRC_RC=n
Parents
  • Hi,

    The Zephyr timer the system clock driver API to create timeout events with rtc1, same as the scheduler. So, the configurations you listed are enabled by default. You can confirm this by checking the generated configuration file in build/<app project name>/zephyr/.config.

    If you want to test with other clock sources, it is sufficient to enable CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC or CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH and remove the CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y line from your project configuration.

    Best regards,

    Vidar

Reply
  • Hi,

    The Zephyr timer the system clock driver API to create timeout events with rtc1, same as the scheduler. So, the configurations you listed are enabled by default. You can confirm this by checking the generated configuration file in build/<app project name>/zephyr/.config.

    If you want to test with other clock sources, it is sufficient to enable CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC or CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH and remove the CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y line from your project configuration.

    Best regards,

    Vidar

Children
Related