problem to used printf - MC9S08JM60.

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

problem to used printf - MC9S08JM60.

1,815 Views
roop
Contributor I
hi,
I am using a Code warrior version V6.2 and my target micro controller is MC9S08JM60.When I used printf, I am getting link error.

I want to see an output on a terminal; for that I want to use printf to check a program when it is running.

Which lib file include to use printf?

thanks.
 
 
 
Added p/n to subject.


Message Edited by NLFSJ on 2008-08-28 06:39 AM
Labels (1)
0 Kudos
3 Replies

269 Views
Lundin
Senior Contributor IV
stdio.h

On theory is that the problem appears because you haven't choosen float numbers when you created the project. It wouldn't surprise me if you need to have float numbers to get that function working.

What linker error are you getting?
0 Kudos

269 Views
JimDon
Senior Contributor III
As far as I  know, you will also have to use sprintf and send it to the serial port your self.
Also, last I checked the MC9S08JM60 is not a 16-bit MCU.


0 Kudos

269 Views
CrasyCat
Specialist III
Hello
 
I assume you get a message that TERMIO_PutChar is not available. Am I right?
 
This is because you do not have any low level functions writing to the test to stdout linked to your application. First you have to determine (decide) which device you want to use as console output (stdout).
 
In order to be able to use printf in your application you need to link a module containing an implementation of function
   TERMIO_Init and TERMIO_PutChar.
 
TERMIO_Init should include code to initialize the device you want to use for stdout (SCI, ...).
Its prototype is void TERMIO_Init(void);
 
TERMIO_PutChar should include code to write a character to stdout.
Its prototype is void TERMIO_PutChar(char ch);
 
I hope this helps.
 
 
CrasyCat
0 Kudos