I’m having a problem of a crash whenever a FromISR function is called in my TWI0_Handler(). I have followed the interrupt priority rule as mentioned here (and tried different numbers) http://www.freertos.org/RTOS-Cortex-M3-M4.html but the problem persists.
So configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY is set to 5 and configLIBRARY_LOWEST_INTERRUPT_PRIORITY is set to 0x0f (as in Demo for SAM3X). And this is how the interrupt is initialized:
NVIC_SetPriorityGrouping( 0 ); NVIC_DisableIRQ(TWI0_IRQn); NVIC_ClearPendingIRQ(TWI0_IRQn); NVIC_SetPriority(TWI0_IRQn, 6); NVIC_EnableIRQ(TWI0_IRQn);
and this is the TWI ISR:
int status = twi_get_interrupt_status(TWI0);
portBASE_TYPE xTaskWoken = pdFALSE;
xSemaphoreGiveFromISR( testHandle, &xTaskWoken ); // hangs here printf("passed fromISR\n"); portEND_SWITCHING_ISR( xTaskWoken );
Do I miss anything here?
Thank you very much for your help!