Quality RTOS & Embedded Software

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


C Standard Libraries for Real-Time?

Posted by Tenacious Techhunter on August 12, 2011
For those of you using ARM gcc, you know the question of what C Standard Library to use has to be made before you even compile your toolchain. I’m trying to figure out what toolchain to use with FreeRTOS, and other Real-Time systems like it; preferably something built to produce hard-real-time code.

I would guess that an appropriate C Standard Library would be thread-safe and reentrant. Of course, there has also been some mention of problems when Yagarto went with the reentrant version of newlib. Is there something about FreeRTOS that doesn’t play well with reentrant code?

What C Standard Library is best for Hard-Real-Time projects?

RE: C Standard Libraries for Real-Time?

Posted by Dave on August 12, 2011
There is not much in FreeRTOS that needs reentrant code. No library functions used by FreeRTOS are not reentrant. If your application uses functions that are not reentrant then you can guard the functions yourself using mutexes or other semaphores. FreeRTOS does not attempt to keep a library context for each task, for example there is no errno per task. If you search this formum hard enough you will find posts that show how people have modified the TCB to had a pointer to their own newlib context, but my advice is, if you are using a microcontroller with limited memory, stay away from newlib. The definition of 'small' is relative. Many GCC vendors provide their own libraries (Rowley and Code Red to name two), and FreeRTOS ships with a third party printf/sprintf implementation that is ultra small and reentrant, but does not provide floating point support.

RE: C Standard Libraries for Real-Time?

Posted by Tenacious Techhunter on August 12, 2011
Well yes, but I need reentrancy and thread-safe for my own needs... While I could block off code that is reentrant, I'd prefer to have to do that as little as possible. I didn't even consider what FreeRTOS needed until I heard there was trouble with the reentrant version of newlib. A useful post, but doesn't quite answer my questions.

[ 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.

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