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: "mohanlal jangir" <mohanlaljangir at hotmail dot com>
- To: "Eric Doenges" <Eric dot Doenges at DynaPel dot com>
- Cc: <ecos-discuss at sources dot redhat dot com>
- Date: Sat, 20 Sep 2003 10:54:43 -0700
- Subject: Re: [ECOS] how to read from serial port 2 !!
- References: <Law11-OE36m1u51rMum000013ce@hotmail.com> <3F6ABC05.6000305@DynaPel.com>
> mohanlal jangir wrote:
> > 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?
>
>
> - 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.
I did change CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_DEFAULT to 1 (serial
port 2) while left CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL to 0(serial port
1). But still printf messages coming on serial port 1 where gdb is
connected.
> In order to do this, you must enable tty support for port 2
> with configtool.
Do I need to change anything else apart from the above mentioned changes.
Inside "serial device drivers" package, I see options like "TTY mode channel
#(0-2)" etc. But these are not selected for any channel, so I don't think I
need to select any of them for serial port 2.
> - 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.
I don't know, which is appropriate device file for serial port 2. I tried to
look into redboot code and found use of macros like
CYGACC_CALL_IF_SET_CONSOLE_COMM but did not find their definition. Where are
they defined? Where should I look for * appropriate device* for serial port
2
Regards
Mohanlal
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss