Discussion Forum

Does anyone have a nested interrupt example using armcc..

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Chris Willson
Posted
13-Jun-2006 15:13 GMT
Toolset
ARM
New! Does anyone have a nested interrupt example using armcc..
The RealView Compiler that Keil is now pushing is the armcc compiler.

I have been using CARM which is now considered a "legacy" compiler. I have been trying to port Keil's nested interrupt example which works with CARM to the RealView compiler with no luck.
Here is an example of what Keil says to do with CARM.

You may nest interrupts by using the macros IENABLE and IDISABLE at beginning and end of an interrupt service routine.

#define IENABLE /* Nested Interrupts Entry */ \
__asm { MRS LR, SPSR } /* Copy SPSR_irq to LR */ \
__asm { STMFD SP!, {LR} } /* Save SPSR_irq */ \
__asm { MSR CPSR_c, #0x1F } /* Enable IRQ (Sys Mode) */ \
__asm { STMFD SP!, {LR} } /* Save LR */ \

#define IDISABLE /* Nested Interrupts Exit */ \
__asm { LDMFD SP!, {LR} } /* Restore LR */ \
__asm { MSR CPSR_c, #0x92 } /* Disable IRQ (IRQ Mode) */ \
__asm { LDMFD SP!, {LR} } /* Restore SPSR_irq to LR */ \
__asm { MSR SPSR_cxsf, LR } /* Copy LR to SPSR_irq */ \

The usage is as shown below:

void interrupt_srv (void) __irq {
IENABLE; // allow nested interrupts
... // interrupt code
IDISABLE; // disable interrupt nesting
}

Depending on interrupt controller, it might be required to clear the interrupt source and acknowledge the interrupt. So in reality an implementation might look like the following example:

/* External Interrupt 1 Service */
void eint1_srv (void) __irq {
EXTINT = 2; // Clear EINT1 interrupt flag
IENABLE; // allow nested interrupts
delay ();
++intrp_count; // increment interrupt count
IDISABLE; // disable interrupt nesting
VICVectAddr = 0; // Acknowledge Interrupt
}

I have tried many different ways to get the above code to work, but I have had no luck. I am sure I am just missing something in the documentation somewhere.

Does anyone have example code of how they nest interrupts using the RealView Compiler.

Thanks.
Read-Only
Author
Chris Willson
Posted
28-Jun-2006 15:25 GMT
Toolset
ARM
New! RE: Does anyone have a nested interrupt example using armcc..
Anyone..Anyone..Bueller..Bueller....
Read-Only
Author
Viktor Bucher
Posted
28-Jun-2006 19:25 GMT
Toolset
ARM
New! RE: Does anyone have a nested interrupt example using armcc..
I have the same problem. The solution for CARM does not apply to Realview compiler. I'm still waiting for help too (I already posted this queston, see 7930).
Read-Only
Author
Viktor Bucher
Posted
7-Jul-2006 10:51 GMT
Toolset
ARM
New! RE: Does anyone have a nested interrupt example using armcc..
Take a look at :

http://www.13thmonkey.org/documentation/ARM/HAI.pdf
Read-Only
Author
Viktor Bucher
Posted
7-Jul-2006 11:07 GMT
Toolset
ARM
New! RE: Does anyone have a nested interrupt example using armcc..
and :

http://www.atmel.com/dyn/resources/prod_documents/DOC1168.PDF
Read-Only
Author
Chris Willson
Posted
10-Jul-2006 19:57 GMT
Toolset
ARM
New! RE: Does anyone have a nested interrupt example using armcc..
Thanks.

I think that will work for me.
Read-Only
Author
Viktor Bucher
Posted
23-Jul-2006 15:12 GMT
Toolset
ARM
New! RE: Does anyone have a nested interrupt example using armcc..
http://www.arm.com/pdfs/DAI0030A_sw_int.pdf

Next Thread | Thread List | Previous Thread Start a Thread | Settings