How to direct printf() to console or UART or other peripherals?

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

How to direct printf() to console or UART or other peripherals?

1,256 Views
tmf
Contributor I

How do you change the peripheral that will receive the printf() calls?

 

I guess it defaulkts in CW to console, I would like it to be a UART.

 

Thanks!

Labels (1)
0 Kudos
4 Replies

536 Views
JohnBabrick
Contributor II

I also need to knw how to correctly redirect console IO in the tower bareboard application to the serial port. I know how to do it under MQX, but not under a non-MQX project.

0 Kudos

536 Views
HZ
Contributor I

I have the same question on codewarrior 8.8 for MPC8306 chip, I used project wizard to generate one project which puts out a message to the UART terminal on the MPC8306_SOM evaluation board, when I looked through the project, I saw it includes a library output file "UART2_8306_SOM.UC.a", but there is no ".h" file associated with it also when I am stepping through the project from .reset or __start, I didn't see it called any function to initilize the UART, but the board do put out message into the UART terminal.

 

I want to know how to change the baudrate and other setups such as re-direct printf function into another UART on my own board.

0 Kudos

536 Views
CrasyCat
Specialist III

Hello

 

  - Which CPU are you targeting (HC08, HC12, Coldfire, ..)
  - Which version of CodeWarrior are you using?

CrasyCat

0 Kudos

536 Views
tmf
Contributor I

CW10.1 and Kinetis

 

Thanks.

0 Kudos