[ECOS] Echo on tty/serial...

Gary Thomas gary@mlbassoc.com
Fri Sep 23 16:35:00 GMT 2005


On Fri, 2005-09-23 at 16:38 +0200, Stefan Sommerfeld wrote:
> Hi,
> >>>
> >>> I want to use the serial port from my eCos application. I tried to use
> >>> /dev/ttydiag, but i cannot disable the echo to the output. Every
> >>> cyg_io_read() causes the echo even if i disable it using tty_out_flags 
> >>> =
> >>> CYG_TTY_OUT_FLAGS_CRLF and tty_in_flags = 0. An important thing to know 
> >>> is,
> >>> that i'm using posix. Printf works flawless.
> >>>
> >>> Is there another serial device which i could use (and have to enable 
> >>> for my
> >>> ecos)? How could it work if i also use printf?
> >>
> >> Yes, use the "proper" serial driver. /dev/ttydiag is intended for
> >> diagnostic output and is very simple. It does not support the various
> >> flags needed to disable echos etc.
> >>
> >> Enabling CYGPKG_IO_SERIAL_DEVICES will cause the interrupt driver
> >> serial driver to be built. This then provides /dev/ser?. You will want
> >> to layer on top of that the tty driver. So enable
> >> CYGPKG_IO_SERIAL_TTY_TTY0 and set CYGDAT_IO_SERIAL_TTY_CONSOLE to
> >> /dev/tty0. You can then use the yg_io_set_config() calls as described
> >> at
> >> http://ecos.sourceware.org/docs-latest/ref/io-serial-driver-details.html.
> >> If you want to use termio you need to add the termio driver to the
> >> stack in the same way.
> >>
> >
> > Okay ...I enabled "Hardware serial device drivers", channel tty0, tried 
> > to disable the HAL/diag options, but i don't get any printf output 
> > anymore. The system reboots automatically after some seconds (maybe due 
> > to a printf buffer overflow). I'm not sure what inits the posix main call 
> > does. serial1 test is working.
> >
> > What's wrong? I need printf, but like to take over the control over the 
> > serial port by myself. I only have one serial port.
> 
> I played a bit with it ... diag_printf is working, but i cannot open tty0 
> or ser0. printf isn't working too.

Check that you have the device names correct (they differ from platform 
to platform).

> 
> Is there a why to force using diag_printf as printf replacement? How can i 
> use both diag_printf and open the serial port?

Once you manage to get the serial port to open (via /dev/xxx), this will
all just work out.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list