Hi Ewan
I see no problems with the configuration code.
1. Is the interrupt (rising edge on IRQ1) occurring or not? Or is it crashing even without the interrupt taking place?
2. I am not absolutely sure whether the interrupt routine is being called or not. Assuming that you are debugging with CW it is sometimes difficult to get a break point on a certain line of code (due to optimisation). I would suggest putting it deeper down - in the IRQ routine itself. This is a static
__interrupt__ void _irq1_handler(void) in
M5223x.cIf you get here it means that the interrupt is firing and you can step to see whether the call back is being dispatched correctly or not.
3. The only reason that I can think of that will cause the interrupt to fail before getting to
_irq1_handler(void) is if the vector table in SRAM has been corrupted. This is however very unlikely.
4. Note that the interrupt handler (in your case
RC531_IRQ_OnInterrupt()) is a call back from within the IRQ interrupt routine itself. Interrupts are disabled on entry. You have to be a little careful what is actually performed in the interrupt routine, but I don't know whether this is an issue at the moment.
5. If you need to debug the cause of a particular exception you can also use the following guide as help:
http://www.utasker.com/forum/index.php?topic=123.msg468#msg468Regards
Mark