hello,
I have a problem the interrupt only work for 16 interrupts, and at 16
it crash!! if I change the __STACK_SIZE_IRQ__ = 0x100; to
__STACK_SIZE_IRQ__ = 0x200; (on lpc2119.ld) will crash at 32
interrupts, anyone can help me!!
I use gnuarm3.4.1 for linux, LPC2129 and I use the following
functions for enter and exit in interrupt:
#define ISR_ENTRADA() asm volatile(" sub r14, r14, #4\n" \
" stmfd r13!, {r0-r3, r12, r14}\n"
\
" mrs r0, spsr\n" \
" stmfd r13!, {r0}")
#define ISR_SAIDA() asm volatile(" mrs r0, cpsr\n" \
" orr r0, r0, #0xC0\n" \
" msr cpsr_c, r0\n" \
" ldmfd r13!, {r0}\n" \
" msr spsr_cxsf, r0 \n"\
" ldmfd r13!, {r0-r3, r12, PC}^")
and the following code:
...
VICVectAddr5 = (u32)captura;
....
void captura(void){
ISR_ENTRADA();
escreve_UART0("EI");
if(T1IR & TIR_MR0I){
T1IR |= TIR_MR0I;
Timer1OverflowCount++;
}else if(T1IR & TIR_CR0I){
T1IR |= TIR_CR0I;
escreve_UART0("1");
}else if(T1IR & TIR_CR1I){
T1IR |= TIR_CR1I;
escreve_UART0("2");
}
VICSoftIntClr = (1<<VIC_TIMER1);
VICVectAddr = 0x00000000;
escreve_UART0("SI\n");
ISR_SAIDA();
}
I think the problem can be on ISR_ENTRADA(); and ISR_SAIDA(); because
do not decrement the stack pointer what do you think?
regards,
Domingos Bento
_________________________________________________________
CEAC Cursos de forma\ufffd\ufffdo profissional - pe\ufffda informa\ufffd\ufffdes aqui.:
http://ceac.online.pt/Message
lpc2129 Stack pointer problem
2004-11-05 by dasbento@aeiou.pt
Attachments
- No local attachments were found for this message.