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

FreeRTOS: Memory Management Realloc Issues

Posted by sunilpuli18 on May 26, 2016

Hi Team,

I am using FreeRTOS on ARMCortex microcontroller. Everything is working fine.

But the issue is when i try to do malloc and free multiple times it will be in while loop it never comes out of it.

Same is the case with Realloc, if the same variable I try to increase the size with Realloc, it will never work, it will be in while loop it never comes out of it.

But ample memory space is there to allocate, but still it fails and gets struck in while loop.

I am using heap4.c file for memory. void *pvPortMalloc( sizet xWantedSize ) and void vPortFree( void pv ) void pvPortReAlloc( void *pv, size_t xWantedSize ) these are the functions used.

Is there any limit on number of memory allocations allowed? I dont think that should create any problem.

Please help me in solving this issue.

Please provide me your kind assitance in solving this issue.

Thanks,Regards, Kumar.


FreeRTOS: Memory Management Realloc Issues

Posted by rtel on May 26, 2016

heap_4, as provided by us, does not include pvPortReAlloc(), so I'm afraid we can't assist with that. I would recommend asking whoever provided the code.

Regards.


FreeRTOS: Memory Management Realloc Issues

Posted by sunilpuli18 on May 26, 2016

Hi Team,

Thanks for the immediate reply. Thanks for your kind information.

so you mean to say FreeRTOS does not support Realloc functionality.

If it supports Realloc functionality, can you please share me the source for the same.

Please help me in solving this issue.

Please provide me your kind assitance in solving this issue.

Thanks,Regards, Kumar.


FreeRTOS: Memory Management Realloc Issues

Posted by rtel on May 26, 2016

If you need to use realloc() then consider using heap3.c. Note heap3 just wraps the memory allocation provided by your C run time libraries to make them thread safe, so does not use the configTOTALHEAPSIZE parameter, and the memory allocators suitability depends on the compiler: http://www.freertos.org/a00111.html


FreeRTOS: Memory Management Realloc Issues

Posted by sunilpuli18 on May 26, 2016

Hi Team,

Thanks for the immediate reply. Thanks for your kind information. Actually the entire image is built with heap4, and additionally realloc function is added to this.so again reverting to the heap3 requires complete image change. So can you please help with the realloc function. Please help me in solving this issue. Please provide me your kind assitance in solving this issue. Thanks,Regards, Kumar.


[ 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