Quality RTOS & Embedded Software

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




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 ]    [ Sitemap ]    [ ]




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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