how to point printf to uart in MSP430

Discussions on how to get your MSP JTAG programmer up and running.

Moderator: phalanx

Post Reply
s3034585
Posts: 27
Joined: Fri Jun 13, 2008 7:30 pm

how to point printf to uart in MSP430

Post by s3034585 » Tue Apr 07, 2009 6:56 am

Hi Guys,

Can some one pls tell how to point stdin/stdout to uart in MSP430F1232.
I am trying to debug the source code and want to use printf for debugging.

this processor has an uart, IAR has CLIB and DLIB libraries which do mention about printf option, but its not working...

thanks
tama

gm
Posts: 203
Joined: Fri May 04, 2007 3:08 pm

Post by gm » Tue Apr 07, 2009 7:33 am

You need to implement the __read() and __write() functions to reflect the hardware that you are using. The details can be found in the "Standard streams for input and output" section of the "MSP430 C/C++ Compiler Reference Guide" which is located under the Help menu.

gm

naz
Posts: 108
Joined: Thu Feb 12, 2009 11:31 pm

Post by naz » Tue Apr 07, 2009 9:56 pm

you should enable CLIB for printf function.

s3034585
Posts: 27
Joined: Fri Jun 13, 2008 7:30 pm

Post by s3034585 » Thu Apr 23, 2009 6:54 am

CLIB for printf function is by default directed to C spy terminal IO.

I wrote my own putchar which in turn directs this to UART.

Post Reply