From 7826360d131c7019c3dbddc2d5e83b95fe503d20 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:29:22 +0200 Subject: [PATCH] build(solo): offline queue 128 on the nRF52 builds The phone app's offline queue took 256 x 177 B = 45 KB, which with the on-device UI left the L1 ~5 KB of heap from boot (the sign buffer of #38 never fit). The UI keeps its own message history, and a full queue drops the oldest channel messages first, so 128 is plenty: the L1 heap now has ~27 KB free. L1 OLED / e-ink, ProMicro, T-Echo Lite, both GAT562; the upstream variants/ are unchanged (build_unflags in solo/). Co-Authored-By: Claude Opus 5.5 --- solo/gat562_30s_mesh_kit/platformio.ini | 7 +++++-- solo/gat562_mesh_watch13/platformio.ini | 6 +++++- solo/lilygo_techo_lite/platformio.ini | 7 +++++-- solo/promicro/platformio.ini | 7 +++++-- solo/wio-tracker-l1-eink/platformio.ini | 6 +++++- solo/wio-tracker-l1/platformio.ini | 6 +++++- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/solo/gat562_30s_mesh_kit/platformio.ini b/solo/gat562_30s_mesh_kit/platformio.ini index 6defbc9d..3d4bd5da 100644 --- a/solo/gat562_30s_mesh_kit/platformio.ini +++ b/solo/gat562_30s_mesh_kit/platformio.ini @@ -15,7 +15,10 @@ board_upload.maximum_size = 712704 ; (≈ -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 +; The offline queue (messages held for the phone app while it's away) at 128, +; not the board's 256: on the nRF52 the 256 x 177 B left ~5 KB of heap next to +; the on-device UI (which keeps its own history), too little for a sign buffer. +build_unflags = -Ofast -D OFFLINE_QUEUE_SIZE=256 build_flags = ${GAT562_30S_Mesh_Kit.build_flags} -I examples/companion_radio/ui-new @@ -23,7 +26,7 @@ build_flags = -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 - -D OFFLINE_QUEUE_SIZE=256 + -D OFFLINE_QUEUE_SIZE=128 -D FIRMWARE_SOLO_BUILD=1 -D MESHCORE_VERSION='"1.17.1"' -D UI_SENSORS_PAGE=1 diff --git a/solo/gat562_mesh_watch13/platformio.ini b/solo/gat562_mesh_watch13/platformio.ini index 8c7992dc..32dfe132 100644 --- a/solo/gat562_mesh_watch13/platformio.ini +++ b/solo/gat562_mesh_watch13/platformio.ini @@ -13,6 +13,10 @@ extends = GAT562_Mesh_Watch13 board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 +; The offline queue (messages held for the phone app while it's away) at 128, +; not the board's 256: on the nRF52 the 256 x 177 B left ~5 KB of heap next to +; the on-device UI (which keeps its own history), too little for a sign buffer. +build_unflags = -D OFFLINE_QUEUE_SIZE=256 build_flags = ${GAT562_Mesh_Watch13.build_flags} -I examples/companion_radio/ui-new @@ -20,7 +24,7 @@ build_flags = -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 - -D OFFLINE_QUEUE_SIZE=256 + -D OFFLINE_QUEUE_SIZE=128 -D DUAL_SERIAL=1 -D FIRMWARE_SOLO_BUILD=1 -D MESHCORE_VERSION='"1.17.1"' diff --git a/solo/lilygo_techo_lite/platformio.ini b/solo/lilygo_techo_lite/platformio.ini index 1d3c0af5..6c43b766 100644 --- a/solo/lilygo_techo_lite/platformio.ini +++ b/solo/lilygo_techo_lite/platformio.ini @@ -12,7 +12,10 @@ board_upload.maximum_size = 712704 ; (≈ -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 +; The offline queue (messages held for the phone app while it's away) at 128, +; not the board's 256: on the nRF52 the 256 x 177 B left ~5 KB of heap next to +; the on-device UI (which keeps its own history), too little for a sign buffer. +build_unflags = -Ofast -D OFFLINE_QUEUE_SIZE=256 build_flags = ${LilyGo_T-Echo-Lite.build_flags} -I src/helpers/ui @@ -23,7 +26,7 @@ build_flags = ; -D QSPIFLASH=1 -D BLE_PIN_CODE=123456 ; -D BLE_DEBUG_LOGGING=1 - -D OFFLINE_QUEUE_SIZE=256 + -D OFFLINE_QUEUE_SIZE=128 -D UI_RECENT_LIST_SIZE=9 -D UI_SENSORS_PAGE=1 ; -D MESH_PACKET_LOGGING=1 diff --git a/solo/promicro/platformio.ini b/solo/promicro/platformio.ini index 05e5bdbb..cb049911 100644 --- a/solo/promicro/platformio.ini +++ b/solo/promicro/platformio.ini @@ -17,14 +17,17 @@ board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld board_upload.maximum_size = 712704 ; -Ofast (the core's default) doesn't fit a feature-complete solo build; ; -Os fits with headroom. -build_unflags = -Ofast +; The offline queue (messages held for the phone app while it's away) at 128, +; not the board's 256: on the nRF52 the 256 x 177 B left ~5 KB of heap next to +; the on-device UI (which keeps its own history), too little for a sign buffer. +build_unflags = -Ofast -D OFFLINE_QUEUE_SIZE=256 build_flags = ${Promicro.build_flags} -I examples/companion_radio/ui-new -D MAX_CONTACTS=350 -D MAX_GROUP_CHANNELS=40 -D BLE_PIN_CODE=123456 -D DUAL_SERIAL=1 - -D OFFLINE_QUEUE_SIZE=256 + -D OFFLINE_QUEUE_SIZE=128 -D DISPLAY_CLASS=SSD1306Display -D FIRMWARE_SOLO_BUILD=1 -D UI_SENSORS_PAGE=1 diff --git a/solo/wio-tracker-l1-eink/platformio.ini b/solo/wio-tracker-l1-eink/platformio.ini index 3dd6d146..4e81ed88 100644 --- a/solo/wio-tracker-l1-eink/platformio.ini +++ b/solo/wio-tracker-l1-eink/platformio.ini @@ -11,8 +11,12 @@ extends = WioTrackerL1Eink ; (≈ -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 +; The offline queue (messages held for the phone app while it's away) at 128, +; not the board's 256: on the nRF52 the 256 x 177 B left ~5 KB of heap next to +; the on-device UI (which keeps its own history), too little for a sign buffer. +build_unflags = -Ofast -D OFFLINE_QUEUE_SIZE=256 build_flags = ${WioTrackerL1Eink.build_flags} + -D OFFLINE_QUEUE_SIZE=128 -D DUAL_SERIAL=1 -D ENABLE_SCREENSHOT -Os diff --git a/solo/wio-tracker-l1/platformio.ini b/solo/wio-tracker-l1/platformio.ini index 97f69e82..ca33b6a8 100644 --- a/solo/wio-tracker-l1/platformio.ini +++ b/solo/wio-tracker-l1/platformio.ini @@ -10,8 +10,12 @@ extends = WioTrackerL1CompanionDual ; (≈ -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 +; The offline queue (messages held for the phone app while it's away) at 128, +; not the board's 256: on the nRF52 the 256 x 177 B left ~5 KB of heap next to +; the on-device UI (which keeps its own history), too little for a sign buffer. +build_unflags = -Ofast -D OFFLINE_QUEUE_SIZE=256 build_flags = ${WioTrackerL1CompanionDual.build_flags} + -D OFFLINE_QUEUE_SIZE=128 -D UI_HAS_JOYSTICK_UPDOWN=1 -D ENABLE_SCREENSHOT -D DUAL_SERIAL=1