I am going to write a simple example to test CM408 PORT interrupt on an EZkit (I could not figure out how it works in ADI Button_LED example, way too complex and lot of code!!!)
My code is very simple. My main.c is a simple while(1) loop.
I've written my-own simple startup code which includes things like:
void PINT0_BLOCK_Int_Handler(void); // 18 Pin Interrupt Block
int const __vector_table @ ".intvec" =
(int) &PINT0_BLOCK_Int_Handler, // 18 Pin Interrupt Block
(int) &PINT1_BLOCK_Int_Handler, // 19 Pin Interrupt Block
My ISRs are very simple like:
I set NVIC_ISER0 to 0x0004 0000 to enable PINT1 interrupt. The moment I set NVIC_ISPR0 to 0x0004 0000 to enforce interrupt I get a HardFault exception and it says "instruction executed with an invalid EPSR.T, EPSR.IT.......).
My interrupt vector table and all ISRs sit nicely in the memory, I do not know why it goes to HardFault exception when I have its ISR and vector address right.
Any help is much appreciated. (sorry, it might be a silly problem but I have got stuck with it for a while!)