This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Problem with getchar / gets / fgets
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Nicolas Brouard <nicolas dot brouard at silicomp dot ca>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 14 Sep 2004 21:12:19 +0200
- Subject: Re: [ECOS] Problem with getchar / gets / fgets
- References: <MFENKKFPNAKOOKBAEHLHEEDACDAA.nicolas.brouard@silicomp.ca>
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