nRF5340 clock sources

Hello !

It is not so clear default clock sources on nRF5340 app and net cores.

1.

As zephyr clock sources, SYSTICK timers are in use in both cores and timer clocking from external 32kHz XTAL oscillator.

Is this so ?

Should I specify  CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y in prj.conf this line and for what core ?

2. RTCx timers is not used by default.

if I need to use those ( RTC0 on app core, RTC1 on net core), I should specify CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=y on both core's configuration ?

3. App core CPU clock is 128Mhz by default.

How to be sure if it clocked from XTAL oscillator ?

How to change clock to 64Mhz ?

4. Net core CPU clock is 64 Mhz by default.

How I be sure if it clocked from crystal oscillator ?

I can see clock_init() what use

clk_mgr = z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);
Should I use this code for app core as well or only on net core ?
On net core I use NRF_TIMER2 and RADIO and they need to be clocked form HF XTAL.
Regards,
Eugene

Parents
  • Hi,

    It's best to specify for each core what clock source they should run at. 

    The RTC is not a viable clock source for the Low Frequency Controller. 

    The documentation states:

    Each core has a number of low frequency clock (LFCLK) control instances. Each instance distributes one or more clocks to the core.

    The LFCLK control instance in each core distributes the 32.768 kHz PCLK32KI peripheral clock to its corresponding core. The LFCLK clock is sourced from the power and clock subsystem to each LFCLK control instance.

    In order to generate the LFCLK clock, the LFCLK controller uses the following LFCLK sources:
    32.768 kHz RC oscillator (LFRC)
    32.768 kHz crystal oscillator (LFXO)
    32.768 kHz synthesized from HFCLK (LFSYNT)

    The RTC will run off the LFCLK.

    When started, the RTC will automatically request the LFCLK source with RC oscillator if the LFCLK is not already running.

    You can check what clock source the LFCLK is running at by checking the LFCLKSTAT register.

    regards

    Jared 

  • Hi Jared !

    But what about HFLK XTAL. Should I do some enabling of it ?

    Some radio samples requiest it by _nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);

    other not.

    Regards,

    Eugene

Reply Children
Related