Per the FreeRTOS documentation to handle API calls inside of an interrupt I need to taskYIELD if necessary, I have the following ISR:
void __attribute__ ((__interrupt__, no_auto_psv)) _T4Interrupt(void)
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
IFS1bits.T4IF = 0;
xQueueSendToBackFromISR(queue_name, &queue_data, &xHigherPriorityTaskWoken);
if(xHigherPriorityTaskWoken == pdTRUE)
taskYIELD(); // Force context switch
Everytime xHigherPriorityTaskWoken is true and the taskYIELD() executes, my processor resets. I’ve debugged to determine this is correct. If I comment out the taskYIELD, everything works smoothly.
The only thing I can think is that the priority of this interrupt is 7 and the tick timer has priority 1, but I’m not disabling any interrupts and per the RTOS docs this should be the correct method to use.