fix(Telemetry): heap-corrupt crash in logBootEvent — StaticJsonDocument on small task stack

StaticJsonDocument<8192> in logBootEvent() was allocating 8KB on the stack of
ntpSyncTask, which only had 3072 bytes. Stack overflow silently corrupted the
heap, triggering assert in multi_heap_free immediately after the boot log write.

Fix: switch logBootEvent to heap-allocated JsonDocument (ArduinoJson v7 default).
Also bumped ntpSyncTask stack from 3072 → 5120 bytes for NTP + SD write headroom.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 11:27:50 +03:00
co-authored by Claude Sonnet 4.6
parent 07d5b2fb81
commit a5395b0de7
2 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -459,7 +459,7 @@ static void ntpSyncTask(void* param) {
// Non-blocking NTP sync timer callback — defers work to a task (Tmr Svc stack is only 2KB)
void ntpSyncTimerCallback(TimerHandle_t xTimer) {
xTaskCreate(ntpSyncTask, "ntpSync", 3072, NULL, 5, NULL);
xTaskCreate(ntpSyncTask, "ntpSync", 5120, NULL, 5, NULL);
}
#endif