uIP Demo IAR ARM7 ethernet initialisation.

When running the free rtos code uIP_Demo_IAR_ARM7, i cant initialise
xEMACInit();
On debug i found that
vTaskPrioritySet( NULL, tskIDLE_PRIORITY );
after this fuction is called, the control will finally goes to static portTASK_FUNCTION( prvIdleTask, pvParameters )
and then exectes the fuction prvCheckTasksWaitingTermination();
within the prvCheckTasksWaitingTermination function, the condition within
if( uxTasksDeleted > ( unsigned portBASE_TYPE ) 0 )  is
not checking.The default value set for  uxTasksDeleted is 0. And this is
repeating. The control not going to the while( xSemaphore == NULL )
{
xSemaphore = xEMACInit();
}
vTaskPrioritySet( NULL, uxPriority ); /* Initialise the EMAC.  A semaphore will be returned when this is
successful. This routine contains code that polls status bits.  If the
Ethernet cable is not plugged in then this can take a considerable time.
To prevent this starving lower priority tasks of processing time we
lower our priority prior to the call, then raise it back again once the
initialisation is complete. */
uxPriority = uxTaskPriorityGet( NULL );
vTaskPrioritySet( NULL, tskIDLE_PRIORITY );
while( xSemaphore == NULL )
{
xSemaphore = xEMACInit();
}
vTaskPrioritySet( NULL, uxPriority );

uIP Demo IAR ARM7 ethernet initialisation.

I’m not completely sure I understand the issue you are describing – the bit about prvCheckTasksWaitingTermination() does not seem relevant to the rest of the question.  I will try and answer all the same. When you set the priority of a task to the idle priority then I would expect a context switch to another task to occur.  If there are no higher priority tasks then it is very likely that the idle task will be the next to run – which is the behaviour you are describing. The idle task will run until there is a tick interrupt, or the idle task yields (depends if configIDLE_SHOULD_YIELD() is set in FreeRTOSConfig.h).  When either of these things happen, then the idle task may again be the task chosen to run next if there are still no higher priority tasks able to run. As I recall, the EMAC driver includes some code to initialise the Ethernet PHY and wait for a link to be established.  If a link is not established, then this initialisation code will just keep trying until it is, so it is likely that in this case you will not see execution progress past the PHY initialisation in the EMAC driver. Regards.