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


configTOTAL_HEAP_SIZE and lwIP

Posted by Nobody/Anonymous on January 17, 2006
I'm currently testing the "lwIP_Demo_Rowley_ARM7" for AT91SAM7X. I try to
reduce RAM usage without affect the WEB page application (BasicWEB.c). I
removed all .c files in Demo App folder except for main.c, heap.c and

It looks like I cannot reduce "configTOTAL_HEAP_SIZE" under 10000 without
affecting the WEB page functionality. Is this normal ? Is there a mimimum
to allow to configTOTAL_HEAP_SIZE ?


RE: configTOTAL_HEAP_SIZE and lwIP

Posted by Richard on January 17, 2006
I would expect to get it under that, but have not tried.

As downloaded:
The lwIP task has a stack size of 600*4 bytes,
The WebSvr task stack has a size of 250*4 bytes, and
The ETH_INT task stack has a size of 350*4 bytes.

If you have removed all the other demo tasks you are left with the idle task stack (small) and a few queues, TCB, etc. 10000 would seem more than enough. Maybe there is a large queues used by the lwIP code somewhere, can't remember.

The FreeRTOS kernel itself tries where possible not to use too much stack. The lwIP code uses standard libraries (not efficient in GCC, but better if you are using Rowleys build), and is outside of the FreeRTOS kernel and therefore does not have the same design goal. This is the reason for the 600*4 stack used by the lwIP task.

I would suggest setting a break point in the function pvPortMalloc() in the file heap_2.c. When the execution breaks here you can inspect the xWantedSize value (the number of bytes being obtained), and see when large chunks of memory are being allocated and why. This will assist in diagnosis.

Are you using command line GCC or Rowley?


RE: configTOTAL_HEAP_SIZE and lwIP

Posted by Nobody/Anonymous on January 18, 2006
I'm using Rowley.

[ 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