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


Free memory withe PIC32

Posted by barber colman on January 18, 2010
I am looking at using FreeRtos with a PIC32MX. I compiled and ran the demo. MPLAB shows 31996 out of 32768 bytes of ram used. I have previously used FreeRtos on an AVR part with far less ram. I think FreeRtos has grabbed all the ram but hopefully is not using all of it.

What is the easiest to check for free ram?

RE: Free memory withe PIC32

Posted by Richard on January 18, 2010
If you are using heap_1.c or heap_2.c then configTOTAL_HEAP_SIZE in FreeRTOSConfig.h will dimension a simple array that is used as the heap. The memory gauge in MPLAB will show you the entire heap as used RAM - even though only part of it will actually be used.

The demo applications generally just keep generating tasks until the RAM is exhausted. You can use xPortGetFreeHeapSize() to see how much heap is unused once your application is running. You can then reduce the setting of configTOTAL_HEAP_SIZE accordingly.

Use uxTaskGetStackHighWaterMark() to fine tune the stack size allocated to each task.


RE: Free memory withe PIC32

Posted by barber colman on January 18, 2010
I am looking at the API Referenc and do not find xPortGetFreeHeapSize. Am I missing it or is xPortGetFreeHeapSize documented else ware?

RE: Free memory withe PIC32

Posted by Richard on January 18, 2010
You are right - I just had a look at its missing. The prototype is:

size_t xPortGetFreeHeapSize( void );


RE: Free memory withe PIC32

Posted by barber colman on January 18, 2010
Do you know who does the demos? I used xPortGetFreeHeapSize() and found there is 0x01D8 bytes of free heap. This means that the demo is using approximately 27.5K of ram.

Is there a demo that leaves enough ram to add an application?

I did find a reference to printf taking a lot of space. I will try to remove it, but, STILL 27.5K

[ 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