Hi,
I have used following macros for IENABLE and IDISABLE
#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 */
I am using Keil uvision v5 evaluation version When I compile the program with these macros I get following error messages:- 1)timer_delay.c(28): error: #20: identifier "SP" is undefined 2)timer_delay.c(28): error: #20: identifier "LR" is undefined
Please guide me in this regard as I need to resolve this issue as early as possible. I think this problem is of including assembly language in C but for SP and LR registers it is giving error as stated.
Thank you in advance.
I just modified LPC2300.s and added a specific interrupt handler for an interrupt I needed to allow nesting. It then called the C code which now doesn't need any __irq keyword.
Could you Please tell me how to do that?
Well, a very creative route here would be to visit Google and try "nested interrupts keil".
The first link I get is: http://www.keil.com/support/docs/3353.htm
Oops - damn server giving 'service not available' and then somehow caching the posted message. So reload of page shows thread without the new post...
Thanks for replying to message.
I have included it in my program but the code is entering only for first time and it's not entering in the ISR routine again when I do the said assembly code in Keil uV 5 ver evaluation version.Please guide me in this regards.
Do you have any example of nested interrupt for lpc2368 in Keil uV ver 5.
Thanks in advance.
No, I don't use Keil uV 5. But I don't think version 4 or 5 should matter.
Have you made sure that the function that gets called is changed back to a normal function, and that it doesn't try to play with VICVectAddr?