Page 1 of 1

Incorrect work vTaskList()

Posted: Thu Nov 02, 2023 7:37 am
by zhukovia
I am trying to use a function vTaskList() to get the stack size when my program is running. But I always get the allocated stack size, not the actually used one. How do I see how much memory is actually filled?
By running the same subroutine with different stack sizes, I get different sizes of occupied memory, but it should be the same. Or do I not understand something?

Code: Select all

xTaskCreatePinnedToCore(bmp280, "bmp280_first", 10000, NULL, 5, NULL, APP_CPU_NUM);
xTaskCreatePinnedToCore(bmp280, "bmp280_second", 3096, NULL, 5, NULL, APP_CPU_NUM);
mqtt task________________B________5________1104________23________-1
bmp280_second________B________5________1008________18________1
bmp280_first___________B________5________10204________17________1
netif rx task____________B________5________2212________22________-1

Re: Incorrect work vTaskList()

Posted: Thu Nov 02, 2023 10:11 pm
by MicroController
The numbers you're getting are what FreeRTOS calls the "stack high water mark", which is
the minimum amount of remaining stack space that was available to the task since the task started executing - that is the amount of stack that remained unused when the task stack was at its greatest (deepest) value.

Re: Incorrect work vTaskList()

Posted: Fri Nov 03, 2023 8:26 am
by zhukovia
So it turns out that this is not an occupation, but a free place?