Incorrect work vTaskList()

zhukovia
Posts: 7
Joined: Tue Oct 31, 2023 5:25 am

Incorrect work vTaskList()

Postby zhukovia » Thu Nov 02, 2023 7:37 am

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

MicroController
Posts: 1708
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Incorrect work vTaskList()

Postby MicroController » Thu Nov 02, 2023 10:11 pm

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.

zhukovia
Posts: 7
Joined: Tue Oct 31, 2023 5:25 am

Re: Incorrect work vTaskList()

Postby zhukovia » Fri Nov 03, 2023 8:26 am

So it turns out that this is not an occupation, but a free place?

Who is online

Users browsing this forum: Gaston1980 and 116 guests