Task blocking in xQueueReceive but not on the xTasksWaitingToReceive list

I managed to get one of my tasks hanging in the following situation:


Neither the scheduler ends the wait after xTicksToWait, nor the queue activated because of the waiting message. So somehow the OS has completely missed the fact that xQueueReceive was called, even though it is currently yielding right inside that call.


I guess it is a 99% chance this is not a FreeRTOS bug but wrong usage somewhere, but what kind of misuse could trigger such a result?

most probably a misuse of a critical section or a violation of the ISR rules (ISR API call > MAX_SYSCALL, mismatch in xxxFromISR call discipline, Syscall isr not lowest priority or something the like). Good luck!

Edit: If this is a custom port, have a very close look at the port implementations of isr mask manipulation, critical section and related.

Looks like the mismatch in that case was an explicit call to suspend because the power management mistakenly thought that hardware area was already unused. Thank you for the pointers nonetheless.

Thanks for reporting the solution! :slightly_smiling_face: