From 4575800e4069004cf8fb024517b2b33387bd2e5a Mon Sep 17 00:00:00 2001 From: Socalix <48040807+Socalix@users.noreply.github.com> Date: Wed, 14 Jan 2026 17:52:15 -0600 Subject: [PATCH 1/2] Turn on register 0x8B5 LSB for improved RX, turn off boosted gain --- src/helpers/radiolib/CustomSX1262.h | 8 ++++++++ variants/heltec_v4/platformio.ini | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/helpers/radiolib/CustomSX1262.h b/src/helpers/radiolib/CustomSX1262.h index bfaea7c76..be6812c6f 100644 --- a/src/helpers/radiolib/CustomSX1262.h +++ b/src/helpers/radiolib/CustomSX1262.h @@ -76,6 +76,14 @@ class CustomSX1262 : public SX1262 { setRfSwitchPins(SX126X_RXEN, SX126X_TXEN); #endif + // for improved RX with Heltec v4 + #ifdef SX126X_REGISTER_PATCH + uint8_t r_data = 0; + readRegister(0x8B5, &r_data, 1); + r_data |= 0x01; + writeRegister(0x8B5, &r_data, 1); + #endif + return true; // success } diff --git a/variants/heltec_v4/platformio.ini b/variants/heltec_v4/platformio.ini index ecfd7889b..9ab3e1625 100644 --- a/variants/heltec_v4/platformio.ini +++ b/variants/heltec_v4/platformio.ini @@ -17,9 +17,9 @@ build_flags = -D P_LORA_SCLK=9 -D P_LORA_MISO=11 -D P_LORA_MOSI=10 - -D P_LORA_PA_POWER=7 ;power en - -D P_LORA_PA_EN=2 - -D P_LORA_PA_TX_EN=46 ;enable tx + -D P_LORA_PA_POWER=7 ; VFEM_Ctrl - Power on GC1109 + -D P_LORA_PA_EN=2 ; PA CSD - Enable GC1109 + -D P_LORA_PA_TX_EN=46 ; PA CPS - GC1109 TX PA full(High) / bypass(Low) -D PIN_BOARD_SDA=17 -D PIN_BOARD_SCL=18 -D PIN_USER_BTN=0 @@ -27,10 +27,11 @@ build_flags = -D PIN_VEXT_EN_ACTIVE=HIGH -D LORA_TX_POWER=10 ;If it is configured as 10 here, the final output will be 22 dbm. -D MAX_LORA_TX_POWER=22 ; Max SX1262 output - -D SX126X_DIO2_AS_RF_SWITCH=true + -D SX126X_REGISTER_PATCH=1 ; Patch register 0x8B5 for improved RX + -D SX126X_DIO2_AS_RF_SWITCH=true ; GC1109 CTX is controlled by SX1262 DIO2 -D SX126X_DIO3_TCXO_VOLTAGE=1.8 -D SX126X_CURRENT_LIMIT=140 - -D SX126X_RX_BOOSTED_GAIN=1 +; -D SX126X_RX_BOOSTED_GAIN=1 ; Turned off for improved RX -D PIN_GPS_RX=38 -D PIN_GPS_TX=39 -D PIN_GPS_RESET=42 From 46e4cc06e39043c74cd4d164cc2aedb0f5bbeccf Mon Sep 17 00:00:00 2001 From: Socalix <48040807+Socalix@users.noreply.github.com> Date: Wed, 21 Jan 2026 21:12:54 -0600 Subject: [PATCH 2/2] Revert boosted gain flag to original --- variants/heltec_v4/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/heltec_v4/platformio.ini b/variants/heltec_v4/platformio.ini index 9ab3e1625..258a99673 100644 --- a/variants/heltec_v4/platformio.ini +++ b/variants/heltec_v4/platformio.ini @@ -31,7 +31,7 @@ build_flags = -D SX126X_DIO2_AS_RF_SWITCH=true ; GC1109 CTX is controlled by SX1262 DIO2 -D SX126X_DIO3_TCXO_VOLTAGE=1.8 -D SX126X_CURRENT_LIMIT=140 -; -D SX126X_RX_BOOSTED_GAIN=1 ; Turned off for improved RX + -D SX126X_RX_BOOSTED_GAIN=1 ; In some cases, commenting this out will improve RX -D PIN_GPS_RX=38 -D PIN_GPS_TX=39 -D PIN_GPS_RESET=42