cancel
Showing results for 
Search instead for 
Did you mean: 

sprintf

paolo239955_stm1
Associate II
Posted on April 09, 2009 at 12:21

sprintf

2 REPLIES 2
paolo239955_stm1
Associate II
Posted on May 17, 2011 at 11:32

Hi all,

I am in big trouble with my app, EWARM 5.20 + uC/OS II. I have a task writing a floating on an output buffer, like this:

char outval[16];

float me->INval__ = 123.456;

sprintf (outval, ''%f'', me->INval__);

well, sprintf writes randomly ''0.000'' or ''-nan'' (or other garbage) to outval buffer.

I stepped thru all the (s)printf assembler to check the stack pointer, it stays inside his bounds. I tried changing from ARM mode to THUMB mode, no relief. The strangest thing of all, if I put a simple sprintf loop in main task without creating any other task sprintf woks well. Something to do with task switching ?

I am desperate , please help !

paolo239955_stm1
Associate II
Posted on May 17, 2011 at 11:32

sorry, wrong forum....I'll repost on ARM9 STR9 forum