public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Serial Application
@ 2001-04-26 18:23 Ho Shui Choy Stanley PS03B NCS
  2001-04-27  3:12 ` Robert Cragie
  2001-04-27  3:30 ` Carlos Camargo
  0 siblings, 2 replies; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-04-26 18:23 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

Ok

Below is the code, those statements mark with an "*" did execute
When I call printf or cyg_io_write to /dev/haldiag, I see the messages on
COM1 on the hyperterminal, which is connected to serial port 0 on my target.
COM2 is connected to second serial port on my target.

I have tried to look up both ser0 and ser1, both returned with no error.
When I do a cyg_io_write to them nothing get displayed on the hyperterminal.

*   err = cyg_io_lookup( "/dev/haldiag", &handle );

   if (ENOERR == err) {
*        printf("Found /dev/haldiag. Writing string....\n");
*        err = cyg_io_write( handle, test_string, &len );
    }
        
    if (ENOERR == err) {
*        printf("I think I wrote the string. Did you see it?\n");
    }

*    err = cyg_io_lookup( "/dev/ser1", &serial );

    if (ENOERR == err) {
*        printf("Found /dev/ser1. Writing string....\n");

	   >>Not this statement, nothing is receive through serial_1
         err = cyg_io_write( serial, test_string, &len );
    }

    if (ENOERR == err) {
*        printf("I think I wrote the string to serial 1. Did you see
it?\n");
    }

Thanks
Stanley

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Friday, April 27, 2001 02:14
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Serial Application


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> The flow control was disabled.
> 
> I receive the printf statements on /dev/haldiag. When I do a lookup on
ser0
> or ser1 there is no error. Even if /dev/haldiag is tied to ser0 or ser1, I
> should have got the message on that port but nothing is coming out.

I'm still not clear on exactly what you do see. Does /dev/haldiag itself
work? Does the initial cyg_io_write work?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial Application
  2001-04-26 18:23 [ECOS] Serial Application Ho Shui Choy Stanley PS03B NCS
@ 2001-04-27  3:12 ` Robert Cragie
  2001-04-27  3:30 ` Carlos Camargo
  1 sibling, 0 replies; 17+ messages in thread
From: Robert Cragie @ 2001-04-27  3:12 UTC (permalink / raw)
  To: Ho Shui Choy Stanley  PS03B  NCS, 'Jonathan Larmour'
  Cc: Ecos-Discuss (E-mail)

See inline comments.

> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [ mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Ho Shui Choy
> Stanley PS03B NCS
> Sent: 27 April 2001 02:21
> To: 'Jonathan Larmour'
> Cc: Ecos-Discuss (E-mail)
> Subject: RE: [ECOS] Serial Application
>
>
> Ok
>
> Below is the code, those statements mark with an "*" did execute
> When I call printf or cyg_io_write to /dev/haldiag, I see the messages on
> COM1 on the hyperterminal, which is connected to serial port 0 on
> my target.
> COM2 is connected to second serial port on my target.
>
> I have tried to look up both ser0 and ser1, both returned with no error.
> When I do a cyg_io_write to them nothing get displayed on the
> hyperterminal.
>
> *   err = cyg_io_lookup( "/dev/haldiag", &handle );
>
>    if (ENOERR == err) {
> *        printf("Found /dev/haldiag. Writing string....\n");
> *        err = cyg_io_write( handle, test_string, &len );

I can't see you actually setting 'len' before the call to cyg_io_write()
here (see below)...

>     }
>
>     if (ENOERR == err) {
> *        printf("I think I wrote the string. Did you see it?\n");
>     }
>
> *    err = cyg_io_lookup( "/dev/ser1", &serial );
>
>     if (ENOERR == err) {
> *        printf("Found /dev/ser1. Writing string....\n");
>
> 	   >>Not this statement, nothing is receive through serial_1
>          err = cyg_io_write( serial, test_string, &len );

I can't see you actually setting 'len' before the call to cyg_io_write()
here.

You set 'len' to be the desired length to write. It returns with the actual
length written in 'len':

           len = strlen(test_string);
           err = cyg_io_write( serial, test_string, &len );

Looking at the source, if len is passed as 0, cyg_io_write() will simply
return ENOERR without doing anything. The comment says that passing len=0
simply verifies the method exists.

This doesn't explain why cyg_io_write() to /dev/haldiag works (I assume it
does), unless it is handled differently in the call.

Robert Cragie
Design Engineer
Jennic Ltd.
Furnival Street
Sheffield
S1 4QT
United Kingdom
Tel: +44 (0) 114 281 4512
Fax: +44 (0) 114 281 2951
mailto:rcc@jennic.com
http://www.jennic.com



^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial Application
  2001-04-26 18:23 [ECOS] Serial Application Ho Shui Choy Stanley PS03B NCS
  2001-04-27  3:12 ` Robert Cragie
@ 2001-04-27  3:30 ` Carlos Camargo
  2001-04-27  4:13   ` Robert Cragie
  1 sibling, 1 reply; 17+ messages in thread
From: Carlos Camargo @ 2001-04-27  3:30 UTC (permalink / raw)
  To: ecos-discuss

Hi all..

My problem is:

I use mbox to transfer data between two threads, now i
able to send only int data.

I want send complex data with mbox, i define a struct
(  more complex that the example in my previous mail),
but i can't put or get messages of struct type.

Thanks

Carlos camargo

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial Application
  2001-04-27  3:30 ` Carlos Camargo
@ 2001-04-27  4:13   ` Robert Cragie
  2001-04-27  4:36     ` [ECOS] Sorry Carlos Camargo
  0 siblings, 1 reply; 17+ messages in thread
From: Robert Cragie @ 2001-04-27  4:13 UTC (permalink / raw)
  To: Carlos Camargo, ecos-discuss

You could use the cyg_mbox_...() functions in conjunction with an array of
your structures initially organised in a linked list, maintaining a variable
which points to the head of this linked list (call this the 'free pool').

To send from Thread A to Thread B, Thread A would remove a structure from
(the head of) the free pool, fill its contents, then send to Thread B using
cyg_mbox_put(), with the pointer to this structure as the 'item' in
cyg_mbox_put().

Thread B would use cyg_mbox_get() (or cyg_mbox_timed_get()) to retrieve the
pointer value, which it would then dereference to get to the contents. Once
Thread B has finished with it, it can either reclaim it directly to the free
pool, in which case you would need a mutex to ensure only one thread can
access the free pool at any one time, or you could set up a mailbox to
return the pointer back to Thread A, which would then reclaim it; in this
case you wouldn't need mutex protection if only Thread A was ever going to
access the free pool.

Note the number of structures in your free pool should match the number of
entries in the mailbox, which is specified by
CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE, and defaults to 10, I believe.

Hope this helps

Robert Cragie
Design Engineer
Jennic Ltd.
Furnival Street
Sheffield
S1 4QT
United Kingdom
Tel: +44 (0) 114 281 4512
Fax: +44 (0) 114 281 2951
mailto:rcc@jennic.com
http://www.jennic.com

> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [ mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Carlos
> Camargo
> Sent: 27 April 2001 11:30
> To: ecos-discuss@sources.redhat.com
> Subject: RE: [ECOS] Serial Application
>
>
> Hi all..
>
> My problem is:
>
> I use mbox to transfer data between two threads, now i
> able to send only int data.
>
> I want send complex data with mbox, i define a struct
> (  more complex that the example in my previous mail),
> but i can't put or get messages of struct type.
>
> Thanks
>
> Carlos camargo
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ECOS] Sorry
  2001-04-27  4:13   ` Robert Cragie
@ 2001-04-27  4:36     ` Carlos Camargo
  0 siblings, 0 replies; 17+ messages in thread
From: Carlos Camargo @ 2001-04-27  4:36 UTC (permalink / raw)
  To: Robert Cragie, ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

Sorry for my simple question, in the future i don´t
make this kind of answer.

Thanks for all..


Carlos Camargo

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [ECOS] Serial application
  2001-05-09 17:54 [ECOS] Serial application Ho Shui Choy Stanley PS03B NCS
@ 2001-05-09 19:33 ` Jonathan Larmour
  0 siblings, 0 replies; 17+ messages in thread
From: Jonathan Larmour @ 2001-05-09 19:33 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> But with the non blocking option select, the serial device is initialize
> with a blocking value of "true" which is in the serial_init function.

No, the CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING option means that non-blocking
mode is supported. It doesn't mean it's enabled by default. Instead you
have to use the function cyg_io_set_config() with the key
CYG_IO_SET_CONFIG_READ_BLOCKING (or ...WRITE_BLOCKING) to enable
non-blocking mode.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial application
@ 2001-05-09 17:54 Ho Shui Choy Stanley PS03B NCS
  2001-05-09 19:33 ` Jonathan Larmour
  0 siblings, 1 reply; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-09 17:54 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

But with the non blocking option select, the serial device is initialize
with a blocking value of "true" which is in the serial_init function.

-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Thursday, May 10, 2001 03:28
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Serial application


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> Here is what I changed.
> 
> in /io/serial/current/src/common/serial.c
> 
> serial_read {
> ...
> ...
> #ifdef CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING
>                 if (cbuf->blocking) {   <- previously checking for false
>                     *len = size;        // characters actually read
>                     res = -EAGAIN;
>                     break;
>                 }
> #endif // CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING

But the check _should_ be for !cbuf->blocking surely?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [ECOS] Serial application
  2001-05-08 17:53 Ho Shui Choy Stanley PS03B NCS
@ 2001-05-09 12:27 ` Jonathan Larmour
  0 siblings, 0 replies; 17+ messages in thread
From: Jonathan Larmour @ 2001-05-09 12:27 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> Here is what I changed.
> 
> in /io/serial/current/src/common/serial.c
> 
> serial_read {
> ...
> ...
> #ifdef CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING
>                 if (cbuf->blocking) {   <- previously checking for false
>                     *len = size;        // characters actually read
>                     res = -EAGAIN;
>                     break;
>                 }
> #endif // CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING

But the check _should_ be for !cbuf->blocking surely?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial application
@ 2001-05-08 17:53 Ho Shui Choy Stanley PS03B NCS
  2001-05-09 12:27 ` Jonathan Larmour
  0 siblings, 1 reply; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-08 17:53 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

Here is what I changed.

in /io/serial/current/src/common/serial.c

serial_read {
...
...
#ifdef CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING
                if (cbuf->blocking) {   <- previously checking for false
                    *len = size;        // characters actually read
                    res = -EAGAIN;
                    break;
                }
#endif // CYGOPT_IO_SERIAL_SUPPORT_NONBLOCKING
...
...
}

the same goes to serial_write


-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Tuesday, May 08, 2001 21:29
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Serial application


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> Solve the problem already. Somehow in
/io/serial/currentsrc/common/serial.c,
> in serial_read function, the checking for blocking was wrong.

Don't keep us on tenter-hooks :-). What was the change?

Thanks for debugging it.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [ECOS] Serial application
  2001-05-07 23:52 Ho Shui Choy Stanley PS03B NCS
@ 2001-05-08  6:30 ` Jonathan Larmour
  0 siblings, 0 replies; 17+ messages in thread
From: Jonathan Larmour @ 2001-05-08  6:30 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> Solve the problem already. Somehow in /io/serial/currentsrc/common/serial.c,
> in serial_read function, the checking for blocking was wrong.

Don't keep us on tenter-hooks :-). What was the change?

Thanks for debugging it.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial application
@ 2001-05-08  1:43 Ho Shui Choy Stanley PS03B NCS
  0 siblings, 0 replies; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-08  1:43 UTC (permalink / raw)
  To: Ecos-Discuss (E-mail)

After I made the corrections, the application ran well in external RAM but
when I transfer the codes to the flash it run for a few seconds then nothing
is output but the program is still running


-----Original Message-----
From: Ho Shui Choy Stanley PS03B NCS [ mailto:scho@ncs.com.sg ]
Sent: Tuesday, May 08, 2001 14:52
To: Ecos-Discuss (E-mail)
Subject: RE: [ECOS] Serial application


Solve the problem already. Somehow in /io/serial/currentsrc/common/serial.c,
in serial_read function, the checking for blocking was wrong.

-----Original Message-----
From: Ho Shui Choy Stanley PS03B NCS [ mailto:scho@ncs.com.sg ]
Sent: Tuesday, May 08, 2001 14:04
To: Ecos-Discuss (E-mail)
Subject: [ECOS] Serial application


I wrote a test program to test the serial port on my platform (AT91EB40).
This program simply transfer data received from one port to the other. I
have two threads, each will monitor one serial port. Below is the codes.

Thread 1:
static void simple_prog1(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial1, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial0, in_buffer, &buf_len);
    }
}

Thread 2:
static void simple_prog2(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial0, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial1, in_buffer, &buf_len);
    }
}

When I start the program, it just run for a few seconds then stops. Can
anyone tell me what's wrong?

Thanks
Stanley
> ____________________________
> This email (including all attachments) contains confidential information
> which may be privileged. It is intended solely for the identified
> recipient(s) to whom it is addressed. If you are not an intended
> recipient, please reply to us immediately and delete this message from
> your system. You may not copy or use it for any purpose, or otherwise
> disclose its contents to any person. 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial application
@ 2001-05-07 23:52 Ho Shui Choy Stanley PS03B NCS
  2001-05-08  6:30 ` Jonathan Larmour
  0 siblings, 1 reply; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-07 23:52 UTC (permalink / raw)
  To: Ecos-Discuss (E-mail)

Solve the problem already. Somehow in /io/serial/currentsrc/common/serial.c,
in serial_read function, the checking for blocking was wrong.

-----Original Message-----
From: Ho Shui Choy Stanley PS03B NCS [ mailto:scho@ncs.com.sg ]
Sent: Tuesday, May 08, 2001 14:04
To: Ecos-Discuss (E-mail)
Subject: [ECOS] Serial application


I wrote a test program to test the serial port on my platform (AT91EB40).
This program simply transfer data received from one port to the other. I
have two threads, each will monitor one serial port. Below is the codes.

Thread 1:
static void simple_prog1(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial1, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial0, in_buffer, &buf_len);
    }
}

Thread 2:
static void simple_prog2(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial0, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial1, in_buffer, &buf_len);
    }
}

When I start the program, it just run for a few seconds then stops. Can
anyone tell me what's wrong?

Thanks
Stanley
> ____________________________
> This email (including all attachments) contains confidential information
> which may be privileged. It is intended solely for the identified
> recipient(s) to whom it is addressed. If you are not an intended
> recipient, please reply to us immediately and delete this message from
> your system. You may not copy or use it for any purpose, or otherwise
> disclose its contents to any person. 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ECOS] Serial application
@ 2001-05-07 23:04 Ho Shui Choy Stanley PS03B NCS
  0 siblings, 0 replies; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-05-07 23:04 UTC (permalink / raw)
  To: Ecos-Discuss (E-mail)

I wrote a test program to test the serial port on my platform (AT91EB40).
This program simply transfer data received from one port to the other. I
have two threads, each will monitor one serial port. Below is the codes.

Thread 1:
static void simple_prog1(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial1, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial0, in_buffer, &buf_len);
    }
}

Thread 2:
static void simple_prog2(CYG_ADDRESS data)
{
    cyg_uint32 buf_len;
    cyg_uint8 in_buffer[10];

    while (1) {
        buf_len = 1;
        cyg_io_read(serial0, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(serial1, in_buffer, &buf_len);
    }
}

When I start the program, it just run for a few seconds then stops. Can
anyone tell me what's wrong?

Thanks
Stanley
> ____________________________
> This email (including all attachments) contains confidential information
> which may be privileged. It is intended solely for the identified
> recipient(s) to whom it is addressed. If you are not an intended
> recipient, please reply to us immediately and delete this message from
> your system. You may not copy or use it for any purpose, or otherwise
> disclose its contents to any person. 
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [ECOS] Serial Application
  2001-04-25 21:18 [ECOS] Serial Application Ho Shui Choy Stanley PS03B NCS
@ 2001-04-26 11:14 ` Jonathan Larmour
  0 siblings, 0 replies; 17+ messages in thread
From: Jonathan Larmour @ 2001-04-26 11:14 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> The flow control was disabled.
> 
> I receive the printf statements on /dev/haldiag. When I do a lookup on ser0
> or ser1 there is no error. Even if /dev/haldiag is tied to ser0 or ser1, I
> should have got the message on that port but nothing is coming out.

I'm still not clear on exactly what you do see. Does /dev/haldiag itself
work? Does the initial cyg_io_write work?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [ECOS] Serial Application
@ 2001-04-25 21:18 Ho Shui Choy Stanley PS03B NCS
  2001-04-26 11:14 ` Jonathan Larmour
  0 siblings, 1 reply; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-04-25 21:18 UTC (permalink / raw)
  To: 'Jonathan Larmour'; +Cc: Ecos-Discuss (E-mail)

The flow control was disabled.

I receive the printf statements on /dev/haldiag. When I do a lookup on ser0
or ser1 there is no error. Even if /dev/haldiag is tied to ser0 or ser1, I
should have got the message on that port but nothing is coming out.


-----Original Message-----
From: Jonathan Larmour [ mailto:jlarmour@redhat.com ]
Sent: Thursday, April 26, 2001 00:15
To: Ho Shui Choy Stanley PS03B NCS
Cc: Ecos-Discuss (E-mail)
Subject: Re: [ECOS] Serial Application


Ho Shui Choy Stanley PS03B NCS wrote:
> 
> I modified the serial.c example to receive data from one serial port and
> transmit it on the other.
> I am not getting anything on the other port. I am using windows
> hyperterminal to test the codes.

Make sure you haven't got flow control enabled in hyperterminal.

Do you not get *anything*? Not even the initial cyg_io_write? Are you sure
/dev/haldiag and /dev/ser1 are different ports on your board? i.e. is it
maybe /dev/ser2? or even /dev/ser0?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [ECOS] Serial Application
  2001-04-25  3:07 Ho Shui Choy Stanley PS03B NCS
@ 2001-04-25  9:15 ` Jonathan Larmour
  0 siblings, 0 replies; 17+ messages in thread
From: Jonathan Larmour @ 2001-04-25  9:15 UTC (permalink / raw)
  To: Ho Shui Choy Stanley PS03B NCS; +Cc: Ecos-Discuss (E-mail)

Ho Shui Choy Stanley PS03B NCS wrote:
> 
> I modified the serial.c example to receive data from one serial port and
> transmit it on the other.
> I am not getting anything on the other port. I am using windows
> hyperterminal to test the codes.

Make sure you haven't got flow control enabled in hyperterminal.

Do you not get *anything*? Not even the initial cyg_io_write? Are you sure
/dev/haldiag and /dev/ser1 are different ports on your board? i.e. is it
maybe /dev/ser2? or even /dev/ser0?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [ECOS] Serial Application
@ 2001-04-25  3:07 Ho Shui Choy Stanley PS03B NCS
  2001-04-25  9:15 ` Jonathan Larmour
  0 siblings, 1 reply; 17+ messages in thread
From: Ho Shui Choy Stanley PS03B NCS @ 2001-04-25  3:07 UTC (permalink / raw)
  To: Ecos-Discuss (E-mail)

I modified the serial.c example to receive data from one serial port and
transmit it on the other.
I am not getting anything on the other port. I am using windows
hyperterminal to test the codes.

Below is the codes.

    err = cyg_io_lookup( "/dev/haldiag", &handle );

    if (ENOERR == err) {
        printf("Found /dev/haldiag. Writing string....\n");
        err = cyg_io_write( handle, test_string, &len );
    }
        
    if (ENOERR == err) {
        printf("I think I wrote the string. Did you see it?\n");
    }

    err = cyg_io_lookup( "/dev/ser1", &serial );

    if (ENOERR == err) {
        printf("Found /dev/ser1. Writing string....\n");
        err = cyg_io_write( serial, test_string, &len );
    }

    while (1) {
        buf_len = 1;
        cyg_io_read(serial, in_buffer, &buf_len);
        buf_len = 1;
        cyg_io_write(handle, in_buffer, &buf_len);
        buf_len = 2;
        cyg_io_write(handle, "\n\r", &buf_len);

    }

Thanks
Stanley

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2001-05-09 19:33 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-26 18:23 [ECOS] Serial Application Ho Shui Choy Stanley PS03B NCS
2001-04-27  3:12 ` Robert Cragie
2001-04-27  3:30 ` Carlos Camargo
2001-04-27  4:13   ` Robert Cragie
2001-04-27  4:36     ` [ECOS] Sorry Carlos Camargo
  -- strict thread matches above, loose matches on Subject: below --
2001-05-09 17:54 [ECOS] Serial application Ho Shui Choy Stanley PS03B NCS
2001-05-09 19:33 ` Jonathan Larmour
2001-05-08 17:53 Ho Shui Choy Stanley PS03B NCS
2001-05-09 12:27 ` Jonathan Larmour
2001-05-08  1:43 Ho Shui Choy Stanley PS03B NCS
2001-05-07 23:52 Ho Shui Choy Stanley PS03B NCS
2001-05-08  6:30 ` Jonathan Larmour
2001-05-07 23:04 Ho Shui Choy Stanley PS03B NCS
2001-04-25 21:18 [ECOS] Serial Application Ho Shui Choy Stanley PS03B NCS
2001-04-26 11:14 ` Jonathan Larmour
2001-04-25  3:07 Ho Shui Choy Stanley PS03B NCS
2001-04-25  9:15 ` Jonathan Larmour

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).