2008-01-09 10:11:00     Send Data over UART1

Document created by Aaronwu Employee on Sep 18, 2013
Version 1Show Document
  • View in full screen mode

2008-01-09 10:11:00     Send Data over UART1

Pawel Pastuszak (CANADA)

Message: 49397    In u-boot trying to send data like "Hello World" over the UART1 connecting.

 

So my question is how can i talk over serial connect aka UART1 in u-boot. for blackfin 537

QuoteReplyEditDelete

 

 

2008-01-09 10:36:24     Re: Send Data over UART1

Robin Getz (UNITED STATES)

Message: 49398    Pawel:

 

printf() doesn't work?

 

have a look at: u-boot-1.1.6/examples/hello_world.c

 

-Robin

QuoteReplyEditDelete

 

 

2008-01-09 10:54:46     Re: Send Data over UART1

Phil Wilshire (UNITED STATES)

Message: 49401   

Here is a possible solution...

 

To use uart 1 you will have to duplicate or extend the code in

cpu/blackfin/serial.c

To use the second uart as well as the standard uart.

 

then you could use your new routine

 

puts1("hello world");

 

 

 

IF you want printf to the second port consider something like this

 

void printf1 (const char *fmt, ...)

{

        va_list args;

        uint i;

        char printbuffer[CFG_PBSIZE];

 

        va_start (args, fmt);

 

        /* For this to work, printbuffer must be larger than

         * anything we ever want to print.

         */

        i = vsprintf (printbuffer, fmt, args);

        va_end (args);

 

        serial_puts1 (printbuffer);

}

 

where serial_puts1 id your new routine for uart1

 

Look in  common/console.c for more printf details

 

  Phil Wilshire

QuoteReplyEditDelete

 

 

2008-01-09 11:02:19     Re: Send Data over UART1

Pawel Pastuszak (CANADA)

Message: 49402    Hi Phil,

 

This is more what i was looking for....

 

i was trying to uses the following:

 

  serial_init();

  serial_puts("\nTest\n");

 

 

But i couldn't figure out where to specify the UART1 as serial connection and set the buad speed for it.

 

 

Pawel

QuoteReplyEditDelete

 

 

2008-01-09 13:10:15     Re: Send Data over UART1

Mike Frysinger (UNITED STATES)

Message: 49409    u-boot allows you to set the console to any UART, and then that is the only UART the code will work with

 

if you want to write data to any other UART than the console, then you will need to write all the functions yourself.  as Phil said, you will need to duplicate existing code.  it is up to you to set the baud speed and do port muxing and all that stuff.

QuoteReplyEditDelete

 

 

2008-01-09 16:37:04     Re: Send Data over UART1

Robin Getz (UNITED STATES)

Message: 49417    Pawel:

 

Sorry - I missed it was UART1.

 

-Robin

QuoteReplyEditDelete

 

 

2008-01-09 19:52:39     Re: Send Data over UART1

Pawel Pastuszak (CANADA)

Message: 49421    Thanks Mike,

 

For the extra information, i guess i am create UART1 support  in u-boot,.

 

 

Pawel

Attachments

    Outcomes