uxTaskGetStackHighWaterMark Appears to be in Bytes

oklambdago
Posts: 19
Joined: Mon Mar 15, 2021 12:54 pm

uxTaskGetStackHighWaterMark Appears to be in Bytes

Postby oklambdago » Tue Mar 23, 2021 2:38 pm

Hi All,

Per the documentation, uxTaskGetStackHighWaterMark is supposed to be in words: https://docs.espressif.com/projects/esp ... skHandle_t

However, this does not appear to be so. When I create a task, I am clear the task stack size is specified in bytes: https://docs.espressif.com/projects/esp ... skHandle_t

However, when I call uxTaskGetStackHighWaterMark on a task with a stack size of 8192 bytes, I am getting back values like 6036. This value only makes sense if the value it returns is in bytes. Otherwise it would mean the minimum free was ~24k, which greatly exceeds the value I specified for the task size in xTaskCreate().

Can someone clarify if the documentation is wrong on this?

Thanks!

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

Re: uxTaskGetStackHighWaterMark Appears to be in Bytes

Postby chegewara » Tue Mar 23, 2021 6:05 pm

Hi,
this is just copy/paste error.
Vanilla freertos is using dword for creating task and stack watermark. esp-idf is using bytes as base size in both functions.

oklambdago
Posts: 19
Joined: Mon Mar 15, 2021 12:54 pm

Re: uxTaskGetStackHighWaterMark Appears to be in Bytes

Postby oklambdago » Tue Mar 23, 2021 9:07 pm

Thanks! That is a very helpful thing to know. Hopefully there are plans to update the documentation soon!

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: uxTaskGetStackHighWaterMark Appears to be in Bytes

Postby ESP_Angus » Tue Mar 23, 2021 11:52 pm

Hi oklambdago,

Thanks very much for pointing this out, sorry for the confusion. It looks like a regression in the function's doxygen comment when we updated to FreeRTOS 10 (the docs for the stable ESP-IDF version has the correct description).

I've just submitted a fix for this internally.

Who is online

Users browsing this forum: No registered users and 63 guests