Page 1 of 1

ESP32 Arduino RTOS Stack size Allocation

Posted: Sun Mar 28, 2021 5:51 am
by comtustec
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. */

Re: ESP32 Arduino RTOS Stack size Allocation

Posted: Mon Mar 29, 2021 2:53 pm
by chegewara
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.

Re: ESP32 Arduino RTOS Stack size Allocation

Posted: Tue Apr 13, 2021 6:49 am
by comtustec
Okay Thank you