Repository navigation
SX126x AGC reset: wait for calibration before re-writing registers - #3749
Open
AlexandrTyshchenko wants to merge 1 commit into
Open
AlexandrTyshchenko wants to merge 1 commit into
AlexandrTyshchenko wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sx126xResetAGC()re-applies DIO2 / RX boosted gain / the 0x8B5 patch right aftercalibrateImage(). This adds a 50 ms settle aftercalibrateImage(), and skips the register writes whenCalibrate(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
RAK_4631_repeater.agc.reset.interval 4for 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.