This is the mail archive of the ecos-discuss@sourceware.org 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]

Fwd: Re: Can't read with cyg_io_read()


Ok,

I now tried it with /dev/tty0 but I still can't read any chars.
In a manual it says this:
"...This example assumes the "/dev/tty0" device (CYGPKG_IO_SERIAL_TTY_TTY0) was enabled, and
configured properly for use with a hardware serial port, under the Serial Device Drivers..."

How can I enable this?


(CYGPKG_IO_SERIAL) package.
-------- Original-Nachricht --------
Datum: Wed, 13 Feb 2008 17:48:06 +0100
Von: Andrew Lunn <andrew@lunn.ch>
An: Gentleman.nbg@gmx.de
CC: ecos-discuss@ecos.sourceware.org
Betreff: Re: [ECOS] Can\'t read with cyg_io_read()

On Wed, Feb 13, 2008 at 04:07:13PM +0100, Gentleman.nbg@gmx.de wrote:
> hi eCos fans,
> 
> I don't know if it is the apropriate way to ask such things, but I haven't found a board for ecos-developers, so I'll make it short:
> 
> I am testing the serial communication via eCos api. Writing is not the issue, there is a example, and it works.
> 
> But I can't read anything from serial device. I connected it to my PC where I am tryting to write (with keyboard) some characters via a terminal e.g. MS Hyperterminal. I also tried it by sending a "hello" via the Win32 Serial API. But my controller application waits forever. I am sure that I have sent the characters (as I used a serial port scanner).
> 
> My eCos example code would look like this:
> 
> static void simple_prog(CYG_ADDRESS data)
> {
>     cyg_io_handle_t handle;
>     Cyg_ErrNo err;
>     
> 	const char send_string[] = "Hallo";
> 	cyg_uint32 len = strlen(send_string)+1;
> 	
> 	char read_string[6];
> 	cyg_uint32 len2 = 6;
> 
>     
>     	err = cyg_io_lookup( "/dev/haldiag", &handle );

You will find it work better if you use /dev/tty0. You will need to
change you configuration a little, add the interrupt serial device
driver and the TTY driver.

       Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


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