Skip to content

Commit 825c7ce

Browse files
committed
LFCLK: Add compatibility to wasp-os reloader-factory
1 parent 6edee1a commit 825c7ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,15 @@ int main(void) {
313313
nrf_drv_clock_init();
314314
nrf_drv_clock_lfclk_request(NULL);
315315

316-
// The RC source for the LF clock has to be calibrated
317-
#if (CLOCK_CONFIG_LF_SRC == NRF_CLOCK_LFCLK_RC)
316+
// When loading the firmware via the Wasp-OS reloader-factory, which uses the used internal LF RC oscillator,
317+
// the LF clock has to be explicitly restarted because InfiniTime uses the external crystal oscillator if available.
318+
// If the clock is not restarted, the Bluetooth timers fail to initialize.
319+
nrfx_clock_lfclk_start();
318320
while (!nrf_clock_lf_is_running()) {
319321
}
322+
323+
// The RC source for the LF clock has to be calibrated
324+
#if (CLOCK_CONFIG_LF_SRC == NRF_CLOCK_LFCLK_RC)
320325
nrf_drv_clock_calibration_start(0, calibrate_lf_clock_rc);
321326
#endif
322327

0 commit comments

Comments
 (0)