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

lwIP & timer question

Posted by Nobody/Anonymous on August 17, 2006
The lwIP demo that ships with FreeRTOS initialises the network interface in the task that runs the webserver, having tried to move the code out, I now know why it's in there. (it causes a data abort if called from outside a task!)

Inside the ethernetif_init routine is a call to sys_timeout, now this will only work if it is called from a task because its timeout list is per task, otherwise it returns NULL.

I don't want the network initialisation code inside a task because to me it's not conceptually the right place for it to be, my solution has been to replace the sys_timeout call with a task which blocks the same amount of time and then calls the arp_tmr function. (it's doing exactly the same as sys_timeout call).

Are there any disadvantages to doing this? Is there any reason that richard didn't do this? Ok, I'm eating up a bunch of RAM having this task doing it this way, but it means that my other tasks have access to the tcp stack as soon as they start up, they're not dependant on another task initialising the ethernet interface.

Thanks.

RE: lwIP & timer question

Posted by Nobody/Anonymous on August 17, 2006
The initialization will have to be in the task if either it blocks (what happens if the network cable is not connected?), calls a blocking function, or uses a queue or semaphore that is not created until the task is running. Any of these things could cause it to crash. Otherwise I don't see why to do in in the task. My hardware is initialized before the scheduler is started.

RE: lwIP & timer question

Posted by Nobody/Anonymous on August 17, 2006
This is an "after the event" question, it works absolutely fine. I was just wondering why richard chose to do it the way he did it rather than starting a task to handle the arp timer.

RE: lwIP & timer question

Posted by Nobody/Anonymous on August 17, 2006
Probably because that is how it is done in the uIP demo - and that come first ;-)


[ 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