cancel
Showing results for 
Search instead for 
Did you mean: 

UART - printf on Hyperterminal - STR750 EVAL

xaviooo
Associate II
Posted on April 06, 2007 at 13:30

UART - printf on Hyperterminal - STR750 EVAL

4 REPLIES 4
xaviooo
Associate II
Posted on April 06, 2007 at 08:11

Hi,

I'm currently trying to display some messages (necessary to debug a more complex application) on the HyperTerminal of Windows, using an UART.

I'm working with a STR750-EVAL and the Raisonance IDE (with RLINK).

The AN : UM0218 gives a useful example of what i'm trying to do (readme, headers, sources...). (/examples/uart/example 6)

My problem is that this example doesn't work. I get nothing on the Hyperterminal when I call the printf function, although I get something when I use the function Uart_SendData().

The main3.c contains a function fputc who is supposed to retarget the C library printf function to the UART.

Is this example supposed to work ? (with Raisonance IDE, Rlink, and the files I have attached).

Should I re-implement the fputc function in main3.c ?

Should I add something else in the ''.c'' files ?

Thank you in advance.

________________

Attachments :

UART_printf_STR750.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtIh&d=%2Fa%2F0X0000000aLH%2FM13fjexAeH0BZY6VkJHmDXdoWSXZx2iX6jxLdY9Uh_g&asPdf=false
vincentchoplin9
Associate II
Posted on April 06, 2007 at 08:14

Hi,

The printf function will call putchar function in the end. So it is putchar, not fputc, that you need to rewrite.

Or you can use the default UART0_putchar. See this example:

c:\ride\examples\strx\test

Best Regards,

Vincent

vincentchoplin9
Associate II
Posted on April 06, 2007 at 08:18

You will also find some information on the UART0_putchar in this doc:

(in RIDE) ''help''->''PDF''->''STRX-Tools''->''Getting Started STRX''

look in the section about the library options. (section 2.5.1.1, page 14, in the latest version)

Vincent

xaviooo
Associate II
Posted on April 06, 2007 at 13:30

Thank you for you answer.

For people who are using this example, use the UART1 although the library is called Uart0... (I lost 2 hours :p)