From de7736f1fe0e1455c43fb2dd288117747246b221 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:06:57 -0600 Subject: [PATCH] fix: get the LR1110 receive duty cycle working On the T1000-E the RXPS arm reported armed but every SPI command after that timed out on BUSY, the node could not transmit at all and reception degraded to luck; only 'set radio.rxps off' recovered the radio, and it only after the retries landed in a sleep gap. Three defects, all in the LF clock handling around SetRxDutyCycle: - restoreLfClock() switched the chip to LF XOSC, which never starts on this board (GetErrors shows LF_XOSC_START_ERR), so every fallback path through it died on the BUSY wait. Keep LF RC, like EasySkyMesh's RXPS: Keep LF RC for LR1110 fix. - The arm configured LF_BUSY_RELEASE_ENABLED, which tells the radio to wait for the 32k crystal before releasing BUSY; the crystal never starts, so BUSY stayed high forever and SetRxDutyCycle timed out. Use LF_BUSY_RELEASE_DISABLED. - Clear pending errors before the arm, mirroring RadioLib's GNSS sequence, which clears errors around the LF clock configuration for the same reason. Measured on the T1000-E: arms stay armed (err=0, fail=0), repeater transmits and receives with the duty cycle running, 'set radio.rxps off' disarms cleanly. --- src/helpers/radiolib/CustomLR1110.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/helpers/radiolib/CustomLR1110.h b/src/helpers/radiolib/CustomLR1110.h index 4426d56a..b8e08406 100644 --- a/src/helpers/radiolib/CustomLR1110.h +++ b/src/helpers/radiolib/CustomLR1110.h @@ -61,12 +61,14 @@ class CustomLR1110 : public LR1110 { uint32_t getTcxoDelay() const { return tcxoDelay; } // Restores the LF clock configuration RadioLib's begin() installs. Arming - // the duty cycle switches it to RC + BUSY-release (required by Semtech for + // the duty cycle switches it to RC (required by Semtech for // SetRxDutyCycle); without this the change would outlive RXPS being turned // off, and it also alters what the BUSY pin means to isChipBusy(). + // Keep LF RC: the LF XOSC never starts on this board (LF_XOSC_START_ERR), + // so restoring it wedges every BUSY wait forever. int16_t restoreLfClock() { return configLfClock( - RADIOLIB_LR11X0_LF_BUSY_RELEASE_DISABLED | RADIOLIB_LR11X0_LF_CLK_XOSC); + RADIOLIB_LR11X0_LF_BUSY_RELEASE_DISABLED | RADIOLIB_LR11X0_LF_CLK_RC); } // effectiveRxPeriod reports the RX window actually programmed, which may be @@ -101,8 +103,17 @@ class CustomLR1110 : public LR1110 { int16_t state = standby(RADIOLIB_LR11X0_STANDBY_RC); RADIOLIB_ASSERT(state); - // Semtech requires the RC standby/RTC setup before SetRxDutyCycle. - state = configLfClock(RADIOLIB_LR11X0_LF_CLK_RC | RADIOLIB_LR11X0_LF_BUSY_RELEASE_ENABLED); + // Semtech requires the RC standby/RTC setup before SetRxDutyCycle. BUSY + // release must not wait for the 32k Xtal (LF_BUSY_RELEASE_DISABLED): the + // crystal never starts on the T1000-E (LF_XOSC_START_ERR), and gating + // BUSY on it leaves the chip unreachable after the first arm. + state = configLfClock(RADIOLIB_LR11X0_LF_CLK_RC | RADIOLIB_LR11X0_LF_BUSY_RELEASE_DISABLED); + RADIOLIB_ASSERT(state); + // A pending LF_XOSC_START_ERR (the crystal never started on this board) + // is cleared before the duty cycle arms, mirroring RadioLib's GNSS + // sequence, which clears errors around the LF clock config for the same + // reason. + state = clearErrors(); RADIOLIB_ASSERT(state); RadioModeConfig_t cfg = { .receive = {