This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Interrupts and Serial Ports


On Fri, Nov 05, 2004 at 08:33:07AM -0500, Steve Knowlton wrote:
> I have an EB40A board. I am trying to read an incoming data stream on 
> Serial Port 1
> that arrives about every 15 sec. I can see the Rx LED on the port 
> flashing every time
> a packet arrives.
> 
> I am trying to read data coming into the port using cyg_io_read using a 
> polling method.
> 
> I was reading the documentation on the ecos serial driver and it claims 
> that the
> incoming data is buffered until it is read. Is this true because it 
> doesn't seem to work
> that way. I never seem to read anything from the port. I have tried both 
> blocking
> and non blocking reads. Occassionally I get a -11 error which means that 
> the data is
> not available and that the user should try again later. The returned 
> length is always 0 so
> that seems to prove that I am not reading anything.
> 
> This does not seem to be a very good method and I was wondering if there 
> is an ecos interrrupt routine I can use that would execute whenever data 
> arrives at the port.
> Presumably ecos assigns an interrupt vector for the port. If so, how can 
> I use this?

eCos comes with two serial drivers. There is a very basic one as part
of the HAL. This is designed for diagnostic output and is
polled. There is also a full serial driver which is interrupt
driver. You should make use of this full serial driver and you should
then get better results.

        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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]