This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IAR's Printf() using UART

Other Parts Discussed in Thread: MSP430F2274

Hello everyone!

I'm trying to output the UART of a MSP430F2274 in terminal, using the printf() function from IAR 5.4. 

  1. I'm not quite sure about how should I redirect the printf function to UART but I'm pretty sure I should do something in the linker configuration.... After declaring the new putchar function,  Does anyone knows what should be done?
Thanks a lot!

  • By default, the linker is linking a default putchar funciton from teh standard library which is rather a dummy. The debugger places a breakpoint there and intercepts any byte printf tries to send.
    If you write your own putchar function, this one will be linked instead and coan do with the bytes from printf whatever it likes. Includign sending them through UART.
    No need to change anything anywhere, Jsu tprovide the funciton,. If the linker finds one in your object code, it doesn't look in the standard library for one.

**Attention** This is a public forum