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.
portENTER_CRITICAL(); { // Input on PIN_1 AT91F_PIO_CfgInput(AT91C_BASE_PIOA, IOA_PIN_1); // Interrupt on PIN_1 AT91F_PIO_InterruptEnable(AT91C_BASE_PIOA, IOA_PIN_1); // Setup interrupt AT91F_AIC_ConfigureIt(AT91C_BASE_AIC, AT91C_ID_PIOA, AT91C_AIC_PRIOR_LOWEST, AT91C_AIC_SRCTYPE_INT_POSITIVE_EDGE, isr_pioa_Wrapper); AT91F_AIC_EnableIt(AT91C_BASE_AIC, AT91C_ID_PIOA); } portEXIT_CRITICAL(); int dummy = AT91C_BASE_PIOA->PIO_ISR; |
void isr_pioa_Wrapper(void) { /* Save the context of the interrupted task. */ portSAVE_CONTEXT(); /* Call the handler to do the work. This must be a separate function to ensure the stack frame is set up correctly. */ isr_pioa_Handler(); /* Restore the context of whichever task will execute next. */ portRESTORE_CONTEXT(); } |
void isr_pioa_Handler(void) { int dummy = AT91C_BASE_PIOA->PIO_ISR; dummy = dummy; isr_counter++; // ... /* Clear the interrupt. */ AT91C_BASE_AIC->AIC_EOICR = 0; } |