I am using FreeRTOS for my project.
The primary tasks for the Scheduler have LED blinking code.
I am trying to configure an Interrupt for INT1 signal.
But when ever the interrupt occurs the chip enters _general__general_exception_handler().
Following are my Hardware & Software Details:
PIC32MX360F512L
SYSCLK = 40MHz
PBCLK = 40MHz
MPLAB 8.15a
MPLAB C32 v1.04
FreeRTOS v5.1.0
INTEnableSystemMultiVectoredInt() sets the microcontroller to use multi vectored mode rather than routing all interrupts through a single vector entry. The PIC32 has to option to use both methods.
portDISABLE_INTERRUPTS() is called to prevent interrupts from occurring before the scheduler has been started. This is because any interrupt that executes and attempts a context switch (or maybe even calls an API function) before the scheduler has started could cause the system to crash. Interrupts are automatically re-enabled as the context of the first task to run is restored.
I have tried lots of tricks but the program still enters the "_general_exception_handler". Although going through the FreeRTOS demo I realized the fact that there is some separate context switch required for the Interrupt but even that did not help. Another thing that I observed when I was in the "_general_exception_handler" the Interrupt Flag for the INT1 interrupt shows in the INTSTAT register along with the priority of the vector. This means that some where the OS is crashing and and giving rise to some un-handled exception.
If there is simpler example for the interrupt handling under FreeRTOS port for PIC32 please let me know.