This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: fgets problem
On Friday 27 June 2003 02:26 am, Andrew Lunn wrote:
> On Thu, Jun 26, 2003 at 03:58:49PM -0500, Aaron Richardson wrote:
> > I have problems with fgets. Here is a simple program that I am using
> > that reproduces my problem:
> >
> > #include <stdio.h>
> > int main(void)
> > {
> > char s[255];
> >
> > printf("Hello, eCos world!\n>");
> >
> > while(1) {
> > fgets(s, 255, stdin);
> > printf("You typed: %s\n>", s);
> > }
> >
> > return 0;
> > }
> >
> > The code seems to lockup in the fgets. Any ideas on where to begin
> > fixing this?
>
> Its probably not broken. Im guessing you are trying to do a read on
> the diagnostic serial interface, ie the one gdb is attached to. This
> is deliberately not supported. Search the archives, this has been
> discussed quite a few times.
>
Ok, this makes sense. I am using the diag serial device driver. But I have
only one uart on my hardware. And when I try and disable the diag serial
then I get a conflict with libc, even though I have added another serial
driver. Can I get this to work with only one device?
Also I had to go and verify this, but I had this working before. In fact I
have a redboot.bin that causes my current ecos application to work. I even
have the code that built that redboot.bin. However, when I rebuild that
redboot it doesnt work. I think something outside the code has changed...
but I cant figure out what.
thanks,
Aaron
> To do input you need to use a proper serial driver and not the
> diagnostic driver. Add the appropriate serial driver to your
> configuration and it should work.
>
> Andrew
--
Aaron Richardson
aarichar@cisco.com
512-378-1286
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss