printf implementation in Codewarrior

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

printf implementation in Codewarrior

跳至解决方案
5,637 次查看
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 解答
1,155 次查看
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 回复数
1,155 次查看
TTA
Contributor I

Hi CrasyCat,

Yes, Thank s a lot.

Regards,

TTA

0 项奖励
1,155 次查看
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 项奖励
1,156 次查看
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 项奖励
1,155 次查看
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 项奖励