From 8056344b86b07a779191d2c0f18f12ae4a9f6ab0 Mon Sep 17 00:00:00 2001 From: Malkavien Date: Sun, 12 Apr 2026 14:49:42 +0200 Subject: [PATCH] fix(waveshare-rp2040): add SX126X_RXEN=17 to restore RX sensitivity The Waveshare RP2040-LoRa board has an RF switch with two complementary control lines: - DIO2 (CTRL) -- driven automatically by the SX1262 chip: HIGH on TX, LOW on RX - GPIO17 (!CTRL) -- was not configured in MeshCore, so it floated and the switch never properly selected the LNA/RX path Without this pin driven, the RF switch never switches to RX mode, resulting in completely degraded reception. TX was unaffected because DIO2 alone is sufficient to activate the TX path. Adding SX126X_RXEN=17 lets RadioLib drive GPIO17 as the complement of DIO2, so the switch correctly routes the signal to the LNA on receive. Reference: https://files.waveshare.com/wiki/RP2040-LoRa/Rp2040-lora-sch.pdf --- variants/waveshare_rp2040_lora/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/waveshare_rp2040_lora/platformio.ini b/variants/waveshare_rp2040_lora/platformio.ini index b930683de5..880f238f2f 100644 --- a/variants/waveshare_rp2040_lora/platformio.ini +++ b/variants/waveshare_rp2040_lora/platformio.ini @@ -20,6 +20,7 @@ build_flags = ${rp2040_base.build_flags} -D P_LORA_MOSI=15 -D P_LORA_TX_LED=25 -D SX126X_DIO2_AS_RF_SWITCH=true + -D SX126X_RXEN=17 -D SX126X_DIO3_TCXO_VOLTAGE=1.8 -D SX126X_RX_BOOSTED_GAIN=1 -D LORA_TX_POWER=22