I am currently using the FreeRTOS in a project using a PIC32MX. It all
worked properly until I added an xTaskCreate from inside an interrupt
routine. The system crashed!.
The created task started with an xTaskDelay and although it reached this
function it never returned but failed on an address problem.
There is a simple rule of thumb (which doesn’t hold in all cases, but is
easy to state and follow): Do not call any API function that doesn’t
end if ‘FromISR’ from an interrupt.
That is particularly true of xTaskCreate(), which will allocate memory.