Quality RTOS & Embedded Software

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


Loading

uxTaskGetStackHighWaterMark return type

Posted by Toan Pham on June 5, 2012

Hi, i am running freertos an a 8bit xmega processor. I am trying to find the size of the unused stack space by using call to uxTaskGetStackHighWaterMark. However, uxTaskGetStackHighWaterMark returns portBASE_TYPE which is defined as unsigned char in portmacro.h. This is not good, for example if the total unused space is more than 255, calls to uxTaskGetStackHighWaterMark is subjected to rollover, and is inaccurate.

I looked further into uxTaskGetStackHighWaterMark and it makes another call to check unused stack size, which returns unsigned short, but get casted to port_BASE_TYPE in uxTaskGetStackHighWaterMark. Would it be better if uxTaskGetStackHighWaterMark returns unsigned short instead?


thanks

RE: uxTaskGetStackHighWaterMark return type

Posted by Richard on June 5, 2012
Yes - my bad - there is a change request on exactly that point already but I have not implemented it yet. For now, it is easy enough to edit the source code so a size_t is returned instead, but long term you don't want to be editing anything in the source code (maintenance nightmare when FreeRTOS changes) so I really need to do this in the main line. Apologies for not doing so already.

Regards.


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


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

Latest News

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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

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.


Careers

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

Renesas

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