public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Serial getc problem
@ 2002-07-08  9:35 George Sosnowski
  2002-07-08  9:43 ` Gary Thomas
  2002-07-09  3:49 ` Robert Cragie
  0 siblings, 2 replies; 7+ messages in thread
From: George Sosnowski @ 2002-07-08  9:35 UTC (permalink / raw)
  To: ecos-discuss

I have come across a similar situation using the 860T. My platform has
one serial port (SMC1 used as diag and console port) and currently I
inherit the serial channel from redboot. Is it still possible to have a
'proper' /dev/tty0 that uses the inherited serial channel (diag/console)
from redboot? Or does the ecos ram image have to install its own
/dev/ser0 for console and diag channels since these are the same device?

Thanks,
George

-----Original Message-----
From: Robert Cragie [mailto:rcc@jennic.com] 
Sent: Thursday, July 04, 2002 10:26 AM
To: Daniel Lidsten; ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Serial getc problem

You need to use a 'proper' serial driver (/dev/tty0 or /dev/tty1), not
/dev/ttydiag. These allow blocking reads which will allow other threads
to
run; as you  have seen, /dev/ttydiag does a busy wait on a character
which
will stop other threads from running. You can configure eCos so that
stdio
uses /dev/tty0 or /dev/tty1.

Regards,

Robert Cragie, Design Engineer

Direct: +44 (0) 114 281 4512
________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
www.jennic.com  Tel: +44 (0) 114 281 2655


> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Daniel
> Lidsten
> Sent: 04 July 2002 17:19
> To: ecos-discuss@sources.redhat.com
> Subject: [ECOS] Serial getc problem
>
>
> Hi,
>
> I am running a MPC850 with a few different threads in the application.
> The network stack is also enabled and up and running. However, when a
> thread calls the HAL_DIAG_READ_CHAR to wait for input from the user
then
> my net stack stops working. I cant reach it with a ping from my local
> host.
>
> My first thought was that the application was running with a higher
> priority (lower value) then the net stack but that was not the case.
The
> application runs at prio 8 and net at 6 and 7 (background).
>
> I have seen in the serial driver that when reading a char from the
port
> then the following is done:
>
> while ( !getc_non_block(..) )
>
> Can the problem be that this code is running in some form of "kernel
> state" i.e. in a very high prio state since the driver lies within
eCos?
>
> Regards, Daniel
>
> --
> Before posting, please read the FAQ:
http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>


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


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

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

* RE: [ECOS] Serial getc problem
  2002-07-08  9:35 [ECOS] Serial getc problem George Sosnowski
@ 2002-07-08  9:43 ` Gary Thomas
  2002-07-09  3:49 ` Robert Cragie
  1 sibling, 0 replies; 7+ messages in thread
From: Gary Thomas @ 2002-07-08  9:43 UTC (permalink / raw)
  To: George Sosnowski; +Cc: eCos Discussion

On Mon, 2002-07-08 at 10:35, George Sosnowski wrote:
> I have come across a similar situation using the 860T. My platform has
> one serial port (SMC1 used as diag and console port) and currently I
> inherit the serial channel from redboot. Is it still possible to have a
> 'proper' /dev/tty0 that uses the inherited serial channel (diag/console)
> from redboot? Or does the ecos ram image have to install its own
> /dev/ser0 for console and diag channels since these are the same device?
> 

If you want non-blocking (i.e. interrupt driven) I/O, you need to use 
/dev/ser0.  I/O through the default console /dev/ttydiag will always be
blocking (non interrupt driven).  For the most part, these can usually
co-exist, with the caveats that output from the non-interrupting device
could intermingle with that from the interrupting device and that if you
use GDB features then only blocking I/O will be used while GDB is in
control.

> Thanks,
> George
> 
> -----Original Message-----
> From: Robert Cragie [mailto:rcc@jennic.com] 
> Sent: Thursday, July 04, 2002 10:26 AM
> To: Daniel Lidsten; ecos-discuss@sources.redhat.com
> Subject: RE: [ECOS] Serial getc problem
> 
> You need to use a 'proper' serial driver (/dev/tty0 or /dev/tty1), not
> /dev/ttydiag. These allow blocking reads which will allow other threads
> to
> run; as you  have seen, /dev/ttydiag does a busy wait on a character
> which
> will stop other threads from running. You can configure eCos so that
> stdio
> uses /dev/tty0 or /dev/tty1.
> 
> Regards,
> 
> Robert Cragie, Design Engineer
> 
> Direct: +44 (0) 114 281 4512
> ________________________________________________________
> Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
> www.jennic.com  Tel: +44 (0) 114 281 2655
> 
> 
> > -----Original Message-----
> > From: ecos-discuss-owner@sources.redhat.com
> > [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Daniel
> > Lidsten
> > Sent: 04 July 2002 17:19
> > To: ecos-discuss@sources.redhat.com
> > Subject: [ECOS] Serial getc problem
> >
> >
> > Hi,
> >
> > I am running a MPC850 with a few different threads in the application.
> > The network stack is also enabled and up and running. However, when a
> > thread calls the HAL_DIAG_READ_CHAR to wait for input from the user
> then
> > my net stack stops working. I cant reach it with a ping from my local
> > host.
> >
> > My first thought was that the application was running with a higher
> > priority (lower value) then the net stack but that was not the case.
> The
> > application runs at prio 8 and net at 6 and 7 (background).
> >
> > I have seen in the serial driver that when reading a char from the
> port
> > then the following is done:
> >
> > while ( !getc_non_block(..) )
> >
> > Can the problem be that this code is running in some form of "kernel
> > state" i.e. in a very high prio state since the driver lies within
> eCos?
> >
> > Regards, Daniel
> >
> > --
> > Before posting, please read the FAQ:
> http://sources.redhat.com/fom/ecos
> > and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> >
> >
> 
> 
> -- 
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> 
> 
> -- 
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss



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

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

* RE: [ECOS] Serial getc problem
  2002-07-08  9:35 [ECOS] Serial getc problem George Sosnowski
  2002-07-08  9:43 ` Gary Thomas
@ 2002-07-09  3:49 ` Robert Cragie
  1 sibling, 0 replies; 7+ messages in thread
From: Robert Cragie @ 2002-07-09  3:49 UTC (permalink / raw)
  To: George Sosnowski, Daniel.Lidsten, ecos-discuss

I have not used this platform (860T), but essentially I did the following
(for ARM Integrator) using the GUI config. tool:

1) In the "Serial device drivers" section, I enabled the "TTY-mode serial
device drivers" subsection (CYGPKG_IO_SERIAL_TTY = 1).
2) In the "TTY-mode serial device drivers" subsection, I enabled the
"TTY-mode channel #0" subsection (CYGPKG_IO_SERIAL_TTY_TTY0 = 1).
3) In the "TTY-mode channel #0" subsection, I specified "TTY-mode device
channel #0 device" as "/dev/ser0" (CYGDAT_IO_SERIAL_TTY_TTY0_DEV =
"/dev/ser0")
4) I also did 2 and 3 for "TTY-mode channel #1" subsection, but this may not
be necessary
5) Check the "Hardware serial device drivers" sections thoroughly to make
sure they are what you want for /dev/ser0 (and /dev/ser1 maybe)
6) In the "ISO C Library" section, "ISO C Library standard input/output
functions" subsection, I specified "Default console device" to be
"/dev/tty0" (CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE = "/dev/tty0")

This allowed me to use printf() and scanf() etc. on /dev/tty0 (and
ultimately /dev/ser0), which should be fully interrupt driven and thus allow
blocking (sleeping) in a thread which is waiting for user input. IIRC,
/dev/ttydiag does a busy polling wait on data on the UART Rx side, which
prevents it from being used effectively in a thread.

HTH

Robert Cragie, Design Engineer

Direct: +44 (0) 114 281 4512
________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
www.jennic.com  Tel: +44 (0) 114 281 2655   Confidential


> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of George
> Sosnowski
> Sent: 08 July 2002 17:35
> To: ecos-discuss@sources.redhat.com
> Subject: RE: [ECOS] Serial getc problem
>
>
> I have come across a similar situation using the 860T. My platform has
> one serial port (SMC1 used as diag and console port) and currently I
> inherit the serial channel from redboot. Is it still possible to have a
> 'proper' /dev/tty0 that uses the inherited serial channel (diag/console)
> from redboot? Or does the ecos ram image have to install its own
> /dev/ser0 for console and diag channels since these are the same device?
>
> Thanks,
> George
>
> -----Original Message-----
> From: Robert Cragie [mailto:rcc@jennic.com]
> Sent: Thursday, July 04, 2002 10:26 AM
> To: Daniel Lidsten; ecos-discuss@sources.redhat.com
> Subject: RE: [ECOS] Serial getc problem
>
> You need to use a 'proper' serial driver (/dev/tty0 or /dev/tty1), not
> /dev/ttydiag. These allow blocking reads which will allow other threads
> to
> run; as you  have seen, /dev/ttydiag does a busy wait on a character
> which
> will stop other threads from running. You can configure eCos so that
> stdio
> uses /dev/tty0 or /dev/tty1.
>
> Regards,
>
> Robert Cragie, Design Engineer
>
> Direct: +44 (0) 114 281 4512
> ________________________________________________________
> Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
> www.jennic.com  Tel: +44 (0) 114 281 2655
>
>
> > -----Original Message-----
> > From: ecos-discuss-owner@sources.redhat.com
> > [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Daniel
> > Lidsten
> > Sent: 04 July 2002 17:19
> > To: ecos-discuss@sources.redhat.com
> > Subject: [ECOS] Serial getc problem
> >
> >
> > Hi,
> >
> > I am running a MPC850 with a few different threads in the application.
> > The network stack is also enabled and up and running. However, when a
> > thread calls the HAL_DIAG_READ_CHAR to wait for input from the user
> then
> > my net stack stops working. I cant reach it with a ping from my local
> > host.
> >
> > My first thought was that the application was running with a higher
> > priority (lower value) then the net stack but that was not the case.
> The
> > application runs at prio 8 and net at 6 and 7 (background).
> >
> > I have seen in the serial driver that when reading a char from the
> port
> > then the following is done:
> >
> > while ( !getc_non_block(..) )
> >
> > Can the problem be that this code is running in some form of "kernel
> > state" i.e. in a very high prio state since the driver lies within
> eCos?
> >
> > Regards, Daniel
> >
> > --
> > Before posting, please read the FAQ:
> http://sources.redhat.com/fom/ecos
> > and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> >
> >
>
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>


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

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

* RE: [ECOS] Serial getc problem
@ 2002-07-05  1:14 Daniel Lidsten
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Lidsten @ 2002-07-05  1:14 UTC (permalink / raw)
  To: Robert Cragie, ecos-discuss

I think that the problem was that i hadnt enable any other serial port then the "diag port". However, now that i have enabled the QUICC/SMC then it will use the same port (smc1) as diag outport. Of couse, this is not good. Is there a way to change the diag port from using the orginal driver and instead use the new serial port?

The real question is - currently i have one serial port but two drivers that wants to send chars to the console. Is there a simple solution for this?

Regards, Daniel

-----Original Message-----
From: Daniel Lidsten 
Sent: den 4 juli 2002 21:55
To: Robert Cragie; ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Serial getc problem


Hi again,

I have tried to install such a serial driver but can´t access it later on in the application. How should i configure eCos? When i do a cyg_io_lookup then i can find the following drivers:

dev/ttydiag
dev/tty0
dev/hal_diag

...but during the lookup procedure there is a check on "dep_name" and that is set to "dev/ser0", which is not found among the above.

What values/strings shall be entered under the section "TTY-mode serial drivers" in eCos config tool to make this work.

Regards, Daniel

-----Original Message-----
From: Robert Cragie [mailto:rcc@jennic.com] 
Sent: den 4 juli 2002 19:26
To: Daniel Lidsten; ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Serial getc problem


You need to use a 'proper' serial driver (/dev/tty0 or /dev/tty1), not /dev/ttydiag. These allow blocking reads which will allow other threads to run; as you  have seen, /dev/ttydiag does a busy wait on a character which will stop other threads from running. You can configure eCos so that stdio uses /dev/tty0 or /dev/tty1.

Regards,

Robert Cragie, Design Engineer

Direct: +44 (0) 114 281 4512 ________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK www.jennic.com  Tel: +44 (0) 114 281 2655


> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Daniel
> Lidsten
> Sent: 04 July 2002 17:19
> To: ecos-discuss@sources.redhat.com
> Subject: [ECOS] Serial getc problem
>
>
> Hi,
>
> I am running a MPC850 with a few different threads in the application.
> The network stack is also enabled and up and running. However, when a 
> thread calls the HAL_DIAG_READ_CHAR to wait for input from the user 
> then my net stack stops working. I cant reach it with a ping from my 
> local host.
>
> My first thought was that the application was running with a higher
> priority (lower value) then the net stack but that was not the case. 
> The application runs at prio 8 and net at 6 and 7 (background).
>
> I have seen in the serial driver that when reading a char from the
> port then the following is done:
>
> while ( !getc_non_block(..) )
>
> Can the problem be that this code is running in some form of "kernel
> state" i.e. in a very high prio state since the driver lies within 
> eCos?
>
> Regards, Daniel
>
> --
> Before posting, please read the FAQ:
> http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>


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


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

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

* RE: [ECOS] Serial getc problem
@ 2002-07-04 12:58 Daniel Lidsten
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Lidsten @ 2002-07-04 12:58 UTC (permalink / raw)
  To: Robert Cragie, ecos-discuss

Hi again,

I have tried to install such a serial driver but can´t access it later on in the application. How should i configure eCos? When i do a cyg_io_lookup then i can find the following drivers:

dev/ttydiag
dev/tty0
dev/hal_diag

...but during the lookup procedure there is a check on "dep_name" and that is set to "dev/ser0", which is not found among the above.

What values/strings shall be entered under the section "TTY-mode serial drivers" in eCos config tool to make this work.

Regards, Daniel

-----Original Message-----
From: Robert Cragie [mailto:rcc@jennic.com] 
Sent: den 4 juli 2002 19:26
To: Daniel Lidsten; ecos-discuss@sources.redhat.com
Subject: RE: [ECOS] Serial getc problem


You need to use a 'proper' serial driver (/dev/tty0 or /dev/tty1), not /dev/ttydiag. These allow blocking reads which will allow other threads to run; as you  have seen, /dev/ttydiag does a busy wait on a character which will stop other threads from running. You can configure eCos so that stdio uses /dev/tty0 or /dev/tty1.

Regards,

Robert Cragie, Design Engineer

Direct: +44 (0) 114 281 4512 ________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK www.jennic.com  Tel: +44 (0) 114 281 2655


> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Daniel 
> Lidsten
> Sent: 04 July 2002 17:19
> To: ecos-discuss@sources.redhat.com
> Subject: [ECOS] Serial getc problem
>
>
> Hi,
>
> I am running a MPC850 with a few different threads in the application. 
> The network stack is also enabled and up and running. However, when a 
> thread calls the HAL_DIAG_READ_CHAR to wait for input from the user 
> then my net stack stops working. I cant reach it with a ping from my 
> local host.
>
> My first thought was that the application was running with a higher 
> priority (lower value) then the net stack but that was not the case. 
> The application runs at prio 8 and net at 6 and 7 (background).
>
> I have seen in the serial driver that when reading a char from the 
> port then the following is done:
>
> while ( !getc_non_block(..) )
>
> Can the problem be that this code is running in some form of "kernel 
> state" i.e. in a very high prio state since the driver lies within 
> eCos?
>
> Regards, Daniel
>
> --
> Before posting, please read the FAQ: 
> http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>


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

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

* RE: [ECOS] Serial getc problem
  2002-07-04  9:20 Daniel Lidsten
@ 2002-07-04 10:25 ` Robert Cragie
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Cragie @ 2002-07-04 10:25 UTC (permalink / raw)
  To: Daniel Lidsten, ecos-discuss

You need to use a 'proper' serial driver (/dev/tty0 or /dev/tty1), not
/dev/ttydiag. These allow blocking reads which will allow other threads to
run; as you  have seen, /dev/ttydiag does a busy wait on a character which
will stop other threads from running. You can configure eCos so that stdio
uses /dev/tty0 or /dev/tty1.

Regards,

Robert Cragie, Design Engineer

Direct: +44 (0) 114 281 4512
________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
www.jennic.com  Tel: +44 (0) 114 281 2655


> -----Original Message-----
> From: ecos-discuss-owner@sources.redhat.com
> [mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Daniel
> Lidsten
> Sent: 04 July 2002 17:19
> To: ecos-discuss@sources.redhat.com
> Subject: [ECOS] Serial getc problem
>
>
> Hi,
>
> I am running a MPC850 with a few different threads in the application.
> The network stack is also enabled and up and running. However, when a
> thread calls the HAL_DIAG_READ_CHAR to wait for input from the user then
> my net stack stops working. I cant reach it with a ping from my local
> host.
>
> My first thought was that the application was running with a higher
> priority (lower value) then the net stack but that was not the case. The
> application runs at prio 8 and net at 6 and 7 (background).
>
> I have seen in the serial driver that when reading a char from the port
> then the following is done:
>
> while ( !getc_non_block(..) )
>
> Can the problem be that this code is running in some form of "kernel
> state" i.e. in a very high prio state since the driver lies within eCos?
>
> Regards, Daniel
>
> --
> Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> and search the list archive: http://sources.redhat.com/ml/ecos-discuss
>
>


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

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

* [ECOS] Serial getc problem
@ 2002-07-04  9:20 Daniel Lidsten
  2002-07-04 10:25 ` Robert Cragie
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Lidsten @ 2002-07-04  9:20 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I am running a MPC850 with a few different threads in the application.
The network stack is also enabled and up and running. However, when a
thread calls the HAL_DIAG_READ_CHAR to wait for input from the user then
my net stack stops working. I cant reach it with a ping from my local
host. 

My first thought was that the application was running with a higher
priority (lower value) then the net stack but that was not the case. The
application runs at prio 8 and net at 6 and 7 (background).

I have seen in the serial driver that when reading a char from the port
then the following is done:

while ( !getc_non_block(..) )

Can the problem be that this code is running in some form of "kernel
state" i.e. in a very high prio state since the driver lies within eCos?

Regards, Daniel

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

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

end of thread, other threads:[~2002-07-09 10:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-08  9:35 [ECOS] Serial getc problem George Sosnowski
2002-07-08  9:43 ` Gary Thomas
2002-07-09  3:49 ` Robert Cragie
  -- strict thread matches above, loose matches on Subject: below --
2002-07-05  1:14 Daniel Lidsten
2002-07-04 12:58 Daniel Lidsten
2002-07-04  9:20 Daniel Lidsten
2002-07-04 10:25 ` Robert Cragie

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