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

IAR Linker script and FreeRTOSConfig.h

Posted by Craig on April 11, 2013
I using IAR EWARM 6.5x and FreeRTOS 7.1.0
I have 3 questions related to memory management.

1) I am a bit confused on the relationship between the heap size in the IAR linker script and the configTOTAL_HEAP_SIZE in FreeRTOSConfig.h, if any. Is configTOTAL_HEAP_SIZE only for the RTOS and the size in the linker script for everything else? I am using heap.4. I dont see anything in the map file that resides in the heap space defined by the linker script.

2) I understand the Stack size in the linker script is only used by main before the scheduler starts. I know each task has its own stack, Does that allocation for these stacks come out the memory defined by configTOTAL_HEAP_SIZE ?

3) I am using lwIP in my application and it uses malloc and free as defined in mem.h. Should I use pvPortMalloc and pvPortFree instead? The lwIP example I based my app off of came from NXP and used FreeRTOS so I dont understand why it wouldnt already use pvPortMalloc and pvPortFree.

Thanks for any help.

RE: IAR Linker script and FreeRTOSConfig.h

Posted by MEdwards on April 11, 2013
“Is configTOTAL_HEAP_SIZE only for the RTOS and the size in the linker script for everything else?”


Effectively yes. configTOTAL_HEAP_SIZE is used if pvPortMalloc() is called. The heap set by the linker script is used if malloc() is called. The RTOS only uses pvPortMalloc(). Application code and drivers might use one or both.


“I am using heap.4”
.

heap_3.c is the only provided memory manager that uses malloc(). Heap_1, 2 and 4 uses configTOTAL_HEAP_SIZE.

“2) I understand the Stack size in the linker script is only used by main before the scheduler starts.”


Some ports also use that stack as the interrupt stack.

“ I know each task has its own stack, Does that allocation for these stacks come out the memory defined by configTOTAL_HEAP_SIZE ?


Yes.

“3) I am using lwIP in my application and it uses malloc and free as defined in mem.h. Should I use pvPortMalloc and pvPortFree instead? The lwIP example I based my app off of came from NXP and used FreeRTOS so I dont understand why it wouldnt already use pvPortMalloc and pvPortFree.”


Ask NXP?

RE: IAR Linker script and FreeRTOSConfig.h

Posted by Craig on April 11, 2013
Thanks very much!


[ 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