Skip to content

SX126x AGC reset: wait for calibration before re-writing registers - #3749

Open
AlexandrTyshchenko wants to merge 1 commit into
meshcore-dev:devfrom
AlexandrTyshchenko:fix/sx126x-agc-reset-calibration-wait
Open

AlexandrTyshchenko wants to merge 1 commit into
meshcore-dev:devfrom
AlexandrTyshchenko:fix/sx126x-agc-reset-calibration-wait

Conversation

@AlexandrTyshchenko

Copy link
Copy Markdown

What

sx126xResetAGC() re-applies DIO2 / RX boosted gain / the 0x8B5 patch right after calibrateImage(). This adds a 50 ms settle after calibrateImage(), and skips the register writes when Calibrate(0x7F) is still busy after the existing 50 ms poll (the next reset retries).

Why

The chip keeps running the image calibration after the command returns and does not hold BUSY for it, so a register write in that window can fail and leave the radio deaf until reboot. Meshtastic measured and fixed the same sequence in meshtastic/firmware#11774 (no settle: 9 of 13 writes failed; 50 ms: 0 failures in 3,085 resets over 16 h).

Testing

  • Compile: RAK_4631_repeater.
  • Hardware: ProMicro nRF52840 + Ebyte E22P-433M30S (SX1268 + PA/LNA), 433.65 MHz / BW 62.5 / SF8, agc.reset.interval 4 for 10 min (~150 resets): RX and TX kept working, no stalls. I have not reproduced the original failure myself; the failure data is from the Meshtastic PR above.

sx126xResetAGC() re-applies DIO2/RX boosted gain/0x8B5 right after
calibrateImage(). The chip keeps calibrating after that command returns and
does not hold BUSY for it, so a register write in that window can fail and
leave the radio deaf until reboot (measured in meshtastic/firmware#11774:
9 of 13 writes failed with no settle, 0 of 3085 resets with 50 ms).

- wait 50 ms after calibrateImage(), as Meshtastic does since #11774
- if Calibrate(0x7F) is still busy after the 50 ms poll, skip the register
  writes; the next reset retries

This branch has not been deployed

No deployments
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.

1 participant