# How to use Free RTOS 

**URL:** <https://forums.freertos.org/t/how-to-use-free-rtos/6691>\
**Category:** Kernel\
**Created:** [July 20, 2017, 3:41pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691 "2017-07-20T15:41:15Z")\
**Posts on this page:** 9\
**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:** [July 20, 2017, 3:41pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/1 "2017-07-20T15:41:15Z")

</div>

**[vead](https://sourceforge.net/u/vead/)** wrote on [Thursday, July 20, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#0d1e):

Hello everyone  
I am looking help on Free RTOS. I have been reading some materials and have been reading book but still I am having problem to understand basic of RTOS. so I have decided to start with small project. I know RTOS is mainly design for Time based reuirenment. just for practice why not start with LED. I know how to blink LED with C program. Now I want to blink LED under Free RTOS. I understand I don’t need rtos to blink LED but it is just for practice so that I can understand at least which header and source file of Free RTOS I can use to Blink LED. once I blink LED under control of RTOS. after that I will do come complex projcet. so please help me

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 20, 2017, 7:24pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/2 "2017-07-20T19:24:49Z")

</div>

**[dibosco](https://sourceforge.net/u/dibosco/)** wrote on [Thursday, July 20, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#0d1e/a805):

The best way I think to do this is to look through the projects that are  
available to download, find one that uses your IDE then buy a dev board  
to go with that project.

Once you have that, compile and run the demo project and write a very  
simple thread that toggles an LED. If you’ve done any sort of reading,  
you’ll have found plenty of tutorials on creating a thread, using task  
delays etc.

In essence, the way I look at it is that a thread is like a  
run-to-complete infinite loop style piece of software you’re used to  
writing for micros. You can write a number of threads that can run  
[seemingly] concurrently and communicate with each other.

Once you have your LED flashing you can do things like write a thread  
that gathers serial information then pass it via a queue to another  
thread that processes that information. You’ll then soon get the hang of  
how it all works and do some real world stuff.

On 20/07/17 16:41, vead wrote:

> Hello everyone  
> I am looking help on Free RTOS. I have been reading some materials and  
> have been reading book but still I am having problem to understand basic  
> of RTOS. so I have decided to start with small project. I know RTOS is  
> mainly design for Time based reuirenment. just for practice why not  
> start with LED. I know how to blink LED with C program. Now I want to  
> blink LED under Free RTOS. I understand I don’t need rtos to blink LED  
> but it is just for practice so that I can understand at least which  
> header and source file of Free RTOS I can use to Blink LED. once I blink  
> LED under control of RTOS. after that I will do come complex projcet. so  
> please help me
> 
> * * *
> 
> How to use Free RTOS  
> [https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/?limit=25#0d1e](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/?limit=25#0d1e)
> 
> * * *
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)

---

<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:** [July 20, 2017, 8:54pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/3 "2017-07-20T20:54:14Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, July 20, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#0d1e/cf16):

If you have been reading the official book (free pdf download), or the  
API documentation for the functions that show you exactly what you are  
asking ([http://www.freertos.org/a00127.html](http://www.freertos.org/a00127.html)), then its hard to add  
anything additional. You can look at examples though. Here is a really  
old file that just flashes LEDs at different rates. It is included in  
most of the examples in the FreeRTOS download, if you have looked at  
those too:

[https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Demo/Common/Minimal/flash.c](https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Demo/Common/Minimal/flash.c)

Or using software timers

[https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Demo/Common/Minimal/flash\_timer.c](https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Demo/Common/Minimal/flash_timer.c)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 21, 2017, 3:48am UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/4 "2017-07-21T03:48:34Z")

</div>

**[vead](https://sourceforge.net/u/vead/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#9bec):

Thanks for your reply I have downloaded some projects and books. I have gone through given links but my confusen is on selection of header files and sources  
suppose I want to flesh three LEDs at different rate. first LED flashes every 200ms, the second every 400ms, the third every 600ms. how many header files and source files I need in program. can you tell me the name of header files and source files.

---

<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:** [July 21, 2017, 4:53am UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/5 "2017-07-21T04:53:43Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#9bec/1fc2):

Open an existing project to see, or better still read the online documentation or book chapter that tells you how to create a new project, including which files to build and which include paths to add.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 21, 2017, 1:50pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/6 "2017-07-21T13:50:54Z")

</div>

**[vead](https://sourceforge.net/u/vead/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#221e):

as said I have been reading book and looking some project examples but I don’t understand the idea which files I need to add and built in program. may be my poor understanding. I am not asking for complete program. I am stuck at starting for selection of free RTOS files. I don’t know why you didn’t give the answer of my question for LEDs. if possible can you give me the name of files which I have to add and build in program so that I can go for further learning

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 21, 2017, 2:28pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/7 "2017-07-21T14:28:41Z")

</div>

**[dibosco](https://sourceforge.net/u/dibosco/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#221e/580d):

You don’t need _anything_ else if you download the source code and use  
one of the demo projects, This is why we’re saying get a demo project.

The download instructions are here.

> **[FreeRTOS - Free RTOS Source Code Downloads, the official FreeRTOS zip file...](https://www.freertos.org/a00104.html)**
>
> How to download the FreeRTOS real time kernel, to get the Free RTOS source code zip file. FreeRTOS is a portable, open source, mini Real Time kernel. A free RTOS for small embedded systems

Choose one for your IDE and compile it. It will just work. No extra  
files needed. This is the beauty of starting with a demo project.

On 21/07/17 14:50, vead wrote:

> as said I have been reading book and looking some project examples but  
> I don’t understand the idea which files I need to add and built in  
> program. may be my poor understanding. I am not asking for complete  
> program. I am stuck at starting for selection of free RTOS files. I  
> don’t know why you didn’t give the answer of my question for LEDs. if  
> possible can you give me the name of files which I have to add and  
> build in program so that I can go for further learning
> 
> * * *
> 
> How to use Free RTOS  
> [https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/?limit=25#221e](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/?limit=25#221e)
> 
> * * *
> 
> Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/p/freertos/discussion/382005/)
> 
> To unsubscribe from further messages, please visit  
> [SourceForge.net: Log In to SourceForge.net](https://sourceforge.net/auth/subscriptions/)

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [July 21, 2017, 4:48pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/8 "2017-07-21T16:48:34Z")

</div>

**[vead](https://sourceforge.net/u/vead/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#221e/580d/7bc7):

I don’t know how to explain. ok I am using cortex M3 and keil compiler and I have downloaded some project. now If I don’t want use demo projcet I want to mak my own project (flesh Three LEDs at different rate ) than How to do it

---

<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:** [July 21, 2017, 7:28pm UTC](https://forums.freertos.org/t/how-to-use-free-rtos/6691/9 "2017-07-21T19:28:03Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, July 21, 2017](https://sourceforge.net/p/freertos/discussion/382005/thread/402f7442/#221e/4271):

> as said I have been reading book and looking some project examples  
> but I don’t understand the idea which files I need to add and built  
> in program.

…and I referenced this page, which tells you, as does the book:

> **[Creating a new RTOS project](https://www.freertos.org/Creating-a-new-FreeRTOS-project.html)**
>
> Create and use an RTOS project

> I don’t know why you didn’t give the answer of my question for  
> LEDs.

…and I referenced this page, which is an LED flashing example, and  
told you which file in the FreeRTOS download contains more examples:

> **[This page describes the RTOS vTaskDelay() FreeRTOS API function which is part...](https://www.freertos.org/a00127.html)**
>
> FreeRTOS is an open source, small footprint RTOS for microcontrollers. This page describes the vTaskDelay() FreeRTOS API function which is part of the RTOS task control API.

> if possible can you give me the name of files which I have to  
> add and build in program so that I can go for further learning

I don’t think I could do more than reference the pages that provide  
answers to your questions, other than cut and paste content from those  
pages into the forum.
