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.
This commit is contained in:
github-actions[bot] committed 2026-11-11 14:06:57 -06:00
1 parent f5f6fb47c8
commit de7736f1fe
1 file changed
+15 -4
+15 -4
View File
@@ -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 = {