I've no idea how this got into the code... Everything was working I promise.
esp-idf/components/freertos/./tasks.c:3475: undefined reference to `vPortCleanUpTCB'
Although I've been hopping around between releases. I've abandoned esp-idf-v2.1 in favor of v2.0 as that was the last know working version. Is it possible for the menuconfig files between version out of sync?
Oddly a search within tasks.c has no reference to vPortCleanUpTCB, nor does ./include/task.h
undefined reference to `vPortCleanUpTCB'
-
- Posts: 8
- Joined: Tue Jun 27, 2017 10:39 pm
Re: undefined reference to `vPortCleanUpTCB'
vPortCleanUpTCB is external function, you have to define it in your application.
If you don't use static allocated tasks, disable Enable FreeRTOS static allocation API in FreeRTOS configuration.
If you don't use static allocated tasks, disable Enable FreeRTOS static allocation API in FreeRTOS configuration.
config SUPPORT_STATIC_ALLOCATION
bool "Enable FreeRTOS static allocation API"
default n
help
FreeRTOS gives the application writer the ability to instead provide the memory
themselves, allowing the following objects to optionally be created without any
memory being allocated dynamically:
- Tasks
- Software Timers
- Queues
- Event Groups
- Binary Semaphores
- Counting Semaphores
- Recursive Semaphores
- Mutexes
Whether it is preferable to use static or dynamic memory allocation is dependent on
the application, and the preference of the application writer. Both methods have pros
and cons, and both methods can be used within the same RTOS application.
Creating RTOS objects using statically allocated RAM has the benefit of providing the
application writer with more control: RTOS objects can be placed at specific memory locations.
The maximum RAM footprint can be determined at link time, rather than run time.
The application writer does not need to concern themselves with graceful handling of memory allocation failures.
It allows the RTOS to be used in applications that simply don't allow any dynamic memory allocation
(although FreeRTOS includes allocation schemes that can overcome most objections).
config ENABLE_STATIC_TASK_CLEAN_UP_HOOK
bool "Enable static task clean up hook"
depends on SUPPORT_STATIC_ALLOCATION
default n
help
Enable this option to make FreeRTOS call the static task clean up hook when a task is deleted.
Bear in mind that if this option is enabled you will need to implement the following function::
void vPortCleanUpTCB ( void *pxTCB ) {
// place clean up code here
}
Who is online
Users browsing this forum: No registered users and 229 guests