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:
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user