From 27fea5fc0724bbd1d6142f684b529807a91211d2 Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Sat, 15 Feb 2025 16:06:10 +0100 Subject: [PATCH] Fix STM32WL TCXO setting; enable logs and modules (#6063) Co-authored-by: Ben Meadors --- arch/stm32/stm32.ini | 10 ++++++++-- src/mesh/STM32WLE5JCInterface.cpp | 5 ++++- src/mesh/STM32WLE5JCInterface.h | 3 --- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/stm32/stm32.ini b/arch/stm32/stm32.ini index 7e211496d..46f41db3a 100644 --- a/arch/stm32/stm32.ini +++ b/arch/stm32/stm32.ini @@ -11,9 +11,15 @@ build_flags = ${arduino_base.build_flags} -flto -Isrc/platform/stm32wl -g - -DMESHTASTIC_MINIMIZE_BUILD + -DMESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR + -DMESHTASTIC_EXCLUDE_INPUTBROKER + -DMESHTASTIC_EXCLUDE_I2C + -DMESHTASTIC_EXCLUDE_POWERMON + -DMESHTASTIC_EXCLUDE_SCREEN + -DMESHTASTIC_EXCLUDE_MQTT + -DMESHTASTIC_EXCLUDE_BLUETOOTH + -DMESHTASTIC_EXCLUDE_PKI -DMESHTASTIC_EXCLUDE_GPS - -DDEBUG_MUTE ; -DVECT_TAB_OFFSET=0x08000000 -DconfigUSE_CMSIS_RTOS_V2=1 ; -DSPI_MODE_0=SPI_MODE0 diff --git a/src/mesh/STM32WLE5JCInterface.cpp b/src/mesh/STM32WLE5JCInterface.cpp index 499db9176..ad1f675b6 100644 --- a/src/mesh/STM32WLE5JCInterface.cpp +++ b/src/mesh/STM32WLE5JCInterface.cpp @@ -18,6 +18,9 @@ bool STM32WLE5JCInterface::init() { RadioLibInterface::init(); + // https://github.com/Seeed-Studio/LoRaWan-E5-Node/blob/main/Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.c + setTCXOVoltage(1.7); + lora.setRfSwitchTable(rfswitch_pins, rfswitch_table); if (power > STM32WLx_MAX_POWER) // This chip has lower power limits than some @@ -39,4 +42,4 @@ bool STM32WLE5JCInterface::init() return res == RADIOLIB_ERR_NONE; } -#endif // ARCH_STM32WL +#endif // ARCH_STM32WL \ No newline at end of file diff --git a/src/mesh/STM32WLE5JCInterface.h b/src/mesh/STM32WLE5JCInterface.h index fad793332..0c8140290 100644 --- a/src/mesh/STM32WLE5JCInterface.h +++ b/src/mesh/STM32WLE5JCInterface.h @@ -16,9 +16,6 @@ class STM32WLE5JCInterface : public SX126xInterface virtual bool init() override; }; -// https://github.com/Seeed-Studio/LoRaWan-E5-Node/blob/main/Middlewares/Third_Party/SubGHz_Phy/stm32_radio_driver/radio_driver.c -static const float tcxoVoltage = 1.7; - /* https://wiki.seeedstudio.com/LoRa-E5_STM32WLE5JC_Module/ * Wio-E5 module ONLY transmits through RFO_HP * Receive: PA4=1, PA5=0