Fix heap exhaustion: enable PSRAM allocator + bound all tables + auto-reboot watchdog
Root cause: heltec_V4_boundary build was missing -DRNS_USE_TLSF=1 and -DRNS_USE_ALLOCATOR=1 flags, causing ALL C++ new/delete to use internal SRAM (239KB) instead of the PSRAM-backed TLSF pool (~1.6MB). Transport data structures consumed internal heap until WiFi driver could not allocate RX buffers (ESP_ERR_NO_MEM). Changes: - platformio.ini: Add TLSF/allocator flags to heltec_V4_boundary env, re-enable NDEBUG - Transport.cpp: Add periodic culling of _path_requests (was unbounded, grew one entry per unique destination forever). Cull entries older than DESTINATION_TIMEOUT. Also cull _pending_local_path_requests for removed interfaces, and fix missing .erase() (Python .pop() equivalent). - RNode_Firmware.ino: Replace WiFi watchdog halt-serial with auto-reboot. Add heap pressure check (reboot if free heap < 20KB). Increase WiFi grace period from 5s to 15s. Remove orphaned boundary_done label.
This commit is contained in:
@@ -342,7 +342,9 @@ build_flags =
|
||||
-DARDUINO_USB_CDC_ON_BOOT=1
|
||||
-DBOARD_HAS_PSRAM=1
|
||||
-DBOUNDARY_MODE
|
||||
;-DNDEBUG ; re-enable debug output for WiFi disconnect investigation
|
||||
-DNDEBUG
|
||||
-DRNS_USE_TLSF=1
|
||||
-DRNS_USE_ALLOCATOR=1
|
||||
; --- Boundary mode defaults (override via EEPROM at runtime) ---
|
||||
; TCP server mode (0=server, 1=client)
|
||||
-DBOUNDARY_TCP_MODE=0
|
||||
|
||||
Reference in New Issue
Block a user