From 44ae27454d8f58f1be08afa2ad1153bbe2dc3ada Mon Sep 17 00:00:00 2001 From: MarekZegare4 Date: Mon, 22 Jun 2026 14:43:33 +0200 Subject: [PATCH] build(solo-dual): optimise for size (-Os), not -Ofast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nRF52 Arduino core compiles with -Ofast (≈ -O3 + -ffast-math) by default, which had pushed this feature-rich solo build to ~90% flash. Unflag -Ofast and build with -Os: flash drops 90.1% → 60.9% (638 KB → 431 KB, ~200 KB reclaimed) with no loss of functionality and a negligible speed cost for a UI/mesh workload. -Os also avoids fast-math float reassociation, so it's marginally safer for the geo/distance maths. Co-Authored-By: Claude Opus 4.8 --- variants/wio-tracker-l1/platformio.ini | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/variants/wio-tracker-l1/platformio.ini b/variants/wio-tracker-l1/platformio.ini index 2eb95e44..e898adc9 100644 --- a/variants/wio-tracker-l1/platformio.ini +++ b/variants/wio-tracker-l1/platformio.ini @@ -152,9 +152,15 @@ extra_scripts = post:create-uf2.py [env:WioTrackerL1_companion_solo_dual] extends = WioTrackerL1CompanionDual +; Optimise for size, not speed: the nRF52 Arduino core defaults to -Ofast +; (≈ -O3 + -ffast-math), which bloats flash by ~200 KB on this feature-rich +; solo build. -Os keeps every feature, fits comfortably, and is actually safer +; for float (no fast-math reassociation). Speed is irrelevant for the UI/mesh. +build_unflags = -Ofast build_flags = ${WioTrackerL1CompanionDual.build_flags} -D UI_HAS_JOYSTICK_UPDOWN=1 -D ENABLE_SCREENSHOT + -Os extra_scripts = post:create-uf2.py [env:WioTrackerL1_companion_dual_dev]