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]

Re: 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


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