Quality RTOS & Embedded Software

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




Loading

sprintf not working with floating point after Scheduler started.

Posted by harryw12 on October 22, 2013

Hi, porting FreeRTOS7.5.3 on PSOC5LP using PSOC Creator 3.0(newlib included). where I found sprintf not working with floating point(got all NULL chars except the '.' after conversion) after FreeRTOS scheduler started (works before).

it looks like the newlib with PSOC Creator 3.0 might have the floating point funtion issue while in a multitasking env. newlib in PSOC Creator 3.0: the floating point functions works newlib in PSOC Creator 3.0 with FreeRTOS started: floating point functions does not work newlib in POSC Creator 2.1 with FreeRTOS started: floating point functions works

I don't know if this is relating to reentrant of newlib (included in PSOC Creator 3.0). But I enabled the macro #define configUSENEWLIBREENTRANT == 1 in FreeRTOSConfig.h, and memory allocation in the port is using heap2.c

Anyone can advise where to start on this issue? thanks.


sprintf not working with floating point after Scheduler started.

Posted by harryw12 on October 23, 2013

sprintf not working with floating point after Scheduler started.

Posted by richardbarry on October 23, 2013

This can happen if the stack is not correctly aligned to an 8 byte boundary - but the FreeRTOS code should ensure that it is. I have tried with configUSENEWLIBREENTRANT set to 1 (should not make any difference to alignment) and heap2.c and find the stack is aligned as expected when the task starts.

I assume your FreeRTOS version is very new as configUSENEWLIBREENTRANT was only introduced recently. Are you using V7.5.3 - as prior versions didn't initialse the reent structures until the first context switch, maybe if you are using it prior to the first context switch you would get a problem resulting in a stack mishap?

Regards.


[ 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