Hello,
I asked this in the MSP430 forum a week ago but didn't get a response.
I've done a ton of programming for the MSP430 using IAR but wanted to try out CCS. I have the full version of CCS for MSP430 and want to run a simple "Hello World" application using printf(). I don't care about code space; I'm using a big MSP430F5529. How do I do this? I looked around but didn't see anything. In IAR you just need to supply a putchar function in your code somewhere; IAR will find it and use it in stdio.h. So I did, with a simple little putchar that sends bytes out the UART and works fine in IAR.
/** Send one byte via hardware UART. Called by printf() etc. in stdio.h */
int putchar(int c)
{
while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF = c; // TX character
return c;
}
When I attempted to compile this same code in CCS, I got a linker error:
<Linking>
error #10056: symbol "putchar" redefined: first defined in "./hal_mcb.obj";
redefined in "C:\ti\ccsv5\tools\compiler\msp430\lib\rts430x.lib<fputc.obj>"
So how do I do this in CCSv5? It only takes 30 seconds to do this in IAR; I assume it's that easy in CCS but I just haven't seen it yet. Of course the implementation of putchar is project dependent; for this project I do it one way but if I'm using a different UART then I'll want it implemented a different way.
Is there a simple little app note that I missed somewhere? I've seen this question asked before on the forums without much in the way of a good answer; it might be worth writing a little wiki page for it.
Thanks,
Derek

