Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists