diff --git a/src/helpers/nrf52/SerialBLEInterface.cpp b/src/helpers/nrf52/SerialBLEInterface.cpp index 4de1d40a4..28f91261b 100644 --- a/src/helpers/nrf52/SerialBLEInterface.cpp +++ b/src/helpers/nrf52/SerialBLEInterface.cpp @@ -134,9 +134,18 @@ void SerialBLEInterface::begin(const char* prefix, char* name, uint32_t pin_code // On fast boots (filesystem already formatted), Bluefruit.begin() can // be called before the crystal is stable, hanging sd_softdevice_enable(). // See: https://github.com/meshcore-dev/MeshCore/issues/1780 - while (!NRF_CLOCK->EVENTS_LFCLKSTARTED) { - delay(1); +#ifdef USE_LFXO + { + uint32_t lfclk_start = millis(); + while (!NRF_CLOCK->EVENTS_LFCLKSTARTED) { + if (millis() - lfclk_start >= 2000) { + Serial.println("WARNING: LFXO crystal did not start within 2s — check 32.768kHz crystal"); + break; + } + delay(1); + } } +#endif // If we want to control BLE LED ourselves, uncomment this: // Bluefruit.autoConnLed(false);