Quality RTOS & Embedded Software

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


Loading

small suggestion / request

Posted by Ben on February 1, 2008
Can I ask for a small modification to FreeRTOS. I like the configUSE_TRACE_FACILITY option but I notice you are using sprintf to format the output, which has a rather large overhead by the time the appropriate library functions are included. It is something like 20k under GCC, while the RTOS code that gets included is only around 600 bytes.

As it happens I have my own cut down version of sprintf which of course I can easily substitute in task.c, but of course this will get over written should I upgrade it at any time, so my suggestion would be to add


#ifndef SPRINTF_FUNCTION
#define SPRINTF_FUNCTIONsprintf
#endif

to the top of task.c, and change

sprintf( pcStatusString, ( portCHAR * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );

to

SPRINTF_FUNCTION( pcStatusString, ( portCHAR * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );

that way it can easily be overridden from FreeRTOSConfig.h to point to an alternative function.


RE: small suggestion / request

Posted by woops_ on February 1, 2008
That is a good idea. There are two small sprintf implementations in the FreeRTOS code already. One in the cortex code and another somewhere I forget. Once of these could be used by default using this method.


[ 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