Quality RTOS & Embedded Software

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


data abort in heap_4.c

Posted by agnishant on February 10, 2014

I get a data abort, at a random point of program execution inside the heap_4 function prvInsertBlockIntoFreeList, at the line "pxIterator->pxNextFreeBlock = pxBlockToInsert;". I went through the application to see if there is are memory leaks and greatly reduced the memory allocation calls to the required minimum. But the same heap is also being used by lwIP. What could have caused the problem or at which should I test to pin point the cause.

data abort in heap_4.c

Posted by agnishant on February 10, 2014

I further checked and found that the value of pxIterator is 0. If I am correct, if pxIterator was 0 from the start, the code would not reach here, but when this function is being called, all the tasks are suspended so I dont see how this problem could occur. Desperately need some feedback. If it would help, the controller in use is LPC2387.

data abort in heap_4.c

Posted by davedoors on February 10, 2014

Have you implemented the functions in sysarch.c to make lwip safe to use with FreeRTOS? Search for sysarch in FreeRTOSDemoCommonethernetlwip-1.4.0ports to see examples.

data abort in heap_4.c

Posted by agnishant on February 10, 2014

Yes I have done that, called vTaskSuspendAll for protect and xTaskResumeAll for unprotect.

data abort in heap_4.c

Posted by agnishant on February 10, 2014

I also changed the sys_arch functions to disable/enable the interrupts as well but still the problem exists. Also variable "pxIterator" is 0 after the for loop at the start of the function "prvInsertBlockIntoFreeList" which is causing the data abort.

data abort in heap_4.c

Posted by rtel on February 10, 2014

heap4.c has been thoroughly tested, both systematically and by thrashing. Although obviously we can't guarantee there aren't any problems with heap4 it is most likely that your problem lies elsewhere in your system. lwIP being the most obvious place, but also it could simply be a configuration problem.

Which port of FreeRTOS are you using? Is it up to date (newer version have more configASSERT() statements to trap common misconfigurations). Do you have configASSERT() defined? Do you have a stack overflow hook defined? Have you looked through the "my application does not run what could be wrong?" page of the FAQ?


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





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