Simple Printf on CF question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simple Printf on CF question

4,004 Views
dvona
Contributor II

I'm trying to do a simple print of a floating point number out of a UART, and cannot figure out why I can’t seem to use a printf statement to display floating point values? For example

printf("\ntest printf with float = %5.2f", 1.23456);

results in just the letter “f” printed from hyperterminal: test printf with float = f.

Is there something I need to do because I am not on a floating point machine to enable printf to print floats?

 

Labels (1)
0 Kudos
2 Replies

506 Views
nanoGeek
Contributor I
Make sure your project is not using a simpler version of printf (printD and/or printk).  One of the projects I have imported in the past (dbug for CF) uses printD which calls printk (which has no floating point support) with a #define printf printD.
 
0 Kudos

506 Views
CrasyCat
Specialist III
Hello
 
 It works for me.
 
 Which version of Codefire tools are you using (V6.2, ...)?
 Did you include the file stdio.h at the beginning of the source file?
 
 Which runtime libraries are you linking to your application?
 For which CPU are you generating code (MCF5282, ...)?
 
CrasyCat
0 Kudos