-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
On the nrf51 the function os_tick_init
in us_ticker.c
initializes the low frequency clock to use a 32 KHz crystal and waits for it to stabilize. If this crystal is not present the the device will hang forever waiting for stabilization. One board which exhibits this problem is the micro:bit
.
To support all boards there needs to be some mechanism to select the internal RC oscillator if no external crystal is present.
As a test, selecting the internal RC oscillator allows the micro:bit
to boot and run.
Before:
int os_tick_init (void)
{
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
...
With:
int os_tick_init (void)
{
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
...