printf implementation in Codewarrior

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

printf implementation in Codewarrior

Jump to solution
5,617 Views
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
Labels (1)
0 Kudos
1 Solution
1,135 Views
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

View solution in original post

0 Kudos
4 Replies
1,135 Views
TTA
Contributor I

Hi CrasyCat,

Yes, Thank s a lot.

Regards,

TTA

0 Kudos
1,135 Views
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 Kudos
1,136 Views
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 Kudos
1,135 Views
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 Kudos