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 __fiq function attribute in the Realview compiler. The __irq attribute is used for both IRQs and FIQs in RealView. Refer to the section on function keywords in your RealView Compiler Manual. CARM has both __irq and __fiq function attributes but I suspect that there is no difference in the code generated in each case.
Just to clarify, there is a difference between __fiq and __irq in the CARM compiler. It is to do with the registers that are pushed\popped to the stack on entry\exit.
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?
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.