This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: printf of 64bit value on ARM


On 28/11/11 17:45, Jeff Johnston wrote:
> Edo,
> 
> Did you make sure to include stdio.h in your test case?  This can cause 
> problems with the variable parameter list.  If you have already included 
> stdio.h, I would suggest debugging _VFPRINTF_R in vprintf.c and 
> verifying the variable list long long parameter is being passed and 
> restored correctly on the other end (look at the arg_val union).  From 
> debugging, you should also verify that the long long code was enabled 
> properly.
> 

Perhaps even more important, for Cortex-M3 you have to either make sure
that the processor config bit STKALIGN is set, or you have to make sure
all top-level 'interrupt' routines are compiled with the 'interrupt'
attribute.

R.

> -- Jeff J.
> 
> On 11/27/2011 05:14 PM, Franzi Edo. wrote:
>> Hi,
>> I am trying to build a newlib for a Cortex M3 ARM capable to support the printf.
>> Everything works fine, but I have a strange behavior with the printf of 64bit values.
>>
>> If I execute this:
>>
>> ...
>> uint64_t val = 1LL;
>>
>> printf("value = %llu\n", val);
>> ...
>>
>> I got: value = 4294967296
>>
>> This sounds like a big-little endian problem. Any idea how to solve this problem?
>>
>> I uses the newlib 1.19.0 and gcc 4.6.2.
>> For the newlib configure I use these switches:
>>
>> 	--enable-newlib-io-long-long \
>> 	--enable-interwork \
>> 	--disable-libgloss \
>> 	--disable-newlib-supplied-syscalls"
>>
>> Thank's
>>    Edo.
>>
>>
> 
> 
> 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]