FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2016 Threads] pvPortMalloc and vPortFree problem after a vTaskDelete callPosted by lucabo81 on July 18, 2016 Hi,
my application is composed by many threads.
One of this threads at each execution alocates some variables in the heap (I'm using the heap_4.c) end free those variables after their use.This task run periodically.
One other thread manage some memory transfer through the DMA and run only one time. At the end of this task, a vTaskDelete(NULL) is called.
Problem is following:
Until the second thread is alive, all it's ok. variables of first task are allocates and deletes alwais at same addresses.
But when the second thread terminates, FreeRTOS goes in hard fault after the first thread execution.
What can be the problem?
Thanks
pvPortMalloc and vPortFree problem after a vTaskDelete callPosted by rtel on July 18, 2016 I can't really say without seeing more of your application.
Does the Idle task ever get any processing time? If a task deletes
itself, which in this case it is, the heap and TCP used by the task will
be freed in the Idle task, so if the Idle task is not running the memory
will never get freed - but that should not result in a crash unless you
run out of heap without noticing and subsequently attempt to access a
NULL pointer.
Other than that, the usual replies apply (do you have stack overflow
checking on, do you have configASSERT() defined, have you tried to debug
the hard fault, etc.) info on all of which can be obtained from the
following page: http://www.freertos.org/FAQHelp.html
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|