***ERROR*** A stack overflow in task main has been detected.

smit.italiya
Posts: 6
Joined: Fri Feb 14, 2025 12:51 pm

Re: ***ERROR*** A stack overflow in task main has been detected.

Postby smit.italiya » Sat Feb 15, 2025 9:37 am

chegewara wrote:
smit.italiya wrote: #define configSTACK_DEPTH_TYPE uint32_t

it takes uint32_t ,so we can say that 256 bytes is enough for esp_logi also i tried with increasing the stack size by 1024 but got the same output. anything else did i wrong in the code?
Actually not. Espressif version freertos we are using is using uint8 in stack depth.
Small tip here:
- minimum stack size is 1500-2000
- with logs, printf, sprintf etc its safe to start with stack size 3500-4000
Thanks for your tip, I increased stack size by 2024 but after increasing the stack size i got another error related to watch dog,

**ERROR**
E (15317) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
E (15317) task_wdt: - IDLE0 (CPU 0)
E (15317) task_wdt: Tasks currently running:
E (15317) task_wdt: CPU 0: main
E (15317) task_wdt: CPU 1: IDLE1
E (15317) task_wdt: Print
CPU 0 (current core) backtrace

Then i searched online and found solution that guy suggest to - Not Set The Watchdog of IDEAL task for both core 0 and 1 from menuconfig that it i did not got any error on Monitor window but this is the right way ? any effect on running FreeRTOS task ?

Bryght-Richard
Posts: 65
Joined: Thu Feb 22, 2024 3:59 pm

Re: ***ERROR*** A stack overflow in task main has been detected.

Postby Bryght-Richard » Mon Feb 17, 2025 3:23 pm

while(1) {
ESP_LOGI(TAG, "While loop!!");
//nothing to do
}


^^^This main loop is the probably triggering the watchdog. It never suspends.

Who is online

Users browsing this forum: floitsch_toit and 114 guests