Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


uIP Demo IAR ARM7 ethernet initialisation.

Posted by Sandeepsiv on December 1, 2010

When running the free rtos code uIP_Demo_IAR_ARM7, i cant initialise
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

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

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 );

RE: uIP Demo IAR ARM7 ethernet initialisation.

Posted by Richard on December 1, 2010
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.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner