This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Using the second serial port on ARM-E7T
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: Jacques Ehrlich <ehrlich at lcpc dot fr>
- Cc: Ravi Kumar B S <ravikbs at mindtree dot com>,Ecos-Discuss <ecos-discuss at sources dot redhat dot com>
- Date: Mon, 15 Apr 2002 18:48:41 +0100
- Subject: Re: [ECOS] Using the second serial port on ARM-E7T
- Organization: Red Hat UK Ltd.
- References: <OLEJKHKIAEANMGANECCMCEFKCGAA.ehrlich@lcpc.fr>
Jacques Ehrlich wrote:
>
> >I tried something like :
> > fp = fopen("/dev/ser0", "rw");
> > ...
> > fprintf(fp, "hello\n");
> > ...
> >
> > without success.
>
> Finally, it works !
> The error was :
> fp = fopen("/dev/ser0", "rw")
>
> To be ok you must open two different "files":
> out = fopen("/dev/ser0", "w")
> in = fopen("/dev/ser0", "r")
Actually that shouldn't be required. But you saying this has made me notice
what the problem is: it shouldn't be "rw", it should be "r+" to open for
reading and writing.
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
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss