Quality RTOS & Embedded Software

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


Loading

PIC32 port data memory usage

Posted by wne on October 14, 2009
I want to find out why it us 32084/32768, which occupied about 98% data memory. Can anyone help on:
1. what part program or variables contribute such big percentage occupation.
2. How can I reduce the percentage usage, such that I can develop more my application based on this port. Thanks.

RE: PIC32 port data memory usage

Posted by wne on October 14, 2009
I can reduce the data memory size by setting:

#define configTOTAL_HEAP_SIZE( ( size_t ) 0 )

But, I also compiled the port Microchip integrated their library into. The define above does not work. The resulting data memory usage is:

kseg1 Data-Memory Usage
section address length [bytes] (dec) Description
------- ---------- ------------------------- -----------
.data 0xa0000200 0xc24 3108 Initialized data
.sdata 0xa0000e24 0x8 8 Small initialized data
.sbss 0xa0000e2c 0x58 88 Small uninitialized data
.bss 0xa0000e84 0x844 2116 Uninitialized data
.heap 0xa00016c8 0x5dc0 24000 Dynamic Memory heap
.stack 0xa0007488 0x400 1024 Minimum space reserved for stack
Total kseg1_data_mem used : 0x7688 30344 92.6% of 0x8000
--------------------------------------------------------------------------
Total Data Memory used : 0x7688 30344 92.6% of 0x8000
--------------------------------------------------------------------------


RE: PIC32 port data memory usage

Posted by MEdwards on October 14, 2009
See this page http://www.freertos.org/a00111.html

RE: PIC32 port data memory usage

Posted by Richard Damon on October 14, 2009
You biggest memory usage is the "malloc heap" which is set at 24k. This can probably be reduced. It's size is set up in the option pages under the linker I believe. If your program is using the C heap, then it might make sense to use it for freeRTOS too by using heap3.c If you don't need the heap (you don't use malloc, even indirectly through other library calls) then you can get rid of the heap entirely. If you do use the heap, you will need to make sure that all allocations and deallocations are protected with a critical section or mutex, as I suspect the library is not set up to be naturally thread safe. (That or all allocations must be from a single thread).

RE: PIC32 port data memory usage

Posted by wne on October 15, 2009
I am still confused about where "malloc heap" is and how to reduce it. Where is the "option pages under the linker"? There is no linker file in the project tree listed in Maplab. The file "heap_3.c" is indeed included in the source files in Mplab. I don't need the heap, but I don't know how to get rid of the heap. Please instruct me a little more detail. Thanks.

RE: PIC32 port data memory usage

Posted by wne on October 15, 2009
I found where the 24k was set. It is in build optioin->MPLAB PIC32 linker, heap size.

RE: PIC32 port data memory usage

Posted by Richard Damon on October 15, 2009
I don't have the PIC32 package on my machine, but for the dsPIC/PIC24 package, in the project options, under the linker tab, is a box to set the heap size.


[ 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