nRF5340 with internal load caps for 32M XTAL

Hello,

The target MCU on nRF5340 DK seems to use internal load caps for the high frequency 32MHz XTAL because the board does not have external load caps. 

The nRF5340 specification sheet mentions that the internal caps must be configured before enabling them. 

Does it mean that every sample application configures this on the nRF5340?

When I load the "blinky" example, I see the following in the Output .config

1. In what config file is this configured and what are the default values?

2. What is the default startup clock of the SoC? Since the internal caps for the crystal must be configured first, I imagine the SoC must use another clock source before the external XTAL is enabled. 

Parents Reply Children
  • Hi,

    Using synthesized LFCLK is usefull in some cases (particulrily during testing), but it is not much used in production, because it leads to a high current consumption. It is also not used during our BLE testing, so unless you have a good reason for using it(?) I suggest you do not.

    mm784 said:
    I am assuming the RC oscillators are not stable enough for BT stack to initialize. 

    Thsi sounds strange. Can you elaborate? The BT stack works well with th ecalibrated LFRC, but that is used for keeping track of time (waking up on connection events etc). When the radio is used, the HFXO is started, and when the radio is no longer needed, it iss topped (this could be for instance between BLE connection events or advertising events or similar).

    I am a bit unsure about the background for these quiestions. Are you facing another issue that you are tryign to resolve? Perhaps you can backtrack a bit and explain what you are trying t achieve/fix?

  • Hi Einar,

    Thank you for your detailed response and your explanations. I am not trying to do anything unconventional. To test out the radio, I am running the example from Nordic Bluetooth Fundamental course, specifically "Lesson 2, Exercise 2". In this exercise the device is supposed to start advertising as a Nordic Beacon. I am using the code provided in the solution for this exercise as is - I did not change anything in the source code. But since I don't have an external 32.768kHz XTAL, I added following to prj.conf to enable RC Oscillators and I chose the lowest jitter at 20ppm. 

    #Enable Internal 32kHz RC Oscillator
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_20PPM=y

    #Disable use of 32kHZ XTAL
    CONFIG_SOC_ENABLE_LFXO=n

    #Configure 32MHz Clock
    CONFIG_SOC_HFXO_CAP_INTERNAL=y
    CONFIG_SOC_HFXO_CAP_INT_VALUE_X2=24
    With this build, the beacon does not work and in RTT logs I get the following:
    -----------------------------------------------------------------------
    Then I tried another option of generating the LFCLK, this time by using the HFXO and generating LFCLK from it. I changed my prj.conf to the following
    #Synthesize LF Clock
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y

    #Disable use of 32kHZ XTAL
    CONFIG_SOC_ENABLE_LFXO=n
    #Configure 32MHz Clock
    CONFIG_SOC_HFXO_CAP_INTERNAL=y
    CONFIG_SOC_HFXO_CAP_INT_VALUE_X2=24
    With this build, the beacon works. I see it in the nRF Connect App and RTT logs show the following:
    ----------------------------------------------------------------------
    I do not want to jump to conclusions. My assumption that RC clocks are not stable enough to initialize the BLE stack is not based on empirical data, but rather on the RTT logs "HCI driver open failed" and "Bluetooth init failed".
    Q. Could there be board to board variations that cause this?
    Mikael
Related