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

REALview FIQ Handler Compiler Error

Hi

I'm can't get a Source code with a FIQ Handler compiled with REALview.

There is always a error in the line "void FIQ_Handler (void) __fiq" which says: error: #130: expected a "{"

This is the complete test Code:

#include<aduc7024.h>

int main(void)
{
while(1){}
}

void FIQ_Handler (void)  __fiq
{
// bla bla ....
}

There is no error when I switch to CARM Compiler and a IRQ with this scheme works with REALview.

Can some one give me a hint?

Parents
  • shure there is a difference between fiq and irq. Is part of the ARM7 Core architecture.


    5.1 FIQ INTERRUPTS VERSUS IRQ INTERRUPTS
    FIQ interrupts have a higher priority than IRQs which means that they will be serviced first when situations arise with both IRQ and FIQ events simultaneously. Servicing an FIQ will disable an IRQ and therefore IRQs will not be serviced until the FIQ handler completely exits.
    FIQ interrupts are designed to be run as quickly as possible. The handler for FIQ can be placed directly at the end of the exception vectors table since the vector is the last in the table. A jump to another address therefore is not necessary and can be run immediately. In addition, FIQ mode has an additional 5 banked registers which means that there is less time wasted
    saving the non-banked registers before serving the FIQ exception handling and restoring them before exiting the exception.
    http://www.st.com/stonline/products/literature/an/10334.pdf


    My Problem is not the mainly speed but i have to use the FIQ Handel because the ADuC differs a little bit in FIQ and IRQ call sources. The PWM Trip is only available in IRQ and the PWM Sync only in FIQ.

    Is there any solution?

Reply
  • shure there is a difference between fiq and irq. Is part of the ARM7 Core architecture.


    5.1 FIQ INTERRUPTS VERSUS IRQ INTERRUPTS
    FIQ interrupts have a higher priority than IRQs which means that they will be serviced first when situations arise with both IRQ and FIQ events simultaneously. Servicing an FIQ will disable an IRQ and therefore IRQs will not be serviced until the FIQ handler completely exits.
    FIQ interrupts are designed to be run as quickly as possible. The handler for FIQ can be placed directly at the end of the exception vectors table since the vector is the last in the table. A jump to another address therefore is not necessary and can be run immediately. In addition, FIQ mode has an additional 5 banked registers which means that there is less time wasted
    saving the non-banked registers before serving the FIQ exception handling and restoring them before exiting the exception.
    http://www.st.com/stonline/products/literature/an/10334.pdf


    My Problem is not the mainly speed but i have to use the FIQ Handel because the ADuC differs a little bit in FIQ and IRQ call sources. The PWM Trip is only available in IRQ and the PWM Sync only in FIQ.

    Is there any solution?

Children
  • There is a difference between the ARM modes as you say. I am talking however about the compiler function attributes.

    You have a compilation problem.

    __fiq is NOT a valid function attribute for the RealView compiler. It is for the CARM compiler however.

    You should use the __irq function attribute in RealView.

    The section in the RealView manual is quoted below.

    From this, it seems to me like the RealView compiler does not differentiate between the fiq and irq. Therefore it ignores the extra banked registers that are available to it in fiq mode.


    __irq
    Enables a C or C++ function to be used as an interrupt routine called by
    the IRQ or FIQ vectors. All corrupted registers except floating-point
    registers are preserved, not only those that are normally preserved under
    the AAPCS. The default AAPCS mode must be used.
    The function exits by setting the PC to lr–4 and the CPSR to the value in
    SPSR. No arguments or return values can be used with __irq functions.