Quality RTOS & Embedded Software

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


Unable to use uxTaskGetStackHighWaterMark - Compiler Error

Posted by chu13279 on January 14, 2019


I'm currently having issue trying to use uxTaskGetStackHighWaterMark to see smallest amount of remaining space after it has ran a task for the first time. I'm using GNU GCC Compiler and I did make some changes to FreeRTOSConfig.h to make it possible to use uxTaskGetStackHighWaterMark.


define INCLUDE_uxTaskGetStackHighWaterMark 1


I have the task function defined as follows


include "FreeRTOS.h"
include "task.h"

UBaseTypet uxHighWaterMark; UBaseTypet uxTaskGetStackHighWaterMark(TaskHandle_t xTask);

void bc_tspr(void * pvParameters);

void bc_tspr(void * pvParameters) {

uxHighWaterMark = uxTaskGetStackHighWaterMark( NULL );

    // Data Integration Handler

    // Data Stacker Handler

    // Stacked Data Transmission Sector


    uxHighWaterMark = uxTaskGetStackHighWaterMark( NULL );

} ~~~

, and I create the task in the file as follows

~~~ extern void bctspr(void * pvParameters); xTaskCreate(bctspr, "BEAM", 4000, NULL, taskpriolvl_1, NULL); ~~~

However, even if I followed the example that I read in FreeRTOS Manual, it would generate compiler error as follows

~~~ undefined reference to `uxTaskGetStackHighWaterMark' collect2: ld returned 1 exit status ~~~

It'd be really appreciated if someone could help solve this issue. Thanks in advance.

Unable to use uxTaskGetStackHighWaterMark - Compiler Error

Posted by chu13279 on January 14, 2019


I rebuilt the project I was working from ground up again, and it still didn't work with the option uxTaskGetStackHighWaterMark. On the other hand, I was able to achieve similar goal I was trying to make it out with vTaskList.

Unable to use uxTaskGetStackHighWaterMark - Compiler Error

Posted by rtel on January 15, 2019

I've checked the .c file and setting INCLUDE_uxTaskGetStackHighWaterMark to 1 is all that is required to make the function available.

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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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

Cadence Tensilica Cortes

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