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:
void vNRST_pin_interrupt(void)
{
AT91C_BASE_MC->MC_RCR = AT91C_RSTC_PROCRST;
}
But it seems the interrupt function is never called.
What am I forgetting or doing wrong?
Now I only enable user reset with:
AT91C_BASE_RSTC->RSTC_RMR = (0xA5000000 | 91C_RSTC_URSTEN);
at startup. When I compile without starting scheduler, it works. Any idea what could block the NRST pin functionality?
Finally, I found out it was the EMAC_Init function that posed problem.
When changing the NRST output length, the function overwrites the other config bits (allowing user reset by NRST input). I have simply masked the register and insured that only the reset signal length was modified and it works.
I am posting this in case someone else has the same problem…