Skip to content

Commit fefdbeb

Browse files
committed
LFCLK: Add compatibility to wasp-os reloader-factory
1 parent f567e67 commit fefdbeb

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
@@ -312,10 +312,15 @@ int main(void) {
312312
nrf_drv_clock_init();
313313
nrf_drv_clock_lfclk_request(NULL);
314314

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

0 commit comments

Comments
 (0)