arduino-LoRa: Guru meditation error while using onTxDone /onReceive on ESP32
I get crashes while using onrxdone or ontxdone on ESP32 module:
``Guru Meditation Error: Core 1 panic’ed (Interrupt wdt timeout on CPU1)
Core 1 register dump:
PC : 0x4008b356 PS : 0x00060234 A0 : 0x8008a513 A1 : 0x3ffbe660
A2 : 0x3ffb8984 A3 : 0x3ffb8074 A4 : 0x00000001 A5 : 0x00000001
A6 : 0x00060223 A7 : 0x00000000 A8 : 0x3ffb8074 A9 : 0x3ffb8074
A10 : 0x00000018 A11 : 0x00000018 A12 : 0x00000001 A13 : 0x00000001
A14 : 0x00060221 A15 : 0x00000000 SAR : 0x0000000e EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
Core 1 was running in ISR context:
EPC1 : 0x400899ae EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x4008b356
Backtrace: 0x4008b356:0x3ffbe660 0x4008a510:0x3ffbe680 0x400887ef:0x3ffbe6a0 0x400d454d:0x3ffbe6e0 0x400d1c79:0x3ffbe700 0x400d1d6c:0x3ffbe730 0x400d1da0:0x3ffbe750 0x400d24dd:0x3ffbe770 0x40080eb6:0x3ffbe790 0x40080f01:0x3ffbe7b0 0x40084dc1:0x3ffbe7d0 0x4000bfed:0x3ffb1e90 0x40089b19:0x3ffb1ea0 0x4008879b:0x3ffb1ec0 0x400d454d:0x3ffb1f00 0x400d1c79:0x3ffb1f20 0x400d1d6c:0x3ffb1f50 0x400d229d:0x3ffb1f70 0x400d16a0:0x3ffb1f90 0x400d5265:0x3ffb1fb0 0x400889e9:0x3ffb1fd0
Core 0 register dump:
PC : 0x400899b0 PS : 0x00060034 A0 : 0x8008a1c1 A1 : 0x3ffbe150
A2 : 0x3ffbee78 A3 : 0x0000cdcd A4 : 0xb33fffff A5 : 0x00000001
A6 : 0x00060021 A7 : 0x0000abab A8 : 0x0000cdcd A9 : 0x3ffc090c
A10 : 0x00000003 A11 : 0x00060023 A12 : 0x00060021 A13 : 0x00000001
A14 : 0x00060520 A15 : 0x00000000 SAR : 0x0000001b EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Backtrace: 0x400899b0:0x3ffbe150 0x4008a1be:0x3ffbe180 0x40088ad7:0x3ffbe1a0 0x4008b1cd:0x3ffbe1c0 0x40084dca:0x3ffbe1d0 0x400ed757:0x3ffbbff0 0x400d7dcb:0x3ffbc010 0x4008a18a:0x3ffbc030 0x400889e9:0x3ffbc050
Rebooting… ``
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 26
Thank you so much @Jose2059 for your detailed response. After reading it, I’ve spend some hours to go deeper, working arround your approach.
@GIPdA GIPdA, thank you too, “merci beaucoup même”, I kept your quote in mind during my tests: I suspect there’s a function somewhere that sometimes waits too long.
The last night, I’ve found data I asked to send when I tried to read, it is another thing to know.
So! I’ve have something which seems to work, even in bad conditions and making send and receive using interrupts without any crash.
In some words:
Declare a volatile flag, initialize lora, create a xTask for reading and configure the interrupt to set the flag to true, only that. In the xTask, make a loop with a read only if the flag is true then set it to false. It is the solution given by @Jose2059 and it works for pure receiving.
But if you want to send too, be careful and take in consideration the flag! If you try to send something when it is true, you will make something bad in a buffer and when the task will try to read, the Guru crash may appears.
In this code, I tried to reproduce real conditions, enabling Wifi, sending and a periodic long process. There is no crash.
I just noticed after some minutes (over 10), the receive may stops to work. But it is another problem I will try to resolve.
The trace looks to this, with other module sending packet each 5 seconds: