Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


uxTaskGetStackHighWaterMark returns an randomly oscillating value

Posted by tomasvalno on June 26, 2017

Hi all, I've using freertos for a while now and specially the uxTaskGetStackHighWaterMark to empirically scale the stack for my tasks. My problem now is that when I call this function for one of my active tasks, it does not return a fixed or decreasing value( as it's supposed to be) but instead it increases and decreases randomly each time i call this function. I tried to call uxTaskGetStackHighWaterMark within the task, outside of it and from a software timer, but in all cases presents the same behavior. In the task there is never an overflow, nor is it suspended or deleted and re-created. It is simply a task waiting for a semaphore to be executed, which is freed on an interrupt of an ADC. Also, I've checked that the variable I use to store and log this stack usage is not accessed by in other point of the code, no even by some incorrectly used pointer. This behavior doesn't not cause ( apparently ) any trouble with the normal execution of the application, but I need to be sure that it's not cause by a hidden bug tat causes my application to crash in the future.

Regards, Tomas

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Meet Richard Barry and learn what's new in the FreeRTOS project at Embedded World 2019

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers



STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner