ESP32 Arduino RTOS Stack size Allocation

comtustec
Posts: 4
Joined: Fri Aug 17, 2018 12:50 pm

ESP32 Arduino RTOS Stack size Allocation

Postby comtustec » Sun Mar 28, 2021 5:51 am

Dear All,

How to calculate total stack size in bytes on esp32 WiFi Module. And also how to Allocate stack size in xTaskCreate.


xTaskCreate(
taskOne, /* Task function. */
"TaskOne", /* String with name of task. */
10000, /* Stack size in bytes. */
NULL, /* Parameter passed as input of the task */
1, /* Priority of the task. */
NULL); /* Task handle. */

chegewara
Posts: 2228
Joined: Wed Jun 14, 2017 9:00 pm

Re: ESP32 Arduino RTOS Stack size Allocation

Postby chegewara » Mon Mar 29, 2021 2:53 pm

It all depends how will you use the task. Good starting point is 4kB and from here you can use this function to see if its too much
https://docs.espressif.com/projects/esp ... skHandle_t
When it is too few then usually you will get crash, like "Smash stack protection" or just guru meditation crash.

comtustec
Posts: 4
Joined: Fri Aug 17, 2018 12:50 pm

Re: ESP32 Arduino RTOS Stack size Allocation

Postby comtustec » Tue Apr 13, 2021 6:49 am

Okay Thank you

Who is online

Users browsing this forum: No registered users and 50 guests