This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to read from serial port 2 !!


mohanlal jangir wrote:

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.

I don't know how the HAL virtual vectors work, but I don't think you are changing the correct options. Fire up 'configtool' and go to the "Serial device drivers" section. There. enable "TTY mode" for channel #1. Also there, you can see that eCos names it's serial device drivers /dev/serX by default, with X being the number of the port (note that eCos starts counting at zero instead of one).

However, this is _not_ enough to redirect standard in & out. To do so,
you must also tell the standard C library which device to use. Go to the
"Standard C library" section and then select "ISO C library standard
input/output functions". You need to change the option "default console
device"; set this to /dev/tty1. You could also use /dev/ser1 directly;
however then you do not have the line editor that TTY mode supplies.

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.

Well, if you want to use TTY mode for a serial channel then obviously you must select that option if it is not already selected.

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

Look at the "Serial device drivers" section in configtool (see above). Since there isn't all that much useful eCos documentation around, you will eventually end up looking at the source code. For device drivers, the device name eCos uses is usually defined in the platform-specific .inl file, found in the <...>/packages/devs/<device type>/<platform>/<target>/.../include/ hierachy. -- -------------------------------------------------------------------- | 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]