public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problem with getchar / gets / fgets
@ 2004-09-14 18:37 Nicolas Brouard
  2004-09-14 19:12 ` Andrew Lunn
  2004-09-14 19:37 ` Gary Thomas
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Brouard @ 2004-09-14 18:37 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I'm using a board based on a MPC860 processor.
I try to make a shell application, but the getchar function (or gets, or
fgets(stdin)) doesn't work very well. Each character requires to be hit
about 5 to 10 times after which it shows up.

The test I did is very simple and works perfectly with the powerpc simulator
target (psim).
------------------------------
#include <stdio.h>
static char line[256];
int main(void)
{
    printf("hello\n");
    while(1)
    {
        printf("toto> ");
        gets(line);
        printf("%s", line);
    }
    return 0;
}
------------------------------

The same problem was posted before in the mailing list, and nobody answers.
http://sources.redhat.com/ml/ecos-discuss/2003-12/msg00321.html

Does anybody have an idea about that?
Thanks

Nicolas Brouard



-- 
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] 9+ messages in thread

* Re: [ECOS] Problem with getchar / gets / fgets
  2004-09-14 18:37 [ECOS] Problem with getchar / gets / fgets Nicolas Brouard
@ 2004-09-14 19:12 ` Andrew Lunn
  2004-09-14 19:53   ` Nicolas Brouard
  2004-09-14 19:37 ` Gary Thomas
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2004-09-14 19:12 UTC (permalink / raw)
  To: Nicolas Brouard; +Cc: ecos-discuss

On Tue, Sep 14, 2004 at 02:37:23PM -0400, Nicolas Brouard wrote:
> Hi,
> 
> I'm using a board based on a MPC860 processor.
> I try to make a shell application, but the getchar function (or gets, or
> fgets(stdin)) doesn't work very well. Each character requires to be hit
> about 5 to 10 times after which it shows up.
> 
> The test I did is very simple and works perfectly with the powerpc simulator
> target (psim).
> ------------------------------
> #include <stdio.h>
> static char line[256];
> int main(void)
> {
>     printf("hello\n");
>     while(1)
>     {
>         printf("toto> ");
>         gets(line);
>         printf("%s", line);
>     }
>     return 0;
> }
> ------------------------------
> 
> The same problem was posted before in the mailing list, and nobody answers.
> http://sources.redhat.com/ml/ecos-discuss/2003-12/msg00321.html
> 
> Does anybody have an idea about that?

What serial driver are you using? haldiag or the real serial driver?
Is the port being shared with gdb or is it a dedicated port?

        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

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

* Re: [ECOS] Problem with getchar / gets / fgets
  2004-09-14 18:37 [ECOS] Problem with getchar / gets / fgets Nicolas Brouard
  2004-09-14 19:12 ` Andrew Lunn
@ 2004-09-14 19:37 ` Gary Thomas
  2004-09-14 19:59   ` Nicolas Brouard
  1 sibling, 1 reply; 9+ messages in thread
From: Gary Thomas @ 2004-09-14 19:37 UTC (permalink / raw)
  To: Nicolas Brouard; +Cc: eCos Discussion

On Tue, 2004-09-14 at 12:37, Nicolas Brouard wrote:
> Hi,
> 
> I'm using a board based on a MPC860 processor.
> I try to make a shell application, but the getchar function (or gets, or
> fgets(stdin)) doesn't work very well. Each character requires to be hit
> about 5 to 10 times after which it shows up.
> 
> The test I did is very simple and works perfectly with the powerpc simulator
> target (psim).
> ------------------------------
> #include <stdio.h>
> static char line[256];
> int main(void)
> {
>     printf("hello\n");
>     while(1)
>     {
>         printf("toto> ");
>         gets(line);
>         printf("%s", line);
>     }
>     return 0;
> }
> ------------------------------
> 
> The same problem was posted before in the mailing list, and nobody answers.
> http://sources.redhat.com/ml/ecos-discuss/2003-12/msg00321.html
> 
> Does anybody have an idea about that?

This program behaves perfectly - I just ran it on my Adder (PowerPC 852)

I think the behaviour you are seeing is that gets() and getchar() are
line-oriented, buffered calls.  Input is only sent on to the program 
once a carriage return (newline, '\n') has been entered.

Here's the output I got:
RedBoot> l a.t
Using default protocol (TFTP)
Entry point: 0x00040000, address range: 0x00040000-0x0007f6c8
RedBoot> g
hello
toto> this is a test
this is a test
toto> hello, world!
hello, world!
toto> adef
adef
toto> 

Note: the message you quoted from last December shows exactly the
same behaviour.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
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] 9+ messages in thread

* RE: [ECOS] Problem with getchar / gets / fgets
  2004-09-14 19:12 ` Andrew Lunn
@ 2004-09-14 19:53   ` Nicolas Brouard
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Brouard @ 2004-09-14 19:53 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: ecos-discuss

I'm using eCos from latest CVS repository, in default configuration. So I'm
using:
CYGPKG_IO_SERIAL_TTY = 1
CYGPKG_IO_SERIAL_HALDIAG = 1
CYGDAT_IO_SERIAL_TTY_CONSOLE = /dev/ttydiag
CYGPKG_IO_SERIAL_TTY_TTYDIAG = 1
Others options of component CYGPKG_IO_SERIAL are no active or default value
are 0

What is the real serial driver?

I'm not using GDB. I just launch my shell application with redboot and
communicate with my shell with minicom (as same as redboot).

Nicolas

-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch]
Sent: Tuesday, September 14, 2004 3:12 PM
To: Nicolas Brouard
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Problem with getchar / gets / fgets


On Tue, Sep 14, 2004 at 02:37:23PM -0400, Nicolas Brouard wrote:
> Hi,
>
> I'm using a board based on a MPC860 processor.
> I try to make a shell application, but the getchar function (or gets, or
> fgets(stdin)) doesn't work very well. Each character requires to be hit
> about 5 to 10 times after which it shows up.
>
> The test I did is very simple and works perfectly with the powerpc
simulator
> target (psim).
> ------------------------------
> #include <stdio.h>
> static char line[256];
> int main(void)
> {
>     printf("hello\n");
>     while(1)
>     {
>         printf("toto> ");
>         gets(line);
>         printf("%s", line);
>     }
>     return 0;
> }
> ------------------------------
>
> The same problem was posted before in the mailing list, and nobody
answers.
> http://sources.redhat.com/ml/ecos-discuss/2003-12/msg00321.html
>
> Does anybody have an idea about that?

What serial driver are you using? haldiag or the real serial driver?
Is the port being shared with gdb or is it a dedicated port?

        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

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

* RE: [ECOS] Problem with getchar / gets / fgets
  2004-09-14 19:37 ` Gary Thomas
@ 2004-09-14 19:59   ` Nicolas Brouard
  2004-09-14 20:08     ` Gary Thomas
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Brouard @ 2004-09-14 19:59 UTC (permalink / raw)
  To: Gary Thomas; +Cc: eCos Discussion

This program behaves perfectly too for me on Powerpc simulator or on linux.
But with my powerpc MPC860 target, I have to hit each character several
times to display it on minicom.
At the end of the line, I have to hit several times ENTER. When ENTER is
take into account, the printf("%s", line); works perfectly...

I think it's a problem of communication on the serial port. It seems to be
the configuration of my ecos library.

But my RedBoot shell works perfectly!

Nicolas

-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com]
Sent: Tuesday, September 14, 2004 3:38 PM
To: Nicolas Brouard
Cc: eCos Discussion
Subject: Re: [ECOS] Problem with getchar / gets / fgets


On Tue, 2004-09-14 at 12:37, Nicolas Brouard wrote:
> Hi,
>
> I'm using a board based on a MPC860 processor.
> I try to make a shell application, but the getchar function (or gets, or
> fgets(stdin)) doesn't work very well. Each character requires to be hit
> about 5 to 10 times after which it shows up.
>
> The test I did is very simple and works perfectly with the powerpc
simulator
> target (psim).
> ------------------------------
> #include <stdio.h>
> static char line[256];
> int main(void)
> {
>     printf("hello\n");
>     while(1)
>     {
>         printf("toto> ");
>         gets(line);
>         printf("%s", line);
>     }
>     return 0;
> }
> ------------------------------
>
> The same problem was posted before in the mailing list, and nobody
answers.
> http://sources.redhat.com/ml/ecos-discuss/2003-12/msg00321.html
>
> Does anybody have an idea about that?

This program behaves perfectly - I just ran it on my Adder (PowerPC 852)

I think the behaviour you are seeing is that gets() and getchar() are
line-oriented, buffered calls.  Input is only sent on to the program
once a carriage return (newline, '\n') has been entered.

Here's the output I got:
RedBoot> l a.t
Using default protocol (TFTP)
Entry point: 0x00040000, address range: 0x00040000-0x0007f6c8
RedBoot> g
hello
toto> this is a test
this is a test
toto> hello, world!
hello, world!
toto> adef
adef
toto>

Note: the message you quoted from last December shows exactly the
same behaviour.

--
Gary Thomas <gary@mlbassoc.com>
MLB Associates




-- 
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] 9+ messages in thread

* RE: [ECOS] Problem with getchar / gets / fgets
  2004-09-14 19:59   ` Nicolas Brouard
@ 2004-09-14 20:08     ` Gary Thomas
  2004-09-14 20:40       ` Nicolas Brouard
  0 siblings, 1 reply; 9+ messages in thread
From: Gary Thomas @ 2004-09-14 20:08 UTC (permalink / raw)
  To: Nicolas Brouard; +Cc: eCos Discussion

On Tue, 2004-09-14 at 13:59, Nicolas Brouard wrote:
> This program behaves perfectly too for me on Powerpc simulator or on linux.
> But with my powerpc MPC860 target, I have to hit each character several
> times to display it on minicom.
> At the end of the line, I have to hit several times ENTER. When ENTER is
> take into account, the printf("%s", line); works perfectly...
> 
> I think it's a problem of communication on the serial port. It seems to be
> the configuration of my ecos library.
> 
> But my RedBoot shell works perfectly!

What's special with your eCos configuration?  Can you send the output
of 'ecosconfig export'?  I just ran with a default configuration:
  % ecosconfig new adder852 net
  % ecosconfig tree; make

Have you tried such a simplified setup?

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
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] 9+ messages in thread

* RE: [ECOS] Problem with getchar / gets / fgets
  2004-09-14 20:08     ` Gary Thomas
@ 2004-09-14 20:40       ` Nicolas Brouard
  2004-09-20 13:09         ` Nicolas Brouard
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Brouard @ 2004-09-14 20:40 UTC (permalink / raw)
  To: Gary Thomas; +Cc: eCos Discussion

Nothing special in my eCos configuration.
I use a port of eCos to an EP860CE board (based on Viper port).

the output of ecosconfig export is:
------------------------------------------------------------------
cdl_savefile_version 1;
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_command {};
cdl_savefile_command cdl_configuration { description hardware template
package };
cdl_savefile_command cdl_package { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_component { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_option { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_interface { value_source user_value wizard_value
inferred_value };

cdl_configuration eCos {
    description "" ;
    hardware    ep860ce ;
    template    default ;
    package -hardware CYGPKG_HAL_POWERPC current ;
    package -hardware CYGPKG_HAL_POWERPC_MPC8xx current ;
    package -hardware SILPKG_HAL_POWERPC_EP860CE current ;
    package -hardware CYGPKG_HAL_QUICC current ;
    package -hardware CYGPKG_IO_SERIAL_POWERPC_QUICC_SMC current ;
    package -hardware SILPKG_DEVS_FLASH_EP860CE current ;
    package -hardware CYGPKG_DEVS_FLASH_AMD_AM29XXXXX current ;
    package -template CYGPKG_HAL current ;
    package -template CYGPKG_IO current ;
    package -template CYGPKG_IO_SERIAL current ;
    package -template CYGPKG_INFRA current ;
    package -template CYGPKG_KERNEL current ;
    package -template CYGPKG_MEMALLOC current ;
    package -template CYGPKG_ISOINFRA current ;
    package -template CYGPKG_LIBC current ;
    package -template CYGPKG_LIBC_I18N current ;
    package -template CYGPKG_LIBC_SETJMP current ;
    package -template CYGPKG_LIBC_SIGNALS current ;
    package -template CYGPKG_LIBC_STARTUP current ;
    package -template CYGPKG_LIBC_STDIO current ;
    package -template CYGPKG_LIBC_STDLIB current ;
    package -template CYGPKG_LIBC_STRING current ;
    package -template CYGPKG_LIBC_TIME current ;
    package -template CYGPKG_LIBM current ;
    package -template CYGPKG_IO_WALLCLOCK current ;
    package -template CYGPKG_ERROR current ;
};

cdl_component CYGSEM_HAL_ENABLE_DCACHE_ON_STARTUP {
    user_value 0
};

cdl_option CYGSEM_HAL_ENABLE_ICACHE_ON_STARTUP {
    user_value 0
};

cdl_option CYGHWR_HAL_POWERPC_ENABLE_MMU {
    user_value 0
};

cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
    user_value 115200
};

cdl_option CYGBLD_ISO_CTYPE_HEADER {
    inferred_value 1 <cyg/libc/i18n/ctype.inl>
};

cdl_option CYGBLD_ISO_ERRNO_CODES_HEADER {
    inferred_value 1 <cyg/error/codes.h>
};

cdl_option CYGBLD_ISO_ERRNO_HEADER {
    inferred_value 1 <cyg/error/errno.h>
};

cdl_option CYGBLD_ISO_STDIO_FILETYPES_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_STREAMS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FILEOPS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FILEACCESS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FORMATTED_IO_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_CHAR_IO_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_DIRECT_IO_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FILEPOS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_ERROR_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDLIB_STRCONV_HEADER {
    inferred_value 1 <cyg/libc/stdlib/atox.inl>
};

cdl_option CYGBLD_ISO_STDLIB_ABS_HEADER {
    inferred_value 1 <cyg/libc/stdlib/abs.inl>
};

cdl_option CYGBLD_ISO_STDLIB_DIV_HEADER {
    inferred_value 1 <cyg/libc/stdlib/div.inl>
};

cdl_option CYGBLD_ISO_STRERROR_HEADER {
    inferred_value 1 <cyg/error/strerror.h>
};

cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/bsdstring.h>
};

cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_C_TIME_TYPES_HEADER {
    inferred_value 1 <cyg/libc/time/time.h>
};

cdl_option CYGBLD_ISO_C_CLOCK_FUNCS_HEADER {
    inferred_value 1 <cyg/libc/time/time.h>
};

cdl_option CYGBLD_ISO_SIGNAL_NUMBERS_HEADER {
    inferred_value 1 <cyg/libc/signals/signal.h>
};

cdl_option CYGBLD_ISO_SIGNAL_IMPL_HEADER {
    inferred_value 1 <cyg/libc/signals/signal.h>
};

cdl_option CYGBLD_ISO_SETJMP_HEADER {
    inferred_value 1 <cyg/libc/setjmp/setjmp.h>
};
------------------------------------------------------------------
If I enable MMU, DCACHE and ICACHE, I have better results : less characters
are lost in minicom (about 10% lost).
If I disable MMU, DCACHE and ICACHE, about 80% are lost.

If I use CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD = 9600, I have
exactly the same results.

I didn't try a simplified setup.

Nicolas


-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com]
Sent: Tuesday, September 14, 2004 4:09 PM
To: Nicolas Brouard
Cc: eCos Discussion
Subject: RE: [ECOS] Problem with getchar / gets / fgets


On Tue, 2004-09-14 at 13:59, Nicolas Brouard wrote:
> This program behaves perfectly too for me on Powerpc simulator or on
linux.
> But with my powerpc MPC860 target, I have to hit each character several
> times to display it on minicom.
> At the end of the line, I have to hit several times ENTER. When ENTER is
> take into account, the printf("%s", line); works perfectly...
>
> I think it's a problem of communication on the serial port. It seems to be
> the configuration of my ecos library.
>
> But my RedBoot shell works perfectly!

What's special with your eCos configuration?  Can you send the output
of 'ecosconfig export'?  I just ran with a default configuration:
  % ecosconfig new adder852 net
  % ecosconfig tree; make

Have you tried such a simplified setup?

--
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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




-- 
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] 9+ messages in thread

* RE: [ECOS] Problem with getchar / gets / fgets
  2004-09-14 20:40       ` Nicolas Brouard
@ 2004-09-20 13:09         ` Nicolas Brouard
  2004-10-06 14:44           ` Peter Graf
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Brouard @ 2004-09-20 13:09 UTC (permalink / raw)
  To: Nicolas Brouard, Gary Thomas; +Cc: eCos Discussion

Hi,
Does somebody have a council to solve my problem?
I have a Shell application and input lost a lot of characters. On my PowerPc
MPC860 target, I have to hit each character several times to display it on
minicom.
Thanks
Nicolas

-----Original Message-----
From: Nicolas Brouard [mailto:nicolas.brouard@silicomp.ca]
Sent: Tuesday, September 14, 2004 4:40 PM
To: Gary Thomas
Cc: eCos Discussion
Subject: RE: [ECOS] Problem with getchar / gets / fgets


Nothing special in my eCos configuration.
I use a port of eCos to an EP860CE board (based on Viper port).

the output of ecosconfig export is:
------------------------------------------------------------------
cdl_savefile_version 1;
cdl_savefile_command cdl_savefile_version {};
cdl_savefile_command cdl_savefile_command {};
cdl_savefile_command cdl_configuration { description hardware template
package };
cdl_savefile_command cdl_package { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_component { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_option { value_source user_value wizard_value
inferred_value };
cdl_savefile_command cdl_interface { value_source user_value wizard_value
inferred_value };

cdl_configuration eCos {
    description "" ;
    hardware    ep860ce ;
    template    default ;
    package -hardware CYGPKG_HAL_POWERPC current ;
    package -hardware CYGPKG_HAL_POWERPC_MPC8xx current ;
    package -hardware SILPKG_HAL_POWERPC_EP860CE current ;
    package -hardware CYGPKG_HAL_QUICC current ;
    package -hardware CYGPKG_IO_SERIAL_POWERPC_QUICC_SMC current ;
    package -hardware SILPKG_DEVS_FLASH_EP860CE current ;
    package -hardware CYGPKG_DEVS_FLASH_AMD_AM29XXXXX current ;
    package -template CYGPKG_HAL current ;
    package -template CYGPKG_IO current ;
    package -template CYGPKG_IO_SERIAL current ;
    package -template CYGPKG_INFRA current ;
    package -template CYGPKG_KERNEL current ;
    package -template CYGPKG_MEMALLOC current ;
    package -template CYGPKG_ISOINFRA current ;
    package -template CYGPKG_LIBC current ;
    package -template CYGPKG_LIBC_I18N current ;
    package -template CYGPKG_LIBC_SETJMP current ;
    package -template CYGPKG_LIBC_SIGNALS current ;
    package -template CYGPKG_LIBC_STARTUP current ;
    package -template CYGPKG_LIBC_STDIO current ;
    package -template CYGPKG_LIBC_STDLIB current ;
    package -template CYGPKG_LIBC_STRING current ;
    package -template CYGPKG_LIBC_TIME current ;
    package -template CYGPKG_LIBM current ;
    package -template CYGPKG_IO_WALLCLOCK current ;
    package -template CYGPKG_ERROR current ;
};

cdl_component CYGSEM_HAL_ENABLE_DCACHE_ON_STARTUP {
    user_value 0
};

cdl_option CYGSEM_HAL_ENABLE_ICACHE_ON_STARTUP {
    user_value 0
};

cdl_option CYGHWR_HAL_POWERPC_ENABLE_MMU {
    user_value 0
};

cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD {
    user_value 115200
};

cdl_option CYGBLD_ISO_CTYPE_HEADER {
    inferred_value 1 <cyg/libc/i18n/ctype.inl>
};

cdl_option CYGBLD_ISO_ERRNO_CODES_HEADER {
    inferred_value 1 <cyg/error/codes.h>
};

cdl_option CYGBLD_ISO_ERRNO_HEADER {
    inferred_value 1 <cyg/error/errno.h>
};

cdl_option CYGBLD_ISO_STDIO_FILETYPES_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_STREAMS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FILEOPS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FILEACCESS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FORMATTED_IO_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_CHAR_IO_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_DIRECT_IO_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_FILEPOS_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDIO_ERROR_HEADER {
    inferred_value 1 <cyg/libc/stdio/stdio.h>
};

cdl_option CYGBLD_ISO_STDLIB_STRCONV_HEADER {
    inferred_value 1 <cyg/libc/stdlib/atox.inl>
};

cdl_option CYGBLD_ISO_STDLIB_ABS_HEADER {
    inferred_value 1 <cyg/libc/stdlib/abs.inl>
};

cdl_option CYGBLD_ISO_STDLIB_DIV_HEADER {
    inferred_value 1 <cyg/libc/stdlib/div.inl>
};

cdl_option CYGBLD_ISO_STRERROR_HEADER {
    inferred_value 1 <cyg/error/strerror.h>
};

cdl_option CYGBLD_ISO_STRTOK_R_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_STRING_LOCALE_FUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_STRING_BSD_FUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/bsdstring.h>
};

cdl_option CYGBLD_ISO_STRING_MEMFUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_STRING_STRFUNCS_HEADER {
    inferred_value 1 <cyg/libc/string/string.h>
};

cdl_option CYGBLD_ISO_C_TIME_TYPES_HEADER {
    inferred_value 1 <cyg/libc/time/time.h>
};

cdl_option CYGBLD_ISO_C_CLOCK_FUNCS_HEADER {
    inferred_value 1 <cyg/libc/time/time.h>
};

cdl_option CYGBLD_ISO_SIGNAL_NUMBERS_HEADER {
    inferred_value 1 <cyg/libc/signals/signal.h>
};

cdl_option CYGBLD_ISO_SIGNAL_IMPL_HEADER {
    inferred_value 1 <cyg/libc/signals/signal.h>
};

cdl_option CYGBLD_ISO_SETJMP_HEADER {
    inferred_value 1 <cyg/libc/setjmp/setjmp.h>
};
------------------------------------------------------------------
If I enable MMU, DCACHE and ICACHE, I have better results : less characters
are lost in minicom (about 10% lost).
If I disable MMU, DCACHE and ICACHE, about 80% are lost.

If I use CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL_BAUD = 9600, I have
exactly the same results.

I didn't try a simplified setup.

Nicolas


-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com]
Sent: Tuesday, September 14, 2004 4:09 PM
To: Nicolas Brouard
Cc: eCos Discussion
Subject: RE: [ECOS] Problem with getchar / gets / fgets


On Tue, 2004-09-14 at 13:59, Nicolas Brouard wrote:
> This program behaves perfectly too for me on Powerpc simulator or on
linux.
> But with my powerpc MPC860 target, I have to hit each character several
> times to display it on minicom.
> At the end of the line, I have to hit several times ENTER. When ENTER is
> take into account, the printf("%s", line); works perfectly...
>
> I think it's a problem of communication on the serial port. It seems to be
> the configuration of my ecos library.
>
> But my RedBoot shell works perfectly!

What's special with your eCos configuration?  Can you send the output
of 'ecosconfig export'?  I just ran with a default configuration:
  % ecosconfig new adder852 net
  % ecosconfig tree; make

Have you tried such a simplified setup?

--
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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




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




-- 
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] 9+ messages in thread

* Re: [ECOS] Problem with getchar / gets / fgets
  2004-09-20 13:09         ` Nicolas Brouard
@ 2004-10-06 14:44           ` Peter Graf
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Graf @ 2004-10-06 14:44 UTC (permalink / raw)
  To: eCos Discussion

Nicolas Brouard wrote:

>Hi,
>Does somebody have a council to solve my problem?
>I have a Shell application and input lost a lot of characters. On my PowerPc
>MPC860 target, I have to hit each character several times to display it on
>minicom.
>  
>
IIRC you reported that Redboot worked fine, so it reminded me of having 
a similar problem. I can only refer to eCos 2.0, but I guess this has 
not changed. In io/serial...serial.c, serial_read() attempts to fill a 
buffer of more than one character, even if the upper layer has requested 
only one, e.g. when the caller was getchar(). Now when your lowlevel 
driver supports no interrupt driven buffer fill operation (reflected 
here by cbuf->len==0), this will be done by calling several blocking 
(funs->getc)(chan), i.e. you must send several characters until the 
buffer is filled and serial_read() decides to return to its caller. 
Check if the characters properly arrive in your lowlevel driver first. 
If they do, it might be related to this. I resolved it by a quick hack 
in serial.c, never blocking for more than one character, but the proper 
way is an interrupt driven lowlevel driver.

Peter


-- 
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] 9+ messages in thread

end of thread, other threads:[~2004-10-06 13:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-14 18:37 [ECOS] Problem with getchar / gets / fgets Nicolas Brouard
2004-09-14 19:12 ` Andrew Lunn
2004-09-14 19:53   ` Nicolas Brouard
2004-09-14 19:37 ` Gary Thomas
2004-09-14 19:59   ` Nicolas Brouard
2004-09-14 20:08     ` Gary Thomas
2004-09-14 20:40       ` Nicolas Brouard
2004-09-20 13:09         ` Nicolas Brouard
2004-10-06 14:44           ` Peter Graf

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