endless loop in function xTaskResumeAll

ozga wrote on Monday, March 04, 2019:

I have a bug in my project that occurs from several functions ( vTaskDelay(), xQueueReceive() )- these functions calls to xTaskResumeAll and the CPU stuck in endless loop while loop because the list ‘xPendingReadyList’ is equal to 1 and never become equal to zero.
does anyone faced such a bug or maybe it was fixed?

I am working with FreeRTOS V7.4.0 on cortex M-3 cpu

the relevant code section in xTaskResumeAll() :

/* Move any readied tasks from the pending list into the
appropriate ready list. */
while( listLIST_IS_EMPTY( ( xList * ) &xPendingReadyList ) == pdFALSE )
pxTCB = ( tskTCB * ) listGET_OWNER_OF_HEAD_ENTRY( ( ( xList * ) &xPendingReadyList ) );
uxListRemove( &( pxTCB->xEventListItem ) );
uxListRemove( &( pxTCB->xGenericListItem ) );
prvAddTaskToReadyQueue( pxTCB );

				/* If we have moved a task that has a priority higher than
				the current task then we should yield. */
				if( pxTCB->uxPriority >= pxCurrentTCB->uxPriority )
					xYieldRequired = pdTRUE;


rtel wrote on Monday, March 04, 2019:

Most likely an interrupt priority mis-configuration. This was one of
the most common issues at one time, which is why we added so many
additional configASSERT() calls to try and catch them all. If you are
using such an old version then your code won’t have these asserts so I
would recommend updating to at least V10.1.1 (V10.2.0 being the latest)
to see if that highlights the issue.

ozga wrote on Tuesday, March 05, 2019:

Hi richard,
Thanks for reply.
The problem is that I can’t upgrade the freertos version (project’s procedure).
The ‘guilty’ interrupt is probably configure to high-priority instead of lower priority?
Is there any way to catch the interrupt that cause the bug without upgrading the version?


richarddamon wrote on Tuesday, March 05, 2019:

If you are really stuck using the older version, then what could be done is temporarily switch to a newer version just to get the testing on a side copy of the project, and see which interrupt fires the assert on bad priority, fix your code and then switch back to the main version moving those fixes. If I remember right, from Verions 7 to Version 10 is pretty much just drop in replacable, the changes are all additions, and not API changes.