There are a few things which need to be done:
- In the documentation of the AT91F_AIC_ConfigureIt function the first parameter is described as "pointer to the AIC registers" and therefore when you configure your interrupt you should pass AT91C_BASE_AIC but not AT91C_BASE_PIOA. I'm not absolutely sure why is that but it just works only if I pass the AT91C_BASE_AIC register. You do the same for the AT91F_AIC_EnableIt call. The activation level that works for me is AT91C_AIC_SRCTYPE_EXT_LOW_LEVEL - (AIC) External Sources Code Label Low-level Sensitive.
- If you are using IAR you have to do a few more steps. You need to decide whether your interrupt service routine should cause a context switch. Look here for an example.
In my case - I needed a context switch, so I had to create a DriverISR.s79 assembler file where I execute
portSAVE_CONTEXT
call the ISR routine
portRESTORE_CONTEXT
And this is all FreeRTOS specific (this is also described in the demo from the link above).
Best Regards,
Bobi