printf function and M5213EVB

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

printf function and M5213EVB

4,226件の閲覧回数
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,600件の閲覧回数
tequila
Contributor I
Did you try including stdio.h ? (Use <> instead of "").
0 件の賞賛
返信

1,600件の閲覧回数
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,600件の閲覧回数
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 件の賞賛
返信