# Undefined Symbol deping on static/dynamic memory use

**URL:** <https://forums.freertos.org/t/undefined-symbol-deping-on-static-dynamic-memory-use/7248>\
**Category:** Kernel\
**Created:** [June 5, 2018, 10:53am UTC](https://forums.freertos.org/t/undefined-symbol-deping-on-static-dynamic-memory-use/7248 "2018-06-05T10:53:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 5, 2018, 10:53am UTC](https://forums.freertos.org/t/undefined-symbol-deping-on-static-dynamic-memory-use/7248/1 "2018-06-05T10:53:26Z")

</div>

**[tobisf](https://sourceforge.net/u/tobisf/)** wrote on [Tuesday, June 05, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/99d08826/#bce4):

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?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [June 5, 2018, 2:19pm UTC](https://forums.freertos.org/t/undefined-symbol-deping-on-static-dynamic-memory-use/7248/2 "2018-06-05T14:19:16Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, June 05, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/99d08826/#bce4/f622):

> 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:

> **[FreeRTOS - The Free RTOS configuration constants and configuration options -...](https://www.freertos.org/a00110.html#configSUPPORT_STATIC_ALLOCATION)**
>
> FreeRTOS is a portable, open source, mini Real Time kernel. A free RTOS for small embedded systems. This page describes and explains the constants used to configure FreeRTOS.

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

> **[FreeRTOS - Memory management options for the FreeRTOS small footprint,...](https://www.freertos.org/a00111.html)**
>
> Describes the memory management options in the FreeRTOS small footprint real time kernel. FreeRTOS is a portable, open source, mini Real Time kernel. A free RTOS for small embedded systems

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [June 6, 2018, 9:35am UTC](https://forums.freertos.org/t/undefined-symbol-deping-on-static-dynamic-memory-use/7248/3 "2018-06-06T09:35:04Z")

</div>

**[tobisf](https://sourceforge.net/u/tobisf/)** wrote on [Wednesday, June 06, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/99d08826/#70e0):

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.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [June 6, 2018, 2:04pm UTC](https://forums.freertos.org/t/undefined-symbol-deping-on-static-dynamic-memory-use/7248/4 "2018-06-06T14:04:28Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, June 06, 2018](https://sourceforge.net/p/freertos/discussion/382005/thread/99d08826/#70e0/d484):

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