EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

CCE: How to point stdin and stdout to UART?

Started by jhilory33 January 27, 2009
With CCE, I have been unable to write my own putchar routine and have
it replace the one in the library. IAR allowed this, and works as
expected, but CCE gives me the following error at link:
error: symbol "putchar" redefined: first defined in "./TestIO.obj";
redefined in "C:/Program Files/Texas Instruments/CC Essentials
v3.1/tools/compiler/MSP430/lib/rts430x.lib"

I am using the free CCE recently downloaded from TI.com:
setup_CCE_3.2.3.6.4_MSP430_CE.exe. My target is MSP430F2618 interfaced
to a PC through a MSP430 USB Debugging Interface connected to a MSP430
64-Pin Socket Target Board.

Can anyone tell me how to make stdout and stdin use my own custom char
input/output routines, which use a UART on the MSP430?

Thanks in advance,
Jim Smith

Beginning Microcontrollers with the MSP430

in gcc,
you can open file stream as follows
FILE mystdout = FDEV_SETUP_STREAM(uart_send, NULL, _FDEV_SETUP_WRITE);
uart_send is a function that sends one character
uart_send(char c, FILE *unused)
inside int main() do something like stdout = &mystdout
Let me tell you that including stdio, stdlib and using printf leads to an
enormous increase in code+ram size which kind of offsets the ease of use....

On Wed, Jan 28, 2009 at 8:27 AM, jhilory33 wrote:

> With CCE, I have been unable to write my own putchar routine and have
> it replace the one in the library. IAR allowed this, and works as
> expected, but CCE gives me the following error at link:
> error: symbol "putchar" redefined: first defined in "./TestIO.obj";
> redefined in "C:/Program Files/Texas Instruments/CC Essentials
> v3.1/tools/compiler/MSP430/lib/rts430x.lib"
>
> I am using the free CCE recently downloaded from TI.com:
> setup_CCE_3.2.3.6.4_MSP430_CE.exe. My target is MSP430F2618 interfaced
> to a PC through a MSP430 USB Debugging Interface connected to a MSP430
> 64-Pin Socket Target Board.
>
> Can anyone tell me how to make stdout and stdin use my own custom char
> input/output routines, which use a UART on the MSP430?
>
> Thanks in advance,
> Jim Smith
>
>
>

--
Pratik Chaudhari

Tick "Search libraries in priority order" and Reread libraries options in
the C/C++ Build / MSP430 Linker options.



Pascal



De : m... [mailto:m...] De la part de
jhilory33
Envoy: 28 January 2009 03:57
: m...
Objet : [msp430] CCE: How to point stdin and stdout to UART?



With CCE, I have been unable to write my own putchar routine and have
it replace the one in the library. IAR allowed this, and works as
expected, but CCE gives me the following error at link:
error: symbol "putchar" redefined: first defined in "./TestIO.obj";
redefined in "C:/Program Files/Texas Instruments/CC Essentials
v3.1/tools/compiler/MSP430/lib/rts430x.lib"

I am using the free CCE recently downloaded from TI.com:
setup_CCE_3.2.3.6.4_MSP430_CE.exe. My target is MSP430F2618 interfaced
to a PC through a MSP430 USB Debugging Interface connected to a MSP430
64-Pin Socket Target Board.

Can anyone tell me how to make stdout and stdin use my own custom char
input/output routines, which use a UART on the MSP430?

Thanks in advance,
Jim Smith





The 2024 Embedded Online Conference