Stack overflow & heap monitoring

dejan.ns
Posts: 5
Joined: Fri Dec 15, 2017 11:03 pm

Stack overflow & heap monitoring

Postby dejan.ns » Fri Dec 22, 2017 12:45 pm

I know there is uxTaskGetStackHighWaterMark FreeRTOS function which can be used to get the minimum size of unused task stack, but I wonder if there is a ESP-IDF way of achieving this.

Also I would like to know what is the best method for watching the free heap size.

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: Stack overflow & heap monitoring

Postby ESP_Sprite » Fri Dec 22, 2017 2:17 pm

Esp-idf uses FreeRTOS as its RTOS, so you can happily use uxTaskGetStackHighWaterMark. For the free heap size, you can use heap_caps_get_free_size(MALLOC_CAP_DEFAULT|MALLOC_CAP_8BIT). (Or use any other cap if you want to know stuff about the more specialized heap regions.)

Who is online

Users browsing this forum: No registered users and 95 guests