This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Problem with spurious interrupt on ARM
- From: Morten Laursen <MLA at rtx dot dk>
- To: 'Andrew Lunn' <andrew dot lunn at ascom dot ch>
- Cc: "'ecos-discuss at sources dot redhat dot com'" <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 30 Aug 2002 12:53:13 +0200
- Subject: RE: [ECOS] Problem with spurious interrupt on ARM
If it's supposed to work like this, then I don't understand the purpose of
HAL option "Ignore spurious (fleeting) interrupts".
Anyway, it's a viable solution. Thanks.
Venlig Hilsen / Regards
Morten
--
Morten Laursen, M.Sc.S.E.
RTX Telecom A/S - http://www.rtx.dk/
Direct phone: (+45) 96 32 24 03
> -----Original Message-----
> From: Andrew Lunn [mailto:andrew.lunn@ascom.ch]
> Sent: 30. august 2002 12:34
> To: Morten Laursen
> Cc: 'ecos-discuss@sources.redhat.com'
> Subject: Re: [ECOS] Problem with spurious interrupt on ARM
>
>
> On Fri, Aug 30, 2002 at 12:11:54PM +0200, Morten Laursen wrote:
> > According to the MCU (AT91M40800) data sheet a spurious
> interrupt can happen
> > when using edge trigged interupts. I use edge trigged
> interrupts, because I
> > want to know how long time the button was pressed.
> >
> > So (as I understand it) the problem is not, that there is a spurious
> > interrupt, but that it is somehow handled incorrectly?
>
> I think its actually a design philosophy thing. Hardware should not
> produce spurious interrupts. If it does, its broken. So eCos general
> does not have to deal with spurious interrupts. If your broken
> hardware does generate such things, you have to work around your
> broken hardware. In this case, you need to modify either your
> application or the HAL for the AT91M40800 to deal with this.
>
> int hal_IRQ_handler(void)
> {
> cyg_uint32 irq_num;
> cyg_uint32 ipr, imr;
>
> HAL_READ_UINT32(AT91_AIC+AT91_AIC_IPR, ipr);
> HAL_READ_UINT32(AT91_AIC+AT91_AIC_IMR, imr);
> ipr &= imr;
> for (irq_num = 0; irq_num < 19; irq_num++) {
> if (ipr & (1 << irq_num)) {
> break;
> }
> }
>
> return irq_num;
> }
>
> So this will drop out with 19 in the case of a spurious interrupt.
>
> So put a handler on interrupt 19 which clears the interrupt.
>
> Andrew
>
>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss