From fe288a70e4ce8697ef9934562ea8cb8eb0c443ff Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Mon, 13 Jul 2026 20:08:20 +0800 Subject: [PATCH] stm32wl: exclude PKT_HISTORY_HASH, RANGETEST, WAYPOINT, POWER_TELEMETRY (#10992) Adds four MESHTASTIC_EXCLUDE_* flags to stm32_base, applying them to every stm32wl variant (rak3172, wio-e5, russell, milesight_gs301, CDEBYTE_E77-MBL): - PKT_HISTORY_HASH: mirrors the accepted nRF52 precedent (variants/nrf52840/nrf52.ini) - drops PacketHistory's hash index; the O(n) fallback is negligible given stm32wl's small node table. No feature loss. - POWER_TELEMETRY: only affects external power-monitor ICs (INA219/INA260 etc.) via PowerTelemetryModule; internal battery ADC reading (src/Power.cpp) is a separate, ungated code path and is unaffected. No current stm32wl variant wires up external power-monitor hardware. - RANGETEST: real feature loss on wio-e5 specifically, the only stm32wl variant with GPS enabled (RangeTest requires GPS to run at all, so it was already dead on every other variant). - WAYPOINT: real feature loss on rak3172/wio-e5 (russell already excluded this individually; that duplicate is removed here since stm32_base now covers it). Measured on wio-e5 against upstream/develop @ 7a25ffd0a: 2,768 bytes flash saved (240,648 -> 237,880), 260 bytes RAM saved. Sanity-built russell and rak3172 to confirm no regressions from the russell dedup. Assisted-by: Claude Sonnet 5 Signed-off-by: Andrew Yong Co-authored-by: Ben Meadors --- variants/stm32/russell/platformio.ini | 2 -- variants/stm32/stm32.ini | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/variants/stm32/russell/platformio.ini b/variants/stm32/russell/platformio.ini index 57f73f6d0..1900a9ae1 100644 --- a/variants/stm32/russell/platformio.ini +++ b/variants/stm32/russell/platformio.ini @@ -14,13 +14,11 @@ build_flags = -Ivariants/stm32/russell -DPRIVATE_HW -DMESHTASTIC_EXCLUDE_AIR_QUALITY_SENSOR=1 - -DMESHTASTIC_EXCLUDE_RANGETEST=1 -DMESHTASTIC_EXCLUDE_DETECTIONSENSOR=1 -DMESHTASTIC_EXCLUDE_EXTERNALNOTIFICATION=1 -DMESHTASTIC_EXCLUDE_POWERSTRESS=1 -DMESHTASTIC_EXCLUDE_NEIGHBORINFO=1 -DMESHTASTIC_EXCLUDE_TRACEROUTE=1 - -DMESHTASTIC_EXCLUDE_WAYPOINT=1 lib_deps = ${stm32_base.lib_deps} # renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library diff --git a/variants/stm32/stm32.ini b/variants/stm32/stm32.ini index 5726fd369..4300e3b7a 100644 --- a/variants/stm32/stm32.ini +++ b/variants/stm32/stm32.ini @@ -26,6 +26,10 @@ build_flags = -DMESHTASTIC_EXCLUDE_WIFI=1 -DMESHTASTIC_EXCLUDE_TZ=1 ; Exclude TZ to save some flash space. -DMESHTASTIC_EXCLUDE_XEDDSA=1 ; The Ed25519 signing code does not fit in the 256KB flash. Packets are sent unsigned, like pre-XEdDSA firmware. + -DMESHTASTIC_EXCLUDE_PKT_HISTORY_HASH=1 + -DMESHTASTIC_EXCLUDE_RANGETEST=1 + -DMESHTASTIC_EXCLUDE_WAYPOINT=1 + -DMESHTASTIC_EXCLUDE_POWER_TELEMETRY=1 -DSERIAL_RX_BUFFER_SIZE=256 ; For GPS - the default of 64 is too small. -DHAS_SCREEN=0 ; Always disable screen for STM32, it is not supported. ;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; Enable this if enabling debugg logging. It is REQUIRED for at least traceroute debug prints - without it the length returned by printf ends up uninitialized.