after setting CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC the 32mhz start working from rc instead from XTAL

Hello

I am using the nrf52833, zephyr version 3.199, sdk 0.14.1. In our board we didn't connect the 32khz oscillator, so I configure the board with:

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
after setting this I can cee that my application (we use radio paripherial that need hfxo) do not work correctly and when I check with oscilloscope the 32mhz xtal there is no clock. 
I try to make same configuration with the nrf-52833-dk and see the same results.
I try configuring directly the clock register to work with the 32mhz xtal. After calling this code I can see that the xtal is back and I can see the 32mhz clock on the pins and the HFCLKSTAT register indicate xtal running. but after continue running the app the clock disappear and the  HFCLKSTAT  state is rc, running.
It seems to me that the zephyr OS try to reconfigure the clock back to RC even if I reconfigure it in the code to XTAL.
When I do not set  CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC to y I do not have this problem and the osc is alway xtal and I can see the signal on the xtal pin
 
Is there any dependency that when I set 32k to rc source it also set the 32m to rc mode?
Thanks
Ilan
Parents Reply Children
  • Hi

    I am using connect sdk v2.1.2 (I had noted wrong version number on the previous post)

    I change my setting in prj.conf from:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    to:
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    and it solve my problem now I can see that the clock is running correctly and radio peripheral works and I am able to receive packets also on the costume board.
    I am new to zephyr and I feel like there are some lack of documentation that explain with example how to work with it. every time I have some problem I have to look on forums and find some configuration that is missing, I didn't find any documentation beside doxigen like documentation. Is there a document from Nordic that include all those configuration with example when and why to use them? It will make the developer life much more easy
  • Hi,

    Unfortunately, such a guide as you asked for is not available. I too agree that the documentation still have much room for improvement. I appreciate your feedbacks on the matter and will inform our teams of it.

    The fact that you need to use the synthesized clock source instead of the internal RC oscillator is still an issue. It is great that you could use it now instead. I will still put a note with our internal team next week to investigate this.

  • Hi Ilan,

    Sorry for the late follow up. I would like to double check a point:

    Is the HF clock source HFINT/not use HFXO even when the radio is active? 

    When the radio is not active, the clock source can be automatically reconfigured to HFINT to save power. However, it should be automatically reconfigured to HFXO when the radio is active again.

  • Hi Hieu,

    In my code the radio is activated(ble scan) but not using the nrf connect driver but by accessing directly the radio registers (the nrf connect ble do not support the operation I need from the radio). I also configure the clock register directly. 

  • Hi Ilan,

    The clock source should not be configured by writing to the register directly. The clock controller would not know that you still need HFXO, and when everything else that needs HFXO no longer needs it, the clock controller will switch back to HFINT.

    Would the issue still happen if you request the clock in this way, referring the ESB sample?

    https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/samples/esb/ptx/src/main.c#L71-L102

Related