1

Given below is a short version of the Arduino code I used to program ESP32-S3. On some occasions the program crashes and unlike normal crashes this one get stuck there without Auto-resetting

static void setup2()
{
    Serial.println("Setup (runnning on 2nd core)");
}

static void loop2() {

HandleConfigButton();
HandleActivity();

// To resolve core panic because of Watch Dog Timer not being reset
delay(1);

}

// This is task running on the second core of ESP32 void TaskOnCore2( void * pvParameters ){ Serial.print("Task running on core "); Serial.println(xPortGetCoreID());

// One time setup
setup2();
for (;;)
{
    // Loop function
    loop2();
}

}

TaskHandle_t HandleTaskOnCore2; void LaunchLoopOnSecondCore() {

xTaskCreatePinnedToCore(
            TaskOnCore2,         /* Task function. */
            "TaskOnCore_2",      /* name of task. */
            10000,               /* Stack size of task */
            NULL,                /* parameter of the task */
            1,                   /* priority of the task */
            &HandleTaskOnCore2,  /* Task handle to keep track of created task */
            ESP32_SECOND_CORE);  /* pin task to second core */

}

void setup() { Serial.begin(9600); LaunchLoopOnSecondCore();

}

void loop() { HandleActivity(); }

The Crash Log:

Task running on core 0
Setup (runnning on 2nd core)Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (ipc1)
Core  1 register dump:
PC      : 0x4037db37  PS      : 0x00060036  A0      : 0x8037c750  A1      : 0x3fcf1b10
A2      : 0x3fc94510  A3      : 0xb33fffff  A4      : 0x0000cdcd  A5      : 0x00060023
A6      : 0x00060023  A7      : 0x0000abab  A8      : 0xb33fffff  A9      : 0xffffffff
A10     : 0x00000000  A11     : 0x3fc94450  A12     : 0x7e140000  A13     : 0x08bb0000
A14     : 0x02c94510  A15     : 0x00ffffff  SAR     : 0x0000000e  EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000

Backtrace: 0x4037db34:0x3fcf1b10 0x4037c74d:0x3fcf1b50 0x4037b02c:0x3fcf1b80 0x4037b022:0xa5a5a5a5 |<-CORRUPTED

ELF file SHA256: d451f74eeae971ec

I used ESP Exception Decoder and got this result

PC: 0x4037db37EXCVADDR: 
0x00000000

Decoding stack results

0x4037db34: xPortEnterCriticalTimeout at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_hw_support/include/soc/compare_set.h line 25 0x4037c74d: vTaskSwitchContext at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/freertos/port/xtensa/include/freertos/portmacro.h line 578

Can Someone explain what is wrong here ? I am clueless here.

AmalMP
  • 11
  • 1

0 Answers0