printf function and M5213EVB

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

printf function and M5213EVB

4,227 次查看
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
标签 (1)
0 项奖励
回复
3 回复数

1,601 次查看
tequila
Contributor I
Did you try including stdio.h ? (Use <> instead of "").
0 项奖励
回复

1,601 次查看
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 项奖励
回复

1,601 次查看
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 项奖励
回复