Quality RTOS & Embedded Software

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


death test failure

Posted by Yen on April 9, 2008
Hi, I have successfully ported FreeRTOS 4.7.1 on a microprocessor and all the demo are working. Recently, I have ported the same version of FreeRTOS to a different toolchain. The death test failed. It runs for a while (vCreateTasks are created a few times) and then crashes. I have increased substantially the stack size for the vCreateTasks (3Kbytes) and vSuicidalTask(1Kbytes) to determine if this could be stack overflow problem (I have 23Kbytes of heap memory and this is the only test running). However, this does not seem to solve the problem. What are the other possible causes for the test to fail please?

RE: death test failure

Posted by Dave on April 9, 2008
Which compiler are you using, and which heap file are you including in your project (heap_1.c, heap_2.c or heap_3.c)?

RE: death test failure

Posted by Yen on April 9, 2008
I am using heap_3.c. The compiler is GCC

RE: death test failure

Posted by Dave on April 9, 2008
GCC libraries are huge so stack issues could be an issue - although you say you have increased it already.

configTOTAL_HEAP_SIZE has no effect when using heap_3 so it could be that your linker script is not setting up a heap at all, or that the one it is setting up is very small.

Try switching to heap_2.c, in which case configTOTAL_HEAP_SIZE does dimension the heap.

RE: death test failure

Posted by Yen on April 9, 2008
Hi, I have verified that the linker script is correctly setting up the amount of heap memory requested. This is done by doing a loop malloc'ing 1K of memory, and the counter returned did reflect the heap memory specified in the linker script. Anyway, I manage to run ALL the other demo tasks concurrently (except "death" demo). Presumably this is sufficient to show the linker script is working.

I have looked further into this problem. It looks like the vSuicidalTask did not manage to kill and free the tasks stacks. Looking at the memory addresses allocated for the "pxNewTCB" and "pxNewTCB->pxStack" of each of the vSuicidalTask. The "pxNewTCB->pxStack" of "SUICID1" and the "pxNewTCB" & "pxNewTCB->pxStack" of "SUICID2" are different each time these two tasks are created. The program crashes when the "pxNewTCB->pxStack" of "SUICID1" overlaps with the "pxNewTCB" of "SUICID2". I am not sure what are the causes the task was not deleted?

RE: death test failure

Posted by woops_ on April 9, 2008
Does the idle task ever run. It must run to free up the memory. Do you have any tasks running about the idle task that do not ever block.

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

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

Latest News

Version 10.1.0 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.


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


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