About ADuC7020 __irq & __fiq

When I build the ADuC7020 program,there are some problems about " __fiq" and "__irq",the build output info as follows:

common.h(107): error:  #130: expected a "{"

line 107 :void FIQ_Handler(void) __fiq ;

It will be ok when I delete the "__fiq",how to deal with it ?

my build tool is :Keil uVision4.13a

Thanks!

  • 0
    •  Analog Employees 
    on Mar 14, 2011 6:19 AM over 10 years ago

    This looks like a syntax error possibly some lines before the shown location.

    But I think it is the __fiq itself - with MDK you should use always __irq only.

    For detailed support on SW you should provide the full project as a ZIP-file.

    Also for support either from us or directly Keil you should update your Tools to the latest version from the Keil WebSite - actually 4.14 with µVision4.

  • 0
    •  Analog Employees 
    on Mar 14, 2011 9:22 AM over 10 years ago

    These keys words are compiler extensions which can differ from compiler to compiler.

    If you are using the Keil environment, you are probably using RealView but the GNU compiler can also be used. You may also have some code for the old Keil CARM compiler (no longer used).

    From the error number, I conclude that you are using the RealView compiler, and __fiq is not a key word for that compiler. Use __irq instead.

    The reason for the need of these keywords is that the AAPCS (ARM Architecture Procedure Call Standard) lays out which registers should be maintained by the caller and callee when a function call is made.

    The C interrupt handler needs a hint to stack away additional registers as part of it prologue, and restore them on its exit so that operation of the interrupted code will proceed as normal.

    Last time I checked, there was no way in the RealView compiler (in C) to take advantage of the FIQ banked registers.

  • 0
    •  Analog Employees 
    on Mar 14, 2011 10:28 AM over 10 years ago

    I don't understand your question, why do you want to use __fiq?

    If you are using RealView, the __irq attribute is be used for interrupt and fast interrupt handlers.

    Anyway, if you want to persist with this approach, then you need to install the GNU compiler, Keil have docs on their website detailing this.

  • Yes,I have used RealView compiler,and my project reference code comes from Keil 3.1 ,I wants to use the __fiq ,If I change the complier to GUN,can I use __fiq ?

    I have change the setting,but it "--- Error: failed to execute 'arm-none-eabi-as'"

    It is my first time to use Keil and ADuC7020,so,I hope to get more details,thank you very much.

  • Because we will keep the reference code's architecture,we modify little about  the code to achieve the function we need.

    so,I have to do more about the __fiq,thanks