This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: how to read from serial port 2 !!
- From: Eric Doenges <Eric dot Doenges at DynaPel dot com>
- To: mohanlal jangir <mohanlaljangir at hotmail dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Fri, 19 Sep 2003 10:19:17 +0200
- Subject: Re: [ECOS] how to read from serial port 2 !!
- References: <Law11-OE36m1u51rMum000013ce@hotmail.com>
mohanlal jangir wrote:
I have gdb communicationg with redboot on serial port 1 (ARM Integrator
board). All printfs are dumped on serial port1 via gdb (this is output
channel set with configtool). Now I want my application to read from serial
port 2 (serial port 1 can't be used as gdb doesn't allow this while remote
debugging). How can read from serial port 2?
You have three choices:
- Reroute stdin/stdout to serial port 2 by setting the default console
device to /dev/ttyS1 and then use the normal stdio C library
functions. In order to do this, you must enable tty support for port 2
with configtool.
- Open the appropriate device file using POSIX file IO calls. This will
require including the appropriate packages for POSIX file IO. Please
note that while I believe this should work, I've never tried it
myself.
- Use eCos' IO API and talk to the serial port 2 device directly.
--
--------------------------------------------------------------------
| Eric Doenges | DynaPel Laboratories GmbH |
| Tel: +49 89 962428 23 | Fraunhoferstrasse 9/2 |
| Fax: +49 89 962428 90 | D - 85737 Ismaning, Germany |
--------------------------------------------------------------------
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss