printf function and M5213EVB

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

printf function and M5213EVB

3,629 Views
airswit
Contributor III
Hi everyone,

I was wondering if anybody can tell me what all I need (files, project options, etc) in order to successfully use the printf function? I can get it to work in the 'power measurement utility' sample project, but not in my own. I have been trying to look through the code in that project to see if there is some initialization needed for the serial port, but can't seem to spot anything. I have tried to add the printf.c file to my project, but it says that a few of the functions are defined more than once. Also, before I added the file, the 'printf' keyword was recognized, and when i right clicked on the word and said 'go to definition', it took me to the printf.c file. Any pointers?


Thanks,

Trevor
Labels (1)
0 Kudos
Reply
3 Replies

1,003 Views
tequila
Contributor I
Did you try including stdio.h ? (Use <> instead of "").
0 Kudos
Reply

1,003 Views
airswit
Contributor III
yep, that's included also. my includes at this time are:

#include
#include "common.h"
#include "mcf5xxx.h"
#include "mcf5213.h"
#include "m5213evb.h"


though i'm sure most are redundant. I don't have the 'uif.h' file, but is this necessary?
0 Kudos
Reply

1,003 Views
mnorman
NXP Employee
NXP Employee
If you are using the sample code from the web, then printf (provided in the common files) will work as is. Consult the example project which does use printf(). The UART used and baud rate are defines in m5213evb.h

If you are using the CodeWarrior stationary or started code from another toolchain, then you should be able to find examples in the sample code provided with those toolchains.

-MN
0 Kudos
Reply