I'm still having an extremely hard time getting IRQ interrupts of any sort to work on my AT91R40008. Does anyone have a simple boot.s that sets up all the stacks for IRQ interrupts and then can branch to C functions? I am not using any debug monitors like Angel. I am not using any pre-canned libraries (like Atmel's) I am using gcc-3.2, and I am trying to implement my interrupt handlers in C also.
Here is exactly what I'm trying to do:
- I'm not bothering with running from flash at the moment. Currently I"m locating my code at 0x00, manually initiating a REMAP through my JTAG interface and then loading the code (so it should be all loaded into RAM)
- I have a small test program which toggles PIO pins every TIMER0 overflow interrupt.
The problems I've been having:
- The pin will go high (suggesting the reception of 1 interrupt) and then stay high - halting the processor results in the PC being at either Data Abort or Program Abort in the vector table (the first weirdness).
- If I issue a RESET command, and then execute the program again (w/o powering down the chip), the program runs fine and just loops infinitely on my while(1) { } at the end of main, but there is no pin toggling at all (suggesting no reception of interrupts)
I have been communicating with Tauno somewhat and he has been a great help so far.
Here's what I understand I must do (but may not be implementing it correctly): Setup the IRQ, SVC, and SYS stacks. Enable Timer interrupts in the TC registers and the AIC (pretty sure I have this correct). Setup interrupt vector in the AIC (pretty sure I also have this correct). Writing to AIC_EOICR at the end of the interrupt handler (I have this correct).