Skip to content

nRF52 BLE: wait for LFXO crystal before enabling SoftDevice (fixes t1000e hanging at reboot)#1939

Open
weebl2000 wants to merge 2 commits into
meshcore-dev:devfrom
weebl2000:wait-for-crystal-t1000e
Open

nRF52 BLE: wait for LFXO crystal before enabling SoftDevice (fixes t1000e hanging at reboot)#1939
weebl2000 wants to merge 2 commits into
meshcore-dev:devfrom
weebl2000:wait-for-crystal-t1000e

Conversation

@weebl2000
Copy link
Copy Markdown
Contributor

@weebl2000 weebl2000 commented Mar 6, 2026

The Adafruit framework starts the LFXO in init() but never waits for EVENTS_LFCLKSTARTED. On first boot the filesystem format (~600ms of page erases) gives the crystal time to stabilize. On subsequent boots only quick mounts happen, so sd_softdevice_enable() inside Bluefruit.begin() can be called while the crystal is still starting, which hangs indefinitely.

Poll EVENTS_LFCLKSTARTED before Bluefruit.begin() so the wait is exact rather than a blind delay.

fixes: #1780

Please try the firmware for yourself by building here.

@weebl2000 weebl2000 changed the title nRF52 BLE: wait for LFXO crystal before enabling SoftDevice nRF52 BLE: wait for LFXO crystal before enabling SoftDevice (fixes t1000e hanging at reboot) Mar 6, 2026
@weebl2000 weebl2000 force-pushed the wait-for-crystal-t1000e branch from e715a4b to 1566558 Compare March 23, 2026 13:27
@MarijnDoeve
Copy link
Copy Markdown

MarijnDoeve commented Mar 31, 2026

Hi, I have a T1000-E that never boots while running MeshCore firmware. Do you think that problem is related to this issue?
Does not seem to be the case. Created issue #2211

@weebl2000 weebl2000 force-pushed the wait-for-crystal-t1000e branch from 1566558 to fd335c6 Compare April 4, 2026 11:18
weebl2000 added 2 commits May 26, 2026 11:51
The Adafruit framework starts the LFXO in init() but never waits for
EVENTS_LFCLKSTARTED. On first boot the filesystem format (~600ms of page
erases) gives the crystal time to stabilize. On subsequent boots only
quick mounts happen, so sd_softdevice_enable() inside Bluefruit.begin()
can be called while the crystal is still starting, which hangs
indefinitely.

Poll EVENTS_LFCLKSTARTED before Bluefruit.begin() so the wait is exact
rather than a blind delay.

fixes: meshcore-dev#1780
@weebl2000 weebl2000 force-pushed the wait-for-crystal-t1000e branch from fd335c6 to 66fc815 Compare May 26, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants