I'm using this code here to read data from a BLE thermometer using an ESP32.
The code sometimes works fine and i can get the data:
+ Connect : a4:c1:38:69:0c:ff
 * Connected a4:c1:38:69:0c:ff
 + Found our service
 + Found our characteristic
 + Notify callback for characteristic ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6
temp = 21.8 C ; humidity = 48.0 % ; voltage = 2.564 V
 * Disconnected a4:c1:38:69:0c:ff
Other times i get a CPU panic, related to a stack error:
+ Connect : a4:c1:38:69:0c:ff
 * Connected a4:c1:38:69:0c:ff
 + Found our service
 + Found our characteristic
 + Notify callback for characteristic ebe0ccc1-7a0a-4b0c-8a1a-6ff2997da3a6
temp = 21.8 C ; humidity = 47.0 % ; voltage = 2.564 V
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (btuT) 
Core 0 register dump:
PC      : 0x4000c472  PS      : 0x00060a36  A0      : 0x8012b791  A1      : 0x3ffcf7e0  
A2      : 0x3ffcf7f4  A3      : 0x00000000  A4      : 0x00000268  A5      : 0x3ffcfa14  
A6      : 0x3ffde1ad  A7      : 0x00000026  A8      : 0x8012987e  A9      : 0x3ffd0270  
A10     : 0x3ffdb99c  A11     : 0x3ffddca8  A12     : 0x3ffd050a  A13     : 0x00000001  
A14     : 0x00000004  A15     : 0x00000000  SAR     : 0x00000010  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0x00000003  
ELF file SHA256: 0000000000000000
Backtrace: 0x4000c472:0x3ffcf7e0 0x4012b78e:0x3ffcf7f0 0x40129815:0x3ffcfa80 0x40125e62:0x3ffcfd10 0x401286e8:0x3ffcfd30 0x4012987b:0x3ffcffc0 0x40125e62:0x3ffd0250 0x401286e8:0x3ffd0270 0x4012987b:0x3ffd0500 0x40125e62:0x3ffd0790 0x401286e8:0x3ffd07b0 0x4012940a:0x3ffd0a40 0x40125e62:0x3ffd0a60 0x40129621:0x3ffd0a80 0x40125e62:0x3ffd0aa0 0x4012933d:0x3ffd0ac0 0x40129359:0x3ffd0ae0 0x40125e62:0x3ffd0b00 0x40125fa1:0x3ffd0b20 0x4012fb36:0x3ffd0b40 0x401042a6:0x3ffd0b60 0x4008ff9e:0x3ffd0b90
Rebooting...
I'm using an ESP-WROOM-32 with PlatformIO, what could be the issue?