We have designed two custom boards based on the nRF52840.
Board #1 (Demo board)
This board works correctly. It uses a standard 32.768 kHz passive crystal connected to XL1/XL2.
Board #2 (EV board)
This board does not boot reliably. The main hardware difference is the LFCLK source:
instead of a 32.768 kHz crystal, we feed a full-swing 32.768 kHz square wave generated by an external RTC IC into XL1, while XL2 is tied to GND.
Other differences between the boards are only peripherals and should not affect clocking.
Observed behavior
When we flash the same firmware (from the working demo board) into the EV board:
-
The system does not boot immediately
-
The 32 MHz crystal (HFXO) attempts to start several times
-
We can observe short bursts of 32 MHz oscillation on a scope
-
Each attempt stops again
-
After roughly ~10–25 seconds, the system finally starts and then works normally
Zephyr configuration (external 32 kHz square wave)
We attempted to configure Zephyr to use an external full-swing clock:
CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_EXT_FULL_SWING=y
We tried several combinations of LFCLK configurations but the behavior remained the same.
Questions:
-
For a rail-to-rail 32.768 kHz clock applied to XL1, what is the correct Zephyr/NCS configuration?
-
Is it necessary to manually start the HFXO in this case?
-
Is feeding a square wave into XL1 (with XL2 grounded) a supported and recommended hardware configuration for BLE applications?
Using internal RC instead
We then removed the external clock and configured LFCLK to internal RC:
CONFIG_CLOCK_CONTROL=y
CONFIG_CLOCK_CONTROL_NRF=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32RC_RC_CALIBRATION=y
With this configuration:
-
The firmware runs correctly
-
BLE works
-
All peripherals function
However, the system boot is very slow (~4 seconds before BLE advertising appears).
Question:
Why does boot time become so long when using the internal RC oscillator?
We are trying to determine whether:
-
the external square-wave LFCLK hardware approach is valid, or
-
a passive 32.768 kHz crystal is strictly required for reliable BLE startup.
Any guidance would be greatly appreciated.
Jack