E22-400M SX126X_DIO3_TCXO_VOLTAGE fix (#6232)

Added TCXO voltage setting for SX1268 based module to fix error:
Calibration failed, device errors: 0x20
SX126x init result -707
This commit is contained in:
Andrik45719 2025-03-06 10:44:53 +02:00 committed by GitHub
parent a924b9d94a
commit b25db1f42c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1017,6 +1017,22 @@ void setup()
#endif
#if defined(USE_SX1268)
#if defined(SX126X_DIO3_TCXO_VOLTAGE) && defined(TCXO_OPTIONAL)
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
// try using the specified TCXO voltage
auto *sxIf = new SX1268Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
sxIf->setTCXOVoltage(SX126X_DIO3_TCXO_VOLTAGE);
if (!sxIf->init()) {
LOG_WARN("No SX1268 radio with TCXO, Vref %fV", SX126X_DIO3_TCXO_VOLTAGE);
delete sxIf;
rIf = NULL;
} else {
LOG_INFO("SX1268 init success, TCXO, Vref %fV", SX126X_DIO3_TCXO_VOLTAGE);
rIf = sxIf;
radioType = SX1268_RADIO;
}
}
#endif
if ((!rIf) && (config.lora.region != meshtastic_Config_LoRaConfig_RegionCode_LORA_24)) {
rIf = new SX1268Interface(RadioLibHAL, SX126X_CS, SX126X_DIO1, SX126X_RESET, SX126X_BUSY);
if (!rIf->init()) {
@ -1276,4 +1292,4 @@ void loop()
}
}
#endif
#endif