Stack canary watchpoint triggered (loopTask)
What it looks like
Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception). Debug exception reason: Stack canary watchpoint triggered (loopTask)
What it means
A task used more stack than it was given and ran into the guard at the end of its stack. The name in brackets is the task: loopTask is the task that runs setup() and loop() in Arduino.
Likely causes
- A large local array or buffer inside a function, such as char buf[8192].
- Deep or unbounded recursion.
- A task created with xTaskCreate or xTaskCreatePinnedToCore with too small a stack size.
- Libraries that need a lot of stack, such as TLS (WiFiClientSecure) or JSON parsing, called from a small task.
How to fix it
- Make big buffers static, global, or allocate them with malloc() once.
- Give loopTask more stack by adding SET_LOOP_TASK_STACK_SIZE(16 * 1024); at file scope in the sketch. The default is 8 KB.
- For your own tasks, raise the stack size argument and check usage with uxTaskGetStackHighWaterMark(NULL).
Paste your full log
The lines around the error usually say more. Paste everything from the reset to the backtrace and the crash translator explains each part. It runs in your browser; nothing is sent anywhere.