I am trying to activate the reset button on the SAM7X demo board within FreeRTOS. Here is the code I use, that is called in AT91F_LowLevelInit():
//configure system interrupts at highest priority level
AT91F_AIC_ConfigureIt(AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, AT91C_AIC_SRCTYPE_EXT_NEGATIVE_EDGE,( void (*)( void ) ) vNRST_pin_interrupt);
//clears NRST pin interrupt
reader = AT91C_BASE_RSTC->RSTC_RSR;
//enables NRST pin interrupt
AT91C_BASE_RSTC->RSTC_RMR = (0xA5000000 | 91C_RSTC_URSTIEN);
//enables system interrupt
AT91C_BASE_AIC->AIC_IECR = (1 << AT91C_ID_SYS);
Then I connect the peripheral clock to the system :
AT91C_BASE_PMC->PMC_PCER = 1 << AT91C_ID_SYS;
I added this line in static void prvSetupHardware( void ) in main.c.
I also wrote my interrupt function that is supposed to reset the processor:
AT91C_BASE_MC->MC_RCR = AT91C_RSTC_PROCRST;
But it seems the interrupt function is never called.
What am I forgetting or doing wrong?