# Creating new project at free RTOS

**URL:** <https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748>\
**Category:** Kernel\
**Created:** [March 8, 2015, 7:37am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748 "2015-03-08T07:37:23Z")\
**Posts on this page:** 20\
**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:** [March 8, 2015, 7:37am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/1 "2015-03-08T07:37:23Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#18a8):

Hi

I have problem creating new project at win32 simulator,using eclipse.

I have defined to the eclipse , all the relevant paths of includes, and add the all relevant  
source files as told at : [http://www.freertos.org/Creating-a-new-FreeRTOS-project.html](http://www.freertos.org/Creating-a-new-FreeRTOS-project.html)

I have lots of link errors, for example:

undefined reference prvTraceGetCurrentTaskHandle at task.c queue.c etc

Please help

---

<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:** [March 8, 2015, 7:44am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/2 "2015-03-08T07:44:45Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#34ad):

```
You have probably included definitions for the trace macros, but not included the FreeRTOS+Trace recorder source file.

Is "trcKernelPort.h" being included from FreeRTOSConfig.h? The #include will probably be at the bottom of the source file if it is. That is the header file that defines the trace macros, so if you comment out the inclusion of the header file then those errors should disappear.  

If you have any other build errors then post the compiler's output here.

Regards.
```

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 7:53am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/3 "2015-03-08T07:53:19Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#8ed8):

The “trcKernelPort.h” file should not be included?

---

<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:** [March 8, 2015, 7:59am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/4 "2015-03-08T07:59:34Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#8ed8/01b1):

If trcKernelPort.h is included then you must also include the  
FreeRTOS+Trace recorder source files - otherwise you will get linker errors.

If you are creating a new project I would recommend _not_ including  
trcKernelPort.h, so commenting it out. Once you have your project  
running you can always add in the trace recorder at a later time.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 8:07am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/5 "2015-03-08T08:07:03Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#104d):

The link errors occurs , even when I include the FreeRTOS+Trace recorder source files.

the path is:

C:\FreeRTOS\FreeRTOS\Demo\WIN32-MingW\Trace\_Recorder\_Configuration

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 8:32am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/6 "2015-03-08T08:32:08Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#eb0d):

I have new problem now:

I have written little test:

#include \<stdio.h\>

#include “FreeRTOS.h”  
#include “task.h”  
#include “queue.h”  
#include “timers.h”

int main(void)  
{  
xTaskStartScheduler();  
while(1);  
return 0;  
}

the compiler outputs:

undefined reference to `xTaskStartScheduler’ main.c ‪/FirstFreeRTOSPRoj‬ line 11 C/C++ Problem  
as an error

and

implicit declaration of function ‘xTaskStartScheduler’ [-Wimplicit-function-declaration] as a warning

---

<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:** [March 8, 2015, 9:20am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/7 "2015-03-08T09:20:03Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#7fef):

> The link errors occurs , even when I include the FreeRTOS+Trace recorder source files.

Generally when debugging or building I would be tempted to consolidate what I have, or remove functionality to get a clean building base from where to work - rather than add more files in when what I have is already not building.

> undefined reference to `xTaskStartScheduler’ main.c ‪/FirstFreeRTOSPRoj‬ line 11 C/C++  
> Problem as an error

Ah good, sounds like you have made progress then. This one is easy to fix; The name of the function is vTaskStartScheduler() [note the v prefix, rather than the x prefix, because it is a void function].

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 9:35am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/8 "2015-03-08T09:35:40Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#96e7):

Hi  
Thanks for replying,

I changed it to, vTaskStartScheduler()

still have the error code

---

<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:** [March 8, 2015, 9:59am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/9 "2015-03-08T09:59:17Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#96e7/5dac):

What error code? Undefined reference to xTaskStartScheduler()?

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 10:01am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/10 "2015-03-08T10:01:01Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#f3ea):

No,

What error code? Undefined reference to vTaskStartScheduler()

undefined reference to `vTaskStartScheduler’ main.c ‪/FirstFreeRTOSPRoj‬ line 11 C/C++ m

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 10:01am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/11 "2015-03-08T10:01:20Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#1040):

No,

Undefined reference to vTaskStartScheduler()

undefined reference to `vTaskStartScheduler’ main.c ‪/FirstFreeRTOSPRoj‬ line 11 C/C++ m

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 10:17am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/12 "2015-03-08T10:17:11Z")

</div>

**[davedoors](https://sourceforge.net/u/davedoors/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#f5ff):

Why dont you start with the example in the download that is already building then just remove the code you dont want?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 10:22am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/13 "2015-03-08T10:22:10Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#f065):

Hi Dave, thanks for replying

Already done it, and it works.

But as a programmer, I need to know the problems and try to solve them, not  
eliminate them.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 11:07am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/14 "2015-03-08T11:07:09Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#8871):

Hi guys

I assume you don’t have any solution for me?

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 2:06pm UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/15 "2015-03-08T14:06:02Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#4a4e):

Hi guys

I solved the last problem, with the error Undefined reference to vTaskStartScheduler()

by adding the source files queue.c list.c task.c and port.c

But now, I get the old problem:

Description Resource Path Location Type  
undefined reference to `prvTraceGetCurrentTaskHandle'	queue.c	‪/FirstFreeRTOSPRoj‬	line 1502	C/C++ Problem undefined reference to `prvTraceGetCurrentTaskHandle’ queue.c ‪/FirstFreeRTOSPRoj‬ line 1396 C/C++ Problem  
more undefined references to `vAssertCalled' follow	port.c	‪/FirstFreeRTOSPRoj‬	line 514	C/C++ Problem more undefined references to `vAssertCalled’ follow queue.c ‪/FirstFreeRTOSPRoj‬ line 620 C/C++ Problem  
more undefined references to `vAssertCalled' follow	queue.c	‪/FirstFreeRTOSPRoj‬	line 1729	C/C++ Problem undefined reference to `prvTraceGetCurrentTaskHandle’ tasks.c ‪/FirstFreeRTOSPRoj‬ line 876 C/C++ Problem  
undefined reference to `prvTraceGetCurrentTaskHandle'	queue.c	‪/FirstFreeRTOSPRoj‬	line 1016	C/C++ Problem undefined reference to `prvTraceGetCurrentTaskHandle’ queue.c ‪/FirstFreeRTOSPRoj‬ line 928 C/C++ Problem

and more and more

please help

---

<div class="post-metadata">

**Author:** ![tlafleur](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tlafleur](https://forums.freertos.org/u/tlafleur)\
**Post date:** [March 8, 2015, 2:59pm UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/16 "2015-03-08T14:59:00Z")

</div>

**[tlafleur](https://sourceforge.net/u/tlafleur/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#4a4e/a38b):

Look at the project that works and see what files and configuration it uses  
and compare it to your new project…  
This is all very basic setup of the IDE your using and NOT directly related  
to FreeRTOS issues…  
Make sure the FreeRTOSconfig.h is set with the correct option for your  
development…  
Make sure you have the correct port.c file for your processor…  
Make sure the IDE knows the path to all of the .h and .c files…  
Search the forum, you will most likely find solutions to all of your  
questions…  
The issue you have are very easy to solve. Just look!, then you will  
understand…

good luck…

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 8, 2015, 3:00pm UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/17 "2015-03-08T15:00:43Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#7018):

Hi guys

I solved the problem

it seems that in win32 simulator

there are some functions defined at main.c  
that some source files defined them as external function.

Therefore when creating new project, at the main file these functions  
have to appear(and defined correctly).

---

<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:** [March 8, 2015, 6:35pm UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/18 "2015-03-08T18:35:53Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Sunday, March 08, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#7018/81b7):

> I assume you don’t have any solution for me?

We can’t offer solutions if we don’t know what the problem is. For  
example…

> I solved the last problem, with the error Undefined reference to  
> vTaskStartScheduler()  
> by adding the source files queue.c list.c task.c and port.c

As your first post referenced a documentation page that tells you to add  
these files  
([Creating a new RTOS project](http://www.freertos.org/Creating-a-new-FreeRTOS-project.html)), it would  
not occur to a responder on the forum that in fact you had not included  
the files - but were trying to call functions in them - hence they would  
not offer that as a potential solution.

> it seems that in win32 simulator  
> there are some functions defined at main.c  
> that some source files defined them as external function.  
> Therefore when creating new project, at the main file these functions  
> have to appear(and defined correctly).

…except that is not the case. The Windows port has no more  
dependencies than any other port. It looks like your FreeRTOSConfig.h  
file is defining macros that call functions that are not part of the  
FreeRTOS code - that does not mean you have to define the functions to  
use the Windows port - just that you have to define any function that  
you actually try calling. In particular in this case I think your  
configASSERT() function is calling vAssertCalled(). configASSERT() is  
an application definition, it is not defined by FreeRTOS.

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 9, 2015, 7:43am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/19 "2015-03-09T07:43:08Z")

</div>

**[crippler1](https://sourceforge.net/u/crippler1/)** wrote on [Monday, March 09, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#28c7):

Hi thanks for replying,

three questions:

1)What about all the hook functions and demonstration functions at main.c and main\_full.c  
do I really need them?  
2)It seems that there are other source files that I need to add in addition to what  
[http://www.freertos.org/Creating-a-new-FreeRTOS-project.html](http://www.freertos.org/Creating-a-new-FreeRTOS-project.html) tells, like BlockQ.c  
Can you explain me what are those files?

3)Which free RTOS files has external dependencies of application functions created on main.c  
and main\_full.c?

Thanks

---

<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:** [March 9, 2015, 8:37am UTC](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748/20 "2015-03-09T08:37:24Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Monday, March 09, 2015](https://sourceforge.net/p/freertos/discussion/382005/thread/79cfa76e/#28c7/10f0):

> 1)What about all the hook functions and demonstration functions at  
> main.c and main\_full.c do I really need them?

> **[FreeRTOS - RTOS hook (callback) functions for task stack overflows, tick...](https://www.freertos.org/a00016.html)**
>
> FreeRTOS hook (callback) functions for task stack overflows, tick interrupts, idle task and malloc failure (pvPortMalloc() returning NULL).

> 2)It seems that there are other source files that I need to add in  
> addition to what  
> [Creating a new RTOS project](http://www.freertos.org/Creating-a-new-FreeRTOS-project.html) tells,

I don’t think so. Your C compiler will need other functions, like  
main(), but FreeRTOS doesn’t.

> like  
> BlockQ.c  
> Can you explain me what are those files?

Read the documentation page for the port you are using, and

> **[FreeRTOS - A description of the FreeRTOS demo tasks that are common to all...](https://www.freertos.org/a00102.html)**
>
> Each offical FreeRTOS port comes with a demo application. The demo applications run a set of common demo tasks that are common to all demos, and some tasks that are specific to a single demo. This page documents the tasks that are common to all...

> 3)Which free RTOS files has external dependencies of application  
> functions created on main.c  
> and main\_full.c?

None. main.c and main\_full.c are not FreeRTOS files, they are just  
entry points into a demo application that uses FreeRTOS.

Regards.

[Next page](https://forums.freertos.org/t/creating-new-project-at-free-rtos/2748.md?page=2)
