# FreeRTOS 7.4.1 problem porting on  STM32F407V

**URL:** <https://forums.freertos.org/t/freertos-7-4-1-problem-porting-on-stm32f407v/4593>\
**Category:** Kernel\
**Created:** [May 14, 2013, 9:52am UTC](https://forums.freertos.org/t/freertos-7-4-1-problem-porting-on-stm32f407v/4593 "2013-05-14T09:52:02Z")\
**Posts on this page:** 2\
**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:** [May 14, 2013, 9:52am UTC](https://forums.freertos.org/t/freertos-7-4-1-problem-porting-on-stm32f407v/4593/1 "2013-05-14T09:52:02Z")

</div>

**[nemo78](https://sourceforge.net/u/nemo78/)** wrote on [Tuesday, May 14, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/ca824782/#b1d7):

I’m training porting FreeRTOS 7.4.1 on&nbsp; STM32F407VGT6 in Keil IDE. I’m doing everything as&nbsp; for STM32F103 with some different (changing portable directory on “portable\RVDS\ARM\_CM4F\”).  
my code :

```
#include "stm32f4xx.h"
#include "stm32f4xx_rcc.h"
#include "stm32f4xx_gpio.h"
#include "FreeRTOS.h"
#include "task.h"
//#include "queue.h"
#define LED4 GPIO_Pin_12
#define LED5 GPIO_Pin_14
void InitGPIO(void)
{
   GPIO_InitTypeDef GPIO_InitStructure;
   
   RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD,ENABLE);
   GPIO_InitStructure.GPIO_Pin = LED4|LED5;
   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
   GPIO_Init(GPIOD, &GPIO_InitStructure);   
}
void prvSetupHardware( void )
{
   InitGPIO();
}
void vTaskLED4(void *pvParameters) 
{
   for (;;) 
   {
      GPIO_ToggleBits(GPIOD,LED4);
    vTaskDelay(500);
   }
}
void vTaskLED5(void *pvParameters) 
{
   for (;;) 
   {
      GPIO_SetBits(GPIOD,LED5);   
      vTaskDelay(300);
      GPIO_ResetBits(GPIOD,LED5);   
      vTaskDelay(700);
   }
} 
int main(void)
{
   prvSetupHardware();
   xTaskCreate(vTaskLED4,(signed char*)"LED4",configMINIMAL_STACK_SIZE,
            NULL, tskIDLE_PRIORITY + 1, NULL);
   
   xTaskCreate(vTaskLED4,(signed char*)"LED5",configMINIMAL_STACK_SIZE,
            NULL, tskIDLE_PRIORITY + 1, NULL);
   
   vTaskStartScheduler(); // Start the scheduler. 
   while(1);
}

```

After compiling project I have seen more error:

Rebuild target ‘STM32F4′  
assembling startup\_stm32f4xx.s…  
compiling system\_stm32f4xx.c…  
compiling stm32f4xx\_rcc.c…  
compiling stm32f4xx\_gpio.c…  
compiling main.c…  
compiling croutine.c…  
compiling list.c…  
compiling queue.c…  
compiling tasks.c…  
compiling timers.c…  
linking…  
STM32F4.axf: Error: L6218E: Undefined symbol pvPortMalloc (referred from croutine.o).  
STM32F4.axf: Error: L6218E: Undefined symbol ulPortSetInterruptMask (referred from croutine.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vPortClearInterruptMask (referred from croutine.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vPortEnterCritical (referred from queue.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vPortExitCritical (referred from queue.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vPortFree (referred from queue.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vPortYield (referred from queue.o).  
STM32F4.axf: Error: L6218E: Undefined symbol pxPortInitialiseStack (referred from tasks.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vApplicationIdleHook (referred from tasks.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vApplicationStackOverflowHook (referred from tasks.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vApplicationTickHook (referred from tasks.o).  
STM32F4.axf: Error: L6218E: Undefined symbol vPortEndScheduler (referred from tasks.o).  
STM32F4.axf: Error: L6218E: Undefined symbol xPortStartScheduler (referred from tasks.o).  
Target not created

How I can fix this?

---

<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:** [May 14, 2013, 1:01pm UTC](https://forums.freertos.org/t/freertos-7-4-1-problem-porting-on-stm32f407v/4593/2 "2013-05-14T13:01:31Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, May 14, 2013](https://sourceforge.net/p/freertos/discussion/382005/thread/ca824782/#3f3f):

I would suggest removing croutine.c from your build, unless you are actually using co-routines, which I would have thought unlikely.

> STM32F4.axf: Error: L6218E: Undefined symbol pvPortMalloc (referred from croutine.o).

pvPortMalloc is implemented in heap\_1.c, heap\_2.c, heap\_3.c and heap\_4.c.&nbsp; You need to include one of these in your build, as described in the source files section of the following page: [http://www.freertos.org/Creating-a-new-FreeRTOS-project.html](http://www.freertos.org/Creating-a-new-FreeRTOS-project.html)

> STM32F4.axf: Error: L6218E: Undefined symbol ulPortSetInterruptMask (referred from croutine.o).

You are also not building the required portable layer files.&nbsp; I suggest you try following the instructions on the above linked page then come back and post the results.

Regards.
