mirror of https://github.com/ARMmbed/mbed-os.git
Add LF clock initialization in startup sequence.
parent
38671de942
commit
10c803ee3b
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue