printf implementation in Codewarrior

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

printf implementation in Codewarrior

ソリューションへジャンプ
6,877件の閲覧回数
TTA
Contributor I
Hi,
I am using an MCF5282 evaluation board with Codewarrior and executing a simple  print helloworld function from the RAM.
My question is : Where is the implementation of the printf() function. Is it in some library?
 
Regard,
TTA
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
2,395件の閲覧回数
CrasyCat
Specialist III

Hello

   Yes in fact as soon as you are building Target "M5282EVB UART Debug", "M5282EVB UART Release", "M5282EVB External ROM" or "M5282EVB Internal ROM", printf is redirected to a UART. Per default it is redirected to UART0.

To switch to another UART, adjust functions in modules io.c or UART_Unity.c.

Note that you need to connect your target UART to a terminal or to a COM port to see terminal output.

I hope this helps.

CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
2,395件の閲覧回数
TTA
Contributor I

Hi CrasyCat,

Yes, Thank s a lot.

Regards,

TTA

0 件の賞賛
返信
2,395件の閲覧回数
TTA
Contributor I

Hi,

Thank you. I guess the printf uses one of the UARTs to push the messages to the terminal. One another question is that even when i am using a MCF5282 based custom designed board , i can use the printf library right? Just confirming.

Regards,

TTA

0 件の賞賛
返信
2,396件の閲覧回数
CrasyCat
Specialist III

Hello

   Yes in fact as soon as you are building Target "M5282EVB UART Debug", "M5282EVB UART Release", "M5282EVB External ROM" or "M5282EVB Internal ROM", printf is redirected to a UART. Per default it is redirected to UART0.

To switch to another UART, adjust functions in modules io.c or UART_Unity.c.

Note that you need to connect your target UART to a terminal or to a COM port to see terminal output.

I hope this helps.

CrasyCat

0 件の賞賛
返信
2,395件の閲覧回数
CrasyCat
Specialist III

Hello

Source code for printf can be found in module printf.c located in {Install}\E68K_Support\msl\MSL_C\MSL_Common\Src.

It is included in the MSL library (C_4i_CF_MSL.a) added to the project by the stationery.

CrasyCat

0 件の賞賛
返信