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

    Yes, but are you using proprietary protocols, is it based on our drivers or are you doing it bare metal?

    If you're using our drivers then it's usually taken care of but you need to specify what you're doing with the radio. 

    For example, are you using the Softdevice Controller?

    Starting the HFXO is a prerequisite for using the radio, it will not work with any other clock source. 

    regards

    Jared 

  • Hi Jared !

    I'm not using Sofdevice. Net core have one IPC channel with app core ( Like in sample). And after that own radio, timer2 and DPPI channels. nrf and nfrx API and direct access to registers in use.

    What is right way for wakeup HFXO  ?

    Regards,

    Eugene

  • Hi Eugene

    Jared is currently out of office, and I will help you out in the mean time. 

    As it happens the proprietary ESB protocol also require you to start the HFXO manually, and you can see how the samples do it here

    If you are doing something proprietary I would recommend having a look at the ESB protocol, as it handles a lot of the low level radio management for you. 

    Best regards
    Torbjørn 

  • Hi Torbjørn  !

    I have printed few registers on netcore :

    [00:00:00.007,049] <inf> xxx: NRF_CLOCK->HFCLKSRC : 0x00000001
    [00:00:00.007,049] <inf> xxx: NRF_CLOCK->HFCLKSTAT : 0x00010001
    [00:00:00.007,080] <inf> xxx: NRF_CLOCK->LFCLKSRC : 0x00000002
    [00:00:00.007,080] <inf> xxx: NRF_CLOCK->LFCLKSTAT : 0x00010002

    Looks like both oscillators start properly,

    Do you have idea if any extra clocks need to be enabled in case of DPP usage ?

    They dosn't work in way like in your radio drivers and may be Zephyr or others have enabled extra configurations ?

    Regards,

    Eugene

     

  • Hi Eugene

    Hiihtaja said:
    Do you have idea if any extra clocks need to be enabled in case of DPP usage ?

    I assume you mean DPPI?

    The DPPI controller will request a high frequency clock source whenever it needs to send a signal from one peripheral to another. 

    The DPPI does not need to use external crystal for the HF clock. If the HFXO is running it will use it, otherwise it will simply use the internal RC oscillator (which starts up much quicker). 

    Are you having problems getting your DPPI channels to work?

    Best regards
    Torbjørn

Related