Add LF clock initialization in startup sequence.

pull/2234/head
Vincent Coubard 2016-06-17 11:19:05 +01:00
parent 38671de942
commit 10c803ee3b
2 changed files with 17 additions and 0 deletions

View File

@ -94,6 +94,14 @@ void SystemInit(void)
}
*(uint32_t volatile *)0x4006EC14 = 0xC0;
}
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {
// wait for the low frequency clock start
}
}

View File

@ -187,6 +187,15 @@ void SystemInit(void)
#endif
SystemCoreClockUpdate();
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
NRF_CLOCK->TASKS_LFCLKSTART = 1;
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {
// wait for the low frequency clock start
}
}