在使用esp32 处理一个结构体大数组(大小为98x80字节)时,报错:
Backtrace:0xfffffffe:0x8008d7c8 |<-CORRUPTED.
***ERROR*** A stack overflow in task loopTask has been detected.
0x4008bd24:0x3ffaf040 0x4008bcd4:0x00000000 |<-CORRUPTED
Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (loopTask)
Core 1 register dump:
PC : 0x40089690 PS : 0x00060b36 A0 : 0x800d55d4 A1 : 0x3ffb0780
A2 : 0x3ffb0890 A3 : 0x00000000 A4 : 0x00000060 A5 : 0x3ffb08c0
A6 : 0x00ff0000 A7 : 0x00000006 A8 : 0x800d9cf4 A9 : 0x3ffb2550
A10 : 0x00000002 A11 : 0x3f400aad A12 : 0x3f400a6f A13 : 0x00000000
A14 : 0x3ffb2584 A15 : 0x3ffb2290 SAR : 0x0000000a EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x40089690 LEND : 0x4008969b LCOUNT : 0x00000002
Backtrace:0x4008968d:0x3ffb07800x400d55d1:0x3ffb0790 0x400db539:0x3ffb2820
出现这种情况,是因为栈比较小。把CONFIG_ARDUINO_LOOP_STACK_SIZE从默认的8192增大到32768(4倍),效果明显变好。但也是会偶尔出现Guru Meditation Error: Core 0 panic'ed (Double exception).的问题,也是栈的原因,具体不清楚。因为只出现过一次,所以再也没管过。
参考:http://t.zoukankan.com/super119-p-1904309.html
https://qa.1r1g.com/sf/ask/3974562161/
https://arduino.stackexchange.com/questions/80729/esp32-stack-canary-watchpoint-triggered