This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Fwd: Re: Can't read with cyg_io_read()
- From: Gentleman dot nbg at gmx dot de
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 14 Feb 2008 15:29:59 +0100
- Subject: [ECOS] Fwd: Re: [ECOS] Can't read with cyg_io_read()
Hi,
in debugging mode I found out, that I could not use neither /dev/tty0 nor /dev/serial0 driver as my handle. The only working driver is /dev/haldiag/.
Where can I change the configuration? with ecos configuration tool?
I am asking because, I am building my eCos image with a makefile and gnu make.
Do you really think that /dev/haldiag/ is not able to read from serial port? It can write, so I think it should be able to read too.
Thank You
-------- 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
--
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games!
http://games.entertainment.web.de/de/entertainment/games/free
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss