Undefined Symbol deping on static/dynamic memory use

tobisf wrote on Tuesday, June 05, 2018:

Hi,

I’m trying to set up my first project with FreeRTOS. I want to run it on a STM32L0, for the first tests a NUCLEO-L011K4 using Keil µVision 5.

I included the FreeRTOS by adding FreeRTOS/source, FreeRTOS/soruce/include and FreeRTOS/source/portable/RVDS/ARM_CM0 directorys to the include path and the files to the project. I took the FreeTROSConfig.h from an generated project.

First I got an error because the SysTick_Handler was redefined by FreeRTOS. To solve this, I just removed the auto generated SysTick_Handler from my application.

Now I get undefined symbol errors from FreeRTOS, depending on the configuration of static/dynamic memory allocation (I want everything statically allocated):

configSUPPORT_STATIC_ALLOCATION 1
vApplicationGetIdleTaskMemory (reffered from task.o)
vApplicationGetTimerTaskMemory (reffered from timers.o)

configSUPPORT_DYNAMIC_ALLOCATION 1
pvPortMalloc (reffered from event_groups.o)
vPortFree (reffered from event_groups.o)

Do I have to define the functions by myself?

rtel wrote on Tuesday, June 05, 2018:

configSUPPORT_STATIC_ALLOCATION 1
vApplicationGetIdleTaskMemory (reffered from task.o)
vApplicationGetTimerTaskMemory (reffered from timers.o)

In this case you need to supply these functions to provide static memory
to the tasks created by the kernel. Grep the FreeRTOS/Demo directory to
find examples. See the following link for more information:

configSUPPORT_DYNAMIC_ALLOCATION 1
pvPortMalloc (reffered from event_groups.o)
vPortFree (reffered from event_groups.o)

In this case you need to provide the memory allocation functions. This
is not needed if configSUPPORT_DYNAMIC_ALLOCATION is 0.

tobisf wrote on Wednesday, June 06, 2018:

Thanks, I wasn’t aware that I need to supply these function by myself. I copied them from a WIN32 example.
But when I want to use dynamic allocation, then I have to implement the portMalloc and portFree functions myself? So basicly they would just be wrapers for the normal malloc and free functions.

rtel wrote on Wednesday, June 06, 2018:

No - please see the links I included in my last post.