Quality RTOS & Embedded Software

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


Loading

heap2 and heap3 in Freertos

Posted by Bill Yang on February 15, 2010
Hi,

I am compiling the Freertos + lwIP +Keil +LM6965 demo and got some questions regarding the use of heap2. and heap3.

If I compile with heap2.c the RAM ZI Data is about 60KB as below showing.
Code (inc. data) RO Data RW Data ZI Data Debug Object Name
0 0 0 0 0 700 api_lib.o
8758 3596 142 4 0 21648 dhcp.o
4634 1480 412 1 200 12426 etharp.o
2344 128 24 24 0 7935 ethisr.o
258 18 3200 0 200 4903 fs.o
252 14 0 20 24000 3311 heap_2.o
1184 66 99 0 0 7244 httpd.o
1304 428 0 0 0 2413 icmp.o
62 0 0 0 0 4872 inet.o
550 114 0 0 0 3526 inet_chksum.o
34 0 0 0 0 880 init.o
2656 902 222 2 0 5018 ip.o
78 0 8 0 0 5413 ip_addr.o
146 0 0 0 0 3949 list.o
1680 536 0 0 52 19893 lwipstack.o
802 388 0 0 0 25479 main.o
1368 184 0 16 18452 4513 mem.o
492 76 189 52 11335 3858 memp.o
1376 398 0 12 0 7752 netif.o
1844 410 71 0 0 7461 pbuf.o
336 44 0 4 0 4097 port.o
1078 0 0 0 0 8809 queue.o
104 4 0 4 0 1576 raw.o
700 76 571 9 0 5073 rit128x96x4.o
276 256 0 0 2048 412 startup_rvmdk.o
0 0 0 0 280 1693 stats.o
514 66 0 0 0 2851 sys.o
638 44 0 2 32 10831 sys_arch.o
2288 192 20 76 250 16476 tasks.o
5508 1658 89 33 0 27602 tcp.o
8480 1708 162 32 20 14864 tcp_in.o
4862 1354 353 0 0 8959 tcp_out.o
864 290 0 16 0 24718 tcpip.o
1538 84 57 28 2048 8341 uart0.o
1538 86 40 28 2048 7897 uart1.o
3150 1048 0 4 0 13079 udp.o
----------------------------------------------------------------------
61740 15648 5708 376 60968 310472 Object Totals

However, if I use heap3.c that the ZI Data is about 36KB RAM as below showed.
Code (inc. data) RO Data RW Data ZI Data Debug Object Name
0 0 0 0 0 700 api_lib.o
8758 3596 142 4 0 21648 dhcp.o
4634 1480 412 1 200 12426 etharp.o
2344 128 24 24 0 7935 ethisr.o
258 18 3200 0 200 4903 fs.o
46 0 0 0 0 1083 heap_3.o
1184 66 99 0 0 7244 httpd.o
1304 428 0 0 0 2413 icmp.o
62 0 0 0 0 4872 inet.o
550 114 0 0 0 3526 inet_chksum.o
34 0 0 0 0 880 init.o
2656 902 222 2 0 5018 ip.o
78 0 8 0 0 5413 ip_addr.o
146 0 0 0 0 3949 list.o
1680 536 0 0 52 19893 lwipstack.o
802 388 0 0 0 25479 main.o
1368 184 0 16 18452 4513 mem.o
492 76 189 52 11335 3858 memp.o
1376 398 0 12 0 7752 netif.o
1844 410 71 0 0 7461 pbuf.o
336 44 0 4 0 4097 port.o
1078 0 0 0 0 8809 queue.o
104 4 0 4 0 1576 raw.o
700 76 571 9 0 5073 rit128x96x4.o
276 256 0 0 2048 412 startup_rvmdk.o
0 0 0 0 280 1693 stats.o
514 66 0 0 0 2851 sys.o
638 44 0 2 32 10831 sys_arch.o
2288 192 20 76 250 16476 tasks.o
5508 1658 89 33 0 27602 tcp.o
8480 1708 162 32 20 14864 tcp_in.o
4862 1354 353 0 0 8959 tcp_out.o
864 290 0 16 0 24718 tcpip.o
1538 84 57 28 2048 8341 uart0.o
1538 86 40 28 2048 7897 uart1.o
3150 1048 0 4 0 13079 udp.o
----------------------------------------------------------------------
61536 15634 5708 356 36968 308244 Object Totals
That will be a big different between use of heap2 and heap3. I wonder if any one can point me some information regarding this question. If this is true, I cannot use heap2 because I application is about 30KB already. It will blow up the SRAM usage for LM6965 that has 64KB SRAM only.

Thanks,
Bill

RE: heap2 and heap3 in Freertos

Posted by MEdwards on February 15, 2010
RTFM http://www.freertos.org/a00111.html

RE: heap2 and heap3 in Freertos

Posted by Bill Yang on February 15, 2010
Ok. I read and understood that the heap2 memory size is defined in FreeRTOSConfig.h, which is 24000.

#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24000 ) )

Now I compiled my application and looked at the map file. It showed the heap2 ZI Data size is 24004 as below.

220 14 0 20 24004 3335 heap_2.o

I wonder if it means the heap2 ZI Data has been used over the defined limit 24000?

Thanks,
Bill


[ 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