This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

AT91SAM7S: nested interrupt function

Hi,

I want to add a function handling nested interrupts for the controller. Could you tell me the right position to add this function?

startup-file:

Undef_Handler   B       Undef_Handler
SWI_Handler     B       SWI_Handler
PAbt_Handler    B       PAbt_Handler
DAbt_Handler    B       DAbt_Handler
;IRQ_Handler     B       IRQ_Handler
IRQ_Handler     B       irq_fnct
FIQ_Handler     B       FIQ_Handler

irq_fnct

   //do some stuff - nested interrupt

I've add one breakpoint to the irq_fnct but it seems that the programm will not reach this part if a interupt occur.

I'm working with the atmel controller AT91SAM7S.

best regards
Peter

Parents
  • Nested interrupts are meningful if you have a low-priority interrupt with long running time - then a higher-priority interrupt can jump in and get serviced before the processor returns to the slow interrupt.

    Only one of my interupts (system timer - which will execute all 100ms) has a longer running time - e.g. controlling and deleting ARP caches, renewing the licence for dhcp. The way to set a lot of global variables for each event (e.g deleting arp cache) and poll them in the main routine, sounds a little bit unefficient to me.

    Therefore I want to enable nested interrupts to be able to handle all the other interrups if the system timer has also expired. The FIQ is not available for peripherial interrupts, but I'll test if it is possible to work priorites for each interrupt. Maybe that would work.

Reply
  • Nested interrupts are meningful if you have a low-priority interrupt with long running time - then a higher-priority interrupt can jump in and get serviced before the processor returns to the slow interrupt.

    Only one of my interupts (system timer - which will execute all 100ms) has a longer running time - e.g. controlling and deleting ARP caches, renewing the licence for dhcp. The way to set a lot of global variables for each event (e.g deleting arp cache) and poll them in the main routine, sounds a little bit unefficient to me.

    Therefore I want to enable nested interrupts to be able to handle all the other interrups if the system timer has also expired. The FIQ is not available for peripherial interrupts, but I'll test if it is possible to work priorites for each interrupt. Maybe that would work.

Children
  • The way to set a lot of global variables for each event (e.g deleting arp cache) and poll them in the main routine, sounds a little bit unefficient to me.

    So you're betting your project on a known bitter, hard-to-do cure, against a vaguely perceived disease.

    In other words, your intended cure is causing worse problems than you have right now. So why pursue it, ignoring the advice you've come here to ask for?

  • The way to set a lot of global variables for each event (e.g deleting arp cache) and poll them in the main routine, sounds a little bit unefficient to me.

    Wouldn't you merely need one global variable, which tells the main routine "Do all the stuff that previously took place in the timer tick routine?"