This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_io_write & printf
Jonathan Larmour <jlarmour@redhat.com>:
> Wolfram Kattanek wrote:
> >
> > Gary Thomas <gthomas@cambridge.redhat.com>:
> >
> > > > - Is it possible to use both cyg_io_write and printf when only one physical
> > > > serial port is available?
> > >
> > > Yes, there is an option to get diagnostic output to basically go through 'cyg_io'
> >
> > But this doesn't solve the above problems concerning mix of interrupt driven and
> > polled output or am I wrong about that?
>
> The point really is don't use printf or cyg_io_write from cyg_user_start().
> Create a thread (or use main() ) and do it from there.
>
> You can make printf() stop using the diagnostic output, and instead use the
> interrupt-driven serial driver by setting CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE
> to /dev/tty0 from /dev/ttydiag in the configuration tool (or CDL).
>
> Another thing that explains the behaviour you were getting before when the
> output was done in the wrong order (but not mixed) is that when you drop
> off the end of cyg_user_start(), the scheduler is then started. That's why
> the polled output works, immediately, but the cyg_io_write() had to wait
> until interrupts were enabled, which happens when the scheduler is started.
Thank you for your explanation! I've changed CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE
(in my case to /dev/tty1) and everything works fine now.
Wolfram
--
Wolfram 'L.A.' Kattanek Institut fuer Mikroelektronik- und
Email: LA@imms.de Mechatronik-Systeme (IMMS) gGmbH
Tel: +49 3677 / 6783-55 Langewiesener Str. 22
Fax: +49 3677 / 6783-38 98693 Ilmenau / Germany
-------------------------------------------------
This mail sent through IMP: imp.imms.de