Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

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

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.

Regards.


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




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists