mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-04-27 03:15:11 +00:00
769c9952bd
Root cause: Bytes objects stored in PSRAM-allocated BLEInterface had corrupted shared_ptr members from uninitialized memory, causing crashes in processDiscoveredPeers(). Fixed by using heap_caps_calloc instead of heap_caps_malloc for PSRAM placement-new allocation. Additional fixes: - Reduce pool sizes to fit memory budget (reassembler 134KB→17KB, fragmenters 8→4, handshakes 32→4, pending data 64→8) - Store local MAC as BLEAddress struct instead of Bytes to avoid heap allocation in PSRAM-resident object - Move setLocalMac after platform start (NimBLE needs to be running for valid random address), add lazy MAC init fallback in loop() - Add stuck-state detector: resets GAP state machine if hardware is idle but state machine thinks it's busy - Enhance getLocalAddress with 3 fallback methods (NimBLE API, ble_hs_id_copy_addr RANDOM, esp_read_mac efuse) - Fix C++17 structured binding to C++11 compatibility - Increase BLE task stack 8KB→12KB for string ops in debug logs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
27 KiB
27 KiB