Browse Source

rak3172: auto-detect crystal vs TCXO

Pass a TCXO voltage to begin() so RadioLib probes for one and falls back
to the crystal if it does not start. One build then serves the crystal
RAK3172 and the TCXO -T alike, where a hard-coded 0 fails init with -707.
pull/2932/head
Holger Adams 3 weeks ago
parent
commit
3be00ee9ec
  1. 2
      variants/rak3x72/platformio.ini
  2. 6
      variants/rak3x72/target.cpp

2
variants/rak3x72/platformio.ini

@ -10,7 +10,7 @@ build_flags = ${stm32_base.build_flags}
-D RX_BOOSTED_GAIN=true -D RX_BOOSTED_GAIN=true
-D STM32WL_ENABLE_SMPS ; run the radio from the SMPS/DC-DC regulator (needs the VLXSMPS coil) -D STM32WL_ENABLE_SMPS ; run the radio from the SMPS/DC-DC regulator (needs the VLXSMPS coil)
-D STM32WL_SLEEP_STOP0 ; sleep in Stop0 so the SMPS stays active during continuous RX -D STM32WL_SLEEP_STOP0 ; sleep in Stop0 so the SMPS stays active during continuous RX
; -D STM32WL_TCXO_VOLTAGE=1.6 ; defaults to 0 if undef ; -D STM32WL_TCXO_VOLTAGE=1.8 ; override the auto-detected default from target.cpp
; -D LORA_TX_POWER=14 ; Defaults to 22 for HP, 14 is for LP version ; -D LORA_TX_POWER=14 ; Defaults to 22 for HP, 14 is for LP version
-I variants/rak3x72 -I variants/rak3x72
build_src_filter = ${stm32_base.build_src_filter} build_src_filter = ${stm32_base.build_src_filter}

6
variants/rak3x72/target.cpp

@ -24,9 +24,11 @@ SensorManager sensors;
#define LORA_CR 5 #define LORA_CR 5
#endif #endif
// Auto-detect the oscillator. begin() is given a TCXO voltage; RadioLib falls
// back to the crystal if it fails to start, so one build runs on both the
// crystal RAK3172 and the TCXO -T. A hard-coded 0 leaves the -T failing (-707).
#ifndef STM32WL_TCXO_VOLTAGE #ifndef STM32WL_TCXO_VOLTAGE
// TCXO set to 0 for RAK3172 #define STM32WL_TCXO_VOLTAGE 1.8
#define STM32WL_TCXO_VOLTAGE 0
#endif #endif
#ifndef LORA_TX_POWER #ifndef LORA_TX_POWER

Loading…
Cancel
Save