ESP32

ESP32: Stack canary watchpoint triggered (loopTask)

Written by

in ,

Recently, I stumble upon the following error on an ESP32:

Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (loopTask) 
Core 1 register dump:
PC      : 0x40083774  PS      : 0x00060b36  A0      : 0x3ffb0120  A1      : 0x3ffb0060  
A2      : 0x68efa751  A3      : 0x3ffb0938  A4      : 0x3ffb0720  A5      : 0xfb879c5c  
A6      : 0x61b36b71  A7      : 0x0006970f  A8      : 0x01709af4  A9      : 0x01709af4  
A10     : 0xfaa5dfed  A11     : 0x01a3ff3b  A12     : 0x76651dec  A13     : 0x00000001  
A14     : 0x00000000  A15     : 0x04adbe74  SAR     : 0x0000001e  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x400f1cc5  LEND    : 0x400f1cc9  LCOUNT  : 0x00000000  

ELF file SHA256: 0000000000000000

The reason for this was an infinite loop that was caused by two methods that where called from each other. So the execution of the first method never ended. The code looked something like this (extremly simplified):

void loop() {
  methodOne();
}

void methodOne() {
  // ... some other code and conditions
  methodTwo();
}
void methodTwo() {
  // ... some other code and conditions
  methodOne();
}

Foto von Vishnu Mohanan auf Unsplash


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *