Disable SX126X_RX_BOOSTED_GAIN for Heltec v4 #1249
Open
+21
−9
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.
I was experiencing very bad RX with my heltec v4 so I investigated and debugged.
Turns out everything handling the LNA/PA is completely fine, the only problem was the SX1262 boosted gain was enabled. If you disable this the RX is golden. 🥇Actually, the problem was radiolib was trying to manage things.
Summary of Changes
Added detailed comments explaining the GC1109 FEM chip operation:
Added RF switch pin definitions at variants/heltec_v4/platformio.ini:34-35:
-D SX126X_RXEN=RADIOLIB_NC ; No separate RX enable pin
-D SX126X_TXEN=46 ; TX enable pin controls RF switch
How This Fix Works
The root cause was that RadioLib didn't know about the external GC1109 RF switch. Without the SX126X_RXEN/TXEN definitions, RadioLib never called setRfSwitchPins(), so it couldn't automatically manage PA_TX_EN during RX/TX transitions.
Now when you initialize the radio, CustomSX1262.h will automatically call:
radio.setRfSwitchPins(RADIOLIB_NC, 46); // RX=not used, TX=pin 46
This tells RadioLib to: