Quality RTOS & Embedded Software

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


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 ]    [ 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.


Careers

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

Renesas

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