My code is working fine when I am running everything from the main loop but it crashes (after an hour) when I run a part of it from a second Task running on core 0. I am using Arduino IDE for sketching.
The error is:
Guru Meditation Error: Core 0 panic'ed (InstrFetchProhibited). Exception was unhandled.
16:02:28.238 -> Core 0 register dump:
16:02:28.238 -> PC : 0xb440083e PS : 0x00060e33 A0 : 0x80001e29 A1 : 0x3ffbe3b0
16:02:28.238 -> A2 : 0x3ffae0a8 A3 : 0x00000001 A4 : 0x40084230 A5 : 0x3ffb8c20
16:02:28.238 -> A6 : 0x00000000 A7 : 0x3ffbbf60 A8 : 0x8000be38 A9 : 0x3ffbe780
16:02:28.238 -> A10 : 0x3ffae0a8 A11 : 0x3ffc1b8c A12 : 0x00000001 A13 : 0x00000001
16:02:28.238 -> A14 : 0x00060a20 A15 : 0x00000000 SAR : 0x00000014 EXCCAUSE: 0x00000014
16:02:28.238 -> EXCVADDR: 0xb440083c LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
16:02:28.238 -> Core 0 was running in ISR context:
16:02:28.238 -> EPC1 : 0xb440083e EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x00000000
16:02:28.238 ->
16:02:28.238 -> ELF file SHA256: 0000000000000000
16:02:28.238 ->
16:02:28.238 -> Backtrace: 0x7440083e:0x3ffbe3b0 0x40001e26:0x3ffbe3d0 0x40001e3b:0x3ffbe3f0 0x400e2979:0x3ffbe410 0x400de53d:0x3ffbe6d0 0x400de450:0x3ffbe720 0x40087ec5:0x3ffbe750 0x40088682:0x3ffbe780 0x40086f5f:0x3ffbe7a0 0x4008964d:0x3ffbe7c0 0x4008429e:0x3ffbe7d0 0x400fcf33:0x3ffbc270 0x400f36e3:0x3ffbc290 0x4008864d:0x3ffbc2b0 0x40086e72:0x443ffbc2
Using the Exception Decoder, The following is received:
Decoding stack results
I have defined the task as following.. Tried increasing the stack size (up to 10,000)but the same issue persists..0x400e2979: _vfiprintf_r at ../../../.././newlib/libc/stdio/vfprintf.c line 859
0x400de53d: fiprintf at ../../../.././newlib/libc/stdio/fiprintf.c line 50
0x400de450: __assert_func at ../../../.././newlib/libc/stdlib/assert.c line 59
0x40087ec5: vTaskEnterCritical at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portmux_impl.inc.h line 105
0x40088682: xTaskIncrementTick at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c line 2490
0x40086f5f: xPortSysTickHandler at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 289
0x400fcf33: esp_pm_impl_waiti at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/pm_esp32.c line 492
0x400f36e3: esp_vApplicationIdleHook at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/freertos_hooks.c line 63
0x4008864d: prvIdleTask at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c line 3382
0x40086e72: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
Code: Select all
xTaskCreatePinnedToCore(
Task1code, /* Task function. */
"Task1", /* name of task. */
2000, /* Stack size of task */
NULL, /* parameter of the task */
1, /* priority of the task */
&Task1, /* Task handle to keep track of created task */
0); /* pin task to core 0 */
Please note, I am still a beginner in the esp32 programming.
Thanks,
Zohair