build(solo): -Os for e-ink + GAT562 30S solo envs to shrink flash

Mirror the OLED solo size optimisation (44ae2745) on the remaining solo
builds so CI artifacts ship the reduced firmware too. The nRF52 Arduino
core defaults to -Ofast (≈ -O3 + -ffast-math); overriding with
build_unflags = -Ofast + -Os reclaims ~200 KB with no feature loss.

E-ink solo:        Flash 62.1% (440140 B)
GAT562 solo_ble:   SUCCESS
GAT562 solo_dual:  Flash 61.9% (441164 B)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MarekZegare4
2026-06-22 17:38:04 +02:00
parent 44ae27454d
commit e4273a9313
2 changed files with 18 additions and 0 deletions

View File

@@ -116,6 +116,11 @@ lib_deps =
extends = GAT562_30S_Mesh_Kit
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
; 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 =
${GAT562_30S_Mesh_Kit.build_flags}
-I examples/companion_radio/ui-new
@@ -130,6 +135,7 @@ build_flags =
-D UI_HAS_JOYSTICK_UPDOWN=1
-D ADVERT_NAME='"@@MAC"'
-D ENV_INCLUDE_GPS=1
-Os
; QSPIFLASH disabled: QSPI IO0/IO2 pins (P0.30/P0.28) conflict with joystick LEFT/UP
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
@@ -148,6 +154,11 @@ lib_deps =
extends = GAT562_30S_Mesh_Kit
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
board_upload.maximum_size = 712704
; 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 =
${GAT562_30S_Mesh_Kit.build_flags}
-I examples/companion_radio/ui-new
@@ -164,6 +175,7 @@ build_flags =
-D ENV_INCLUDE_GPS=1
-D DUAL_SERIAL=1
-D ENABLE_SCREENSHOT
-Os
; QSPIFLASH disabled: QSPI IO0/IO2 pins (P0.30/P0.28) conflict with joystick LEFT/UP
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1

View File

@@ -72,9 +72,15 @@ extra_scripts = post:create-uf2.py
; Dual BLE+USB with added Solo
[env:WioTrackerL1Eink_companion_solo_dual]
extends = WioTrackerL1Eink
; 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 = ${WioTrackerL1Eink.build_flags}
-D DUAL_SERIAL=1
-D ENABLE_SCREENSHOT
-Os
extra_scripts = post:create-uf2.py
; Dual BLE+USB with screenshot support (development/debug)