* [ECOS] Fwd: Re: [ECOS] Can't read with cyg_io_read()
@ 2008-02-14 14:30 Gentleman.nbg
2008-02-14 22:31 ` Gentleman.nbg
0 siblings, 1 reply; 6+ messages in thread
From: Gentleman.nbg @ 2008-02-14 14:30 UTC (permalink / raw)
To: ecos-discuss
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ECOS] Fwd: Re: [ECOS] Can't read with cyg_io_read()
2008-02-14 14:30 [ECOS] Fwd: Re: [ECOS] Can't read with cyg_io_read() Gentleman.nbg
@ 2008-02-14 22:31 ` Gentleman.nbg
2008-02-14 22:41 ` [ECOS] " Grant Edwards
0 siblings, 1 reply; 6+ messages in thread
From: Gentleman.nbg @ 2008-02-14 22:31 UTC (permalink / raw)
To: Gentleman.nbg; +Cc: ecos-discuss
Can someone acknowledge that the driver "/dev/haldiag" ist only intended for output of traces and is not able to read anything?
I am asking because in documentation there is no explanation of the individual drivers.
-------- Original-Nachricht --------
> Datum: Thu, 14 Feb 2008 15:29:59 +0100
> Von: Gentleman.nbg@gmx.de
> An: ecos-discuss@ecos.sourceware.org
> Betreff: [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
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ECOS] Re: Fwd: Re: [ECOS] Can't read with cyg_io_read()
2008-02-14 22:31 ` Gentleman.nbg
@ 2008-02-14 22:41 ` Grant Edwards
2008-02-14 23:11 ` Gentleman.nbg
0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2008-02-14 22:41 UTC (permalink / raw)
To: ecos-discuss
On 2008-02-14, Gentleman.nbg@gmx.de <Gentleman.nbg@gmx.de> wrote:
> Can someone acknowledge that the driver "/dev/haldiag" ist
> only intended for output of traces and is not able to read
> anything?
The haldiag drivers I've seen all support reading from the
UART. The diag drivers are usually simple polled-mode driver,
so I wouldn't bet on being able to have any sort of sustained
input stream at high baud rates. I don't know what platform
you're using, so the only real answer I can give is...
Use the source, Luke.
> I am asking because in documentation there is no explanation
> of the individual drivers.
--
Grant Edwards grante Yow! ... this must be what
at it's like to be a COLLEGE
visi.com GRADUATE!!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ECOS] Re: Fwd: Re: [ECOS] Can't read with cyg_io_read()
2008-02-14 22:41 ` [ECOS] " Grant Edwards
@ 2008-02-14 23:11 ` Gentleman.nbg
2008-02-14 23:16 ` [ECOS] " Grant Edwards
0 siblings, 1 reply; 6+ messages in thread
From: Gentleman.nbg @ 2008-02-14 23:11 UTC (permalink / raw)
To: Grant Edwards; +Cc: ecos-discuss
As I have massive problems with configtool and cygwin,
can u tell me, if I can use a simple linux OS instead?
thank you
-------- Original-Nachricht --------
> Datum: Thu, 14 Feb 2008 22:41:16 +0000 (UTC)
> Von: Grant Edwards <grante@visi.com>
> An: ecos-discuss@sources.redhat.com
> Betreff: [ECOS] Re: Fwd: Re: [ECOS] Can\'t read with cyg_io_read()
> On 2008-02-14, Gentleman.nbg@gmx.de <Gentleman.nbg@gmx.de> wrote:
>
> > Can someone acknowledge that the driver "/dev/haldiag" ist
> > only intended for output of traces and is not able to read
> > anything?
>
> The haldiag drivers I've seen all support reading from the
> UART. The diag drivers are usually simple polled-mode driver,
> so I wouldn't bet on being able to have any sort of sustained
> input stream at high baud rates. I don't know what platform
> you're using, so the only real answer I can give is...
>
> Use the source, Luke.
>
> > I am asking because in documentation there is no explanation
> > of the individual drivers.
>
> --
> Grant Edwards grante Yow! ... this must be
> what
> at it's like to be a
> COLLEGE
> visi.com GRADUATE!!
>
>
> --
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ECOS] Re: Can't read with cyg_io_read()
2008-02-14 23:11 ` Gentleman.nbg
@ 2008-02-14 23:16 ` Grant Edwards
2008-02-15 15:17 ` Grant Edwards
0 siblings, 1 reply; 6+ messages in thread
From: Grant Edwards @ 2008-02-14 23:16 UTC (permalink / raw)
To: ecos-discuss
On 2008-02-14, Gentleman.nbg@gmx.de <Gentleman.nbg@gmx.de> wrote:
> As I have massive problems with configtool and cygwin,
> can u tell me, if I can use a simple linux OS instead?
Definitely. In my experinece, the tools are much less
troublesome under Linux.
Ask ask around amongst friends and work-mates. Judging by the
proliferation of Linux magazines the last time I was in
Germany, there must be at least one nearby Linux geek willing
to help you get started.
I recommend using the same distro as the person most likely to
be willing to help you.
--
Grant Edwards grante Yow! It's NO USE ... I've
at gone to "CLUB MED"!!
visi.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ECOS] Re: Can't read with cyg_io_read()
2008-02-14 23:16 ` [ECOS] " Grant Edwards
@ 2008-02-15 15:17 ` Grant Edwards
0 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2008-02-15 15:17 UTC (permalink / raw)
To: ecos-discuss
Return-Path: <gentleman.nbg@gmx.de>
X-Original-To: grante@shell.visi.com
Delivered-To: grante@shell.visi.com
Received: from g2host.com (mailback1.g2host.com [208.42.176.222])
by baal.visi.com (Postfix) with ESMTP id DFF0865101
for <grante@shell.visi.com>; Fri, 15 Feb 2008 02:22:24 -0600 (CST)
Received: from <grante@visi.com>
by mailback1.g2host.com (CommuniGate Pro RULES 5.1.14)
with RULES id 8550970; Fri, 15 Feb 2008 02:22:11 -0600
X-Autogenerated: Mirror
Resent-From: <grante@visi.com>
Resent-Date: Fri, 15 Feb 2008 02:22:11 -0600
Received: from spamfilter-21.visi.com ([208.42.184.21] verified)
by mailfront1.g2host.com (CommuniGate Pro SMTP 5.1.14)
with ESMTP id 37653588 for grante@visi.com; Fri, 15 Feb 2008 02:22:12 -0600
Received: from mail.gmx.net <gentleman.nbg@gmx.de> ([213.165.64.20]) by spamfilter-21.visi.com; Fri, 15 Feb 2008 02:22:22 -0600
X-RC-HOST: spamfilter-21.visi.com
X-RC-DBID: 046c9cac-dc1e-47d7-acbb-d595ac2651b6
X-RC-ID: 20080215082222709
X-RC-IP: 213.165.64.20
X-RC-FROM: <gentleman.nbg@gmx.de>
X-RC-RCPT: <grante@visi.com>
Received: (qmail 22455 invoked by uid 0); 15 Feb 2008 08:22:17 -0000
Received: from 212.114.211.6 by www106.gmx.net with HTTP;
Fri, 15 Feb 2008 09:22:17 +0100 (CET)
Content-Type: text/plain; charset="iso-8859-1"
Date: Fri, 15 Feb 2008 09:22:17 +0100
From: Gentleman.nbg@gmx.de
In-Reply-To: <fp2i3i$3r0$1@ger.gmane.org>
Message-ID: <20080215082217.261290@gmx.net>
MIME-Version: 1.0
References: <20080214142959.285270@gmx.net> <20080214223117.258120@gmx.net>
<fp2g2b$tqf$1@ger.gmane.org> <20080214231112.62940@gmx.net>
<fp2i3i$3r0$1@ger.gmane.org>
To: Grant Edwards <grante@visi.com>
X-Authenticated: #15759101
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX18jX5d1rI0j9ycPuJnrxSD9j/gj1KixflUQnidqUx
V3dNNiKeTYyY/0cp14Gs93+2f1k0i0d5b2SQ==
Content-Transfer-Encoding: 8bit
X-GMX-UID: i3KGfyRSMmA6TJYam2FnKnE5MjQ1Nx0x
Resent-Message-Id: <20080215082224.DFF0865101@baal.visi.com>
X-Seen-By-Grants-Procmail-Script: YES
Subject: Re: Can't read with cyg_io_read()
>Thank you for this hint.
>
>One last question:
I doubt it.
>I would like to set the configuration of my serial port to:
>115200 baud, 1 stop-bit, no partity, word = 8bit;
>
>I am tring it like this but cyg_io_lookup() returns a error, do
>you know if my api syntax is correct?:
>
>cyg_serial_info_t dcb = { CYGNUM_SERIAL_BAUD_115200, CYGNUM_SERIAL_STOP_1, CYGNUM_SERIAL_PARITY_NONE, 8, 0 };
>
>cyg_uint32 dcb_len = sizeof(dcb);
FWIW, I don't like the parens around dcb. It makes it look
like sizeof is a function or macro instead of an operator.
>err = cyg_io_lookup( "/dev/haldiag" /*"/dev/tty0"*/ , &handle );
That looks OK to me.
> if(ENOERR == err)
> err = cyg_io_set_config(handle, CYG_IO_SET_CONFIG_SERIAL_INFO, &dcb, &dcb_len);
That doesn't look OK. I always thought that hal diag drivers
ran at a fixed baud and configuration. But I wasn't sure. Do
you know what I just did? I _looked_at_the_source_ :
Here's code from io/serial/current/src/common/haldiag.c:
126 static Cyg_ErrNo
127 haldiag_set_config(serial_channel *chan, cyg_uint32 key, const void *xbuf,
128 cyg_uint32 *len)
129 {
130 switch (key) {
131 case CYG_IO_SET_CONFIG_SERIAL_INFO:
132 diag_printf("%s\n", __FUNCTION__);
133 return ENOERR;
134 default:
135 return -EINVAL;
136 }
137 }
138 #endif // CYGPKG_IO_SERIAL_HALDIAG
--
Grant Edwards grante Yow! I'm continually AMAZED
at at th'breathtaking effects
visi.com of WIND EROSION!!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-02-15 15:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-14 14:30 [ECOS] Fwd: Re: [ECOS] Can't read with cyg_io_read() Gentleman.nbg
2008-02-14 22:31 ` Gentleman.nbg
2008-02-14 22:41 ` [ECOS] " Grant Edwards
2008-02-14 23:11 ` Gentleman.nbg
2008-02-14 23:16 ` [ECOS] " Grant Edwards
2008-02-15 15:17 ` Grant Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).