This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
serial port problems with e7t
- From: F dot T dot Nilsson at hw dot ac dot uk
- To: ecoss discussion forum <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 14 May 2003 16:54:33 +0100 (BST)
- Subject: [ECOS] serial port problems with e7t
Hi all,
I am currently developing a simple serial port application for an arm e7t
board. I complied and executed the example program serial.c, which uses
dev/haldiag this works fine with the cyg_io_write. But I need to use both
the ports on my arm board so I developed an application using /dev/ser1 and
ser0 although the handles are found it does not seem to work with
cyg_io_write/read i.e. I don?t get any output. I found a previous posting
on the discussion forum with the same problem and a reply with an example
that uses dev/tty1 on top of the serial. I tried this but the code cannot
find the handle for the tty.
My build is the e7t default template with hardware serial device drivers,
TTY mode serial device driver and flow control and I am compiling my
application with the install/lib and include but the tty cannot be found.
If anyone could give me a hand I would appreciate it.
my code
err = cyg_io_lookup( "/dev/ser1", &handle_ser1 );
if (ENOERR == err) {
printf("Found /dev/ser1.....\n");
}
else {printf("could not find handle for ser1");}
err = cyg_io_lookup("/dev/tty1",&handle_tty1);
if (ENOERR == err) {
printf("Found /dev/tty1.....\n");
}
else {printf("could not find handle for tty1");}
serial_1.baud = CYGNUM_SERIAL_BAUD_38400;
serial_1.stop = CYGNUM_SERIAL_STOP_1;
serial_1.parity = CYGNUM_SERIAL_PARITY_NONE;
serial_1.word_length = CYGNUM_SERIAL_WORD_LENGTH_8;
serial_len = sizeof(serial_1);
printf("BAUD: %d, STOP: %d, PARITY: %d, WORDLENGTH: %d" , serial_1.baud,
serial_1.stop, serial_1.parity, serial_1.word_length);
err = cyg_io_set_config(handle_ser1, CYG_IO_SET_CONFIG_SERIAL_INFO, (void*)
(&serial_1), &serial_len);
tty_1.tty_out_flags = CYG_TTY_OUT_FLAGS_DEFAULT;
tty_1.tty_in_flags = CYG_TTY_IN_FLAGS_DEFAULT;
serial_len = sizeof(tty_1);
cyg_io_set_config(handle_tty1,CYG_IO_GET_CONFIG_TTY_INFO,(void*)
(&tty_1),&serial_len);
// err = cyg_io_write( handle_ser1, test_string, &len );
err = cyg_io_write( tty1_handle test_string , &len );
Also I read a few other serial problems on the forum and there was
something about the 2nd com port, com0 was not included in the arm e7t
package. I have eCos 2.0 can anyone tell me if this version do have both
port
Cheers
Fred
---------------------------------------------------
--------------- F R E D D A N---------------
------------------------------------
------------------------
________________________________________________________________
DISCLAIMER:
This e-mail and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom it is addressed. If you are not the intended recipient
you are prohibited from using any of the information contained
in this e-mail. In such a case, please destroy all copies in
your possession and notify the sender by reply e-mail. Heriot
Watt University does not accept liability or responsibility
for changes made to this e-mail after it was sent, or for
viruses transmitted through this e-mail. Opinions, comments,
conclusions and other information in this e-mail that do not
relate to the official business of Heriot Watt University are
not endorsed by it.
________________________________________________________________
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss