Skip to content

NRF51 boards without 32K crystal fails to boot #2132

@c1728p9

Description

@c1728p9

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);
...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions