Guest
#1172245
Hi,
I'm developing an application in C for the NXP LPC2103 which uses
interrupts (VIC) and works fine using just ARM code. However I'm almost
out of code space and am trying to use THUMB. Enabling -mthumb-interwork
(rather than -mno-thumb-interwork), without even building a file in
THUMB, causes the processor to hang when it encounters an interrupt. Not
enabling interrupts at startup cures this problem, but the application
relies on them heavily. Optimisation is -0s (size), the program won't
fit in any other mode.
My interrupt enabling/disabling routines are:
inline unsigned enableIRQ(void)
{
unsigned _cpsr;
_cpsr = asm_get_cpsr();
asm_set_cpsr(_cpsr & ~IRQ_MASK);
return _cpsr;
}
inline unsigned disableIRQ(void)
{
unsigned _cpsr;
_cpsr = asm_get_cpsr();
asm_set_cpsr(_cpsr | IRQ_MASK);
return _cpsr;
}
I think it's the actual getting into/out of the ISRs which is causing it
to fall over.
I'm using the latest version of Winarm (20060606). I've tried using
Yagarto as well, with exactly the same problem.
Can anyone suggest what's going wrong? I've been trying to get to the
bottom of this for a while, and it's now getting urgent!
P.S. I'm not very familiar with ARM assembly yet.
Thanks, John.