(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[category: Free RTOS with Arduino]]
 
[[category: Free RTOS with Arduino]]
In this tutorial we will see how to setup the Arduino IDE for FreeRTOS.<br>
+
In this tutorial, we will see how to setup the Arduino IDE for FreeRTOS.<br>
FreeRTOS libraries can be directly installed from boardManager, this works for latest Arduino IDE <b>1.6.8</b>.<br>
+
After setting up the IDE, we will run the first FreeRTOS example on Arduino Uno.<br>
In case you are using the older version of IDE(<b>1.6.5</b>), then you have to copy the files to your sketch library folder.<br>
+
Lets see how to do it for both the version of IDE's.
+
<br><br><br>
+
  
 +
=Setting Up=
 +
Download and install the Arduino IDE from [https://www.arduino.cc/en/Main/Software this link].<br>
 +
Downlaod the FreeRtos files form the [https://github.com/ExploreEmbedded/Arduino_FreeRTOS github] and paste into the library folder of arduino.<br>
 +
The folder structure should be as shown below.
 +
[[FILE:FreeRtosFolderStructure.png]]<br><br>
  
 +
=Running First Example=
 +
Now run the the IDE and open the first example from <b>File->Examples->FreeRTOS->01-TaskSwitching</b> as shown in below image.<br>
 +
[[FILE:FreeRtosExample1.png]]<br>
  
=Arduino 1.6.5=
+
Compile and upload the code. Open the serial monitor to see the output.<br>
 +
[[FILE:FreeRtosExample1Output.png]]<br>
  
 +
=FreeRtos Configuration=
 +
Please check this [http://www.freertos.org/a00110.html tutorial] for freeRtos configuration.<br><br>
  
=Arduino 1.6.8=
+
=Heap Settings=
Download and install the latest version of Arduino IDE <b>1.6.8</b> from [https://www.arduino.cc/en/Main/Software this link].<br>  
+
The original free rtos project can be downloaded [https://github.com/feilipu/Arduino_FreeRTOS_Library here].<br>
Now run the the IDE and go to board manager <b>Tools->Board->Board Manager</b>.<br>
+
It uses heap_3.c file and memory allocation is done by malloc() and free() functions. Heap size needs to be configured through linker setting and <b>configTOTAL_HEAP_SIZE</b> setting in FreeRTOSConfig.h has no effect.<br>
Now select the FreeRTOS and click on Install.<br>
+
In order to solve this we will be using heap_4.c.
 +
Please check [http://www.freertos.org/a00111.html this link] for more info on freeRtos heap usage.
  
Once it is installed, Close and open the IDE and select Arduino Uno board<br>
+
=Downloads=
Open the first example from <b>File->Examples->FreeRTOS823->01-TaskSwitching</b> as shown in below image.<br>
+
Download the complete project and libraries from [https://github.com/ExploreEmbedded/Arduino_FreeRTOS/archive/master.zip here].<br><br>
Compile and upload the code. Open the serial monitor and select 9600 baud rate.<br>
+
  
  
 
+
Have an opinion, suggestion , question or feedback about the article let it out here!
 
+
{{DISQUS}}
 
+
 
+
http://www.freertos.org/a00111.html
+

Latest revision as of 15:55, 4 July 2016

In this tutorial, we will see how to setup the Arduino IDE for FreeRTOS.
After setting up the IDE, we will run the first FreeRTOS example on Arduino Uno.

Setting Up

Download and install the Arduino IDE from this link.
Downlaod the FreeRtos files form the github and paste into the library folder of arduino.
The folder structure should be as shown below. FreeRtosFolderStructure.png

Running First Example

Now run the the IDE and open the first example from File->Examples->FreeRTOS->01-TaskSwitching as shown in below image.
FreeRtosExample1.png

Compile and upload the code. Open the serial monitor to see the output.
FreeRtosExample1Output.png

FreeRtos Configuration

Please check this tutorial for freeRtos configuration.

Heap Settings

The original free rtos project can be downloaded here.
It uses heap_3.c file and memory allocation is done by malloc() and free() functions. Heap size needs to be configured through linker setting and configTOTAL_HEAP_SIZE setting in FreeRTOSConfig.h has no effect.
In order to solve this we will be using heap_4.c. Please check this link for more info on freeRtos heap usage.

Downloads

Download the complete project and libraries from here.


Have an opinion, suggestion , question or feedback about the article let it out here!