Share T096 Full mOTA memory with the offline queue

This commit is contained in:
mikecarper committed 2026-09-08 01:15:19 -07:00
1 parent d28535f503
commit 2ea493994e
26 files changed
+1198 -23

No files matched your search

+17
View File
@@ -12,6 +12,7 @@ A reboot clears it.
| ESP32 with configured PSRAM | 512 |
| ESP32 without PSRAM | 256 |
| nRF52840 | 256 |
| T096 Full Companion with the memory correction | 256 normally; 128 while mOTA owns shared storage |
| RP2040 | 256 |
| STM32 | 16 |
| Known constrained classic ESP32 target override | 128 |
@@ -25,6 +26,22 @@ Meshadventurer SX1262 and SX1268 Full Companion use 16 frames together with 100
contacts and 30 group channels; their ordinary transport-specific images keep
128 frames and 40 channels.
The [T096 Full memory correction](releases/1.17.1.5.md#t096-full-companion-bluetooth-and-menu-freeze-report)
keeps 256 frames normally, while retaining 350 contacts, 40 channels, and all
Full transports. The upper 128 slots temporarily hold the mOTA context when
a source or TempRadio discovery session starts. Stopping or disconnecting the
USB/Bluetooth source returns all 256 slots; a discovery-only session returns
them when TempRadio ends. This shares a fixed memory region and avoids heap
fragmentation from resizing.
Existing unread messages retain their order. If more than 128 frames are
pending, mOTA refuses the loan and asks you to sync messages with a Companion
app first. While the loan is active, the overflow policy below applies at 128
frames. The original `26303793` 1.17.1.5 download reserves the queue and mOTA
state separately, leaving too little runtime headroom for its color display
and Bluetooth. The corrected profile recovers about 19 KiB by sharing storage
and requires at least 72 KiB of heap space at link time.
Standard, logging, MQTT, and Cascade build overlays retain the selected target
capacity; they do not silently shrink the queue.
+6
View File
@@ -333,6 +333,12 @@ direct messages; it is not flash-backed history. See
[Companion offline message queue](./companion_offline_queue.md) for all platform
defaults and full-queue behavior.
The corrected T096 Full profile keeps **256 offline frames normally** and
temporarily lends 128 slots to mOTA to leave room for
its color framebuffer, Bluetooth tasks, and UI allocations. It retains 350
contacts, 40 channels, and USB/Bluetooth mOTA sending. The published 1.17.1.5
`26303793` image predates this [memory correction](releases/1.17.1.5.md#t096-full-companion-bluetooth-and-menu-freeze-report).
The nRF52 target inherits the board's ordinary USB Companion installation
format and adds BLE plus the serial mOTA source. It does not enable an SD cache
or any other board-specific storage behavior; host files are streamed as they
+55
View File
@@ -85,6 +85,61 @@ logging toggles, OTA inhibition, simultaneous button/LoRa wake configuration,
and the two-minute interval across timer rollover. The published 1.17.1.5
binaries have not been replaced by these corrections.
## T096 Full Companion Bluetooth and menu freeze report
A report against `Heltec_t096_companion_radio_full_femon` describes no usable
Bluetooth despite a displayed PIN, followed by a freeze while stepping through
the device menu. Reflashing both with and without a full wipe gave the same
result. The exact freeze and Bluetooth behavior still need confirmation on a
physical T096 with the source correction below.
The published `26303793` Full image leaves only **54,724 bytes (53.4 KiB)**
between the linked heap boundaries. Its static RAM check did not account for
the allocations made at startup: the 160×80 color framebuffer alone needs
25,602 bytes, followed by task stacks, the packet pool, filesystem buffers,
and message previews. This leaves inadequate runtime headroom. The pinned
Bluefruit library also ignores failure to create its BLE/SOC worker tasks,
and the sensor menu could write through a failed CayenneLPP allocation. Those
are code paths consistent with this report; a PIN is not proof of a working
Bluetooth radio.
The source correction keeps the T096 **Full** offline queue at **256 frames
during normal use**. mOTA borrows the upper 128 slots for its roughly 19 KiB
session state only when needed, leaving 128 message slots during mOTA use.
Starting a source or a TempRadio discovery session acquires this workspace.
Stopping or disconnecting the USB/Bluetooth source restores all 256 slots,
even if the temporary radio window is still open. A discovery-only session
returns the slots when its TempRadio window ends. No heap resizing is involved.
Unread messages keep their order across both transitions. If more than 128
frames are pending, mOTA refuses to start and asks you to **sync unread
messages with a Companion app first**; it does not discard them to make room.
OTA configuration and signer keys survive reuse of the workspace. While mOTA
owns it, the normal queue overflow policy applies to the remaining 128 slots.
The profile requires at least 72 KiB of heap space at link time. It retains
350 contacts, 40 channels, the color display, sensors, USB, Bluetooth,
Bluetooth DFU, and USB/Bluetooth mOTA sending. This reserve is space for
runtime allocations, not a measurement of free heap after boot.
Bluetooth startup now checks both worker tasks and all registered services;
a failed partial initialization does not repeat every five seconds. The
sensor page reports low memory if its buffer could not be allocated.
Regression tests transfer complete mOTA containers through the actual shared
context, check queue wraparound and message order, and cover source stop,
disconnect, conflicting USB/Bluetooth ownership and repeated sessions. They
also inject worker-task and GATT-service failures, verify that retries do not
initialize the stack again, open the sensor path with a failed allocation,
and use the real linker assertion to reject the old heap budget.
The existing `26303793` firmware downloads do **not** contain this correction.
Another wipe is not a fix for the compiled memory budget.
For a T096 test build containing the correction, use its matching application
UF2 through the existing USB bootloader. Preserve the bootloader and node data.
Check Bluetooth discovery, pairing and message exchange on battery power and
with USB attached; then step through every menu page, return from screen-off,
and check USB and Bluetooth mOTA sending. Hardware validation is pending.
## Firmware roles and update support
Use the exact board's Full Companion image when available. Every Full