[ARM7] ISR too slow -> interrupt not triggered

Guest #2134862
This is a crosspost from: Beitrag "[ARM7] ISR zu langsam -> kein Interrupt mehr"

I'm currently facing a problem using a AT91SAM7X256.
An external interrupt is triggered every millisecond and the 
corresponding ISR does some calculations. This setup is working in 
general but under certain circumstances I'm facing an unknown problem 
which leads to the ISR not being called anymore - the main loop of the 
controller still runs smoothly. I did some testing and figured out that 
this is caused by my ISR doing too much stuff. If I comment out some 
(random) parts or increase the time interval between to IRQs to two 
milliseconds it is working again.
This is, I'm able to work around my problem but I want to understand 
what causes this issue.
Maybe someone can explain this behavior to me?

By the way: I'm using FreeRTOS.
1
portENTER_CRITICAL();
2
{
3
    // Input on PIN_1
4
    AT91F_PIO_CfgInput(AT91C_BASE_PIOA, IOA_PIN_1);
5

6
    // Interrupt on PIN_1
7
    AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA, IOA_PIN_1);
8

9
    // Setup interrupt
10
    AT91F_AIC_ConfigureIt(AT91C_BASE_AIC,
11
                          AT91C_ID_PIOA,
12
                          AT91C_AIC_PRIOR_LOWEST,
13
                          AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE,
14
                          isr_pioa_Wrapper);
15

16
    AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_PIOA);
17
}
18
portEXIT_CRITICAL();
19

20
int dummy = AT91C_BASE_PIOA->PIO_ISR;
1
void isr_pioa_Wrapper(void)
2
{
3
    /* Save the context of the interrupted task. */
4
    portSAVE_CONTEXT();
5

6
    /* Call the handler to do the work.  This must be a separate
7
       function to ensure the stack frame is set up correctly. */
8
    isr_pioa_Handler();
9

10
    /* Restore the context of whichever task will execute next. */
11
    portRESTORE_CONTEXT();
12
}
1
void isr_pioa_Handler(void)
2
{
3
    int dummy = AT91C_BASE_PIOA->PIO_ISR;
4
    dummy = dummy;
5

6
    isr_counter++;
7

8
    // ...
9

10
    /* Clear the interrupt. */
11
    AT91C_BASE_AIC->AIC_EOICR = 0;
12
}

Reply

A question of your own? This thread is over 15 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.