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

  • Even if interrupts occur at nearly the same time, it is the job of the VIC to arbitrate. Are you working on a trully time-critical application? I'm currently working on a product that has an Ethernet connection, a USB connection, a continuously employed UART, a hardware timer generating interrupts and an LCD controller. all these are serviced well and concurrently without nested interrupts.

    How did you organized your different interrupts? Do you work without an operating system?

    The current project I'm working on has also ethernet, uart, an tft with touch, as well as user inputs (buttons) - without any kind of O/S.

    Of course you can adjust stack sizes, but that consumes RAM that you might need for something else.
    That's right... but most of the code is executed in sdram and the stack is located in the internal sram.

Reply

  • Even if interrupts occur at nearly the same time, it is the job of the VIC to arbitrate. Are you working on a trully time-critical application? I'm currently working on a product that has an Ethernet connection, a USB connection, a continuously employed UART, a hardware timer generating interrupts and an LCD controller. all these are serviced well and concurrently without nested interrupts.

    How did you organized your different interrupts? Do you work without an operating system?

    The current project I'm working on has also ethernet, uart, an tft with touch, as well as user inputs (buttons) - without any kind of O/S.

    Of course you can adjust stack sizes, but that consumes RAM that you might need for something else.
    That's right... but most of the code is executed in sdram and the stack is located in the internal sram.

Children
  • How did you organized your different interrupts? Do you work without an operating system?

    I happen to work with RTX, but an RTOS should not be a factor in the decision to use/avoid nested interrupts. some of my tasks wait for signals from interrupts, to do some later, heavy processing. In the end, you want to build a stable system. As Per mentioned, you cannot do that if you run risk of running out of stack space. Keep your interrupt service routines short. do heavier processing in your main loop (don't forget synchronization issues). if you work efficiently, that should suffice.