Difference between revisions of "Working environment setup for Contiki OS"

From Cyber-Physical Systems Laboratory
Jump to navigationJump to search
(Created page with " = Preparing your working Environment = Cross compilation for Contiki-OS is easier using Ubuntu OS. You have two possible ways: * Installing all the packages you need on you...")
 
Line 10: Line 10:
  
 
== GCC for TelosB ==
 
== GCC for TelosB ==
<code>
+
<pre>
 
sudo apt-get install gcc-msp430
 
sudo apt-get install gcc-msp430
</code>
+
</pre>
  
 
== Tools to program the TelosB ==
 
== Tools to program the TelosB ==
 
We will use the tos-bsl to upload the ihex file from the computer to the TelosB
 
We will use the tos-bsl to upload the ihex file from the computer to the TelosB
  
<code>sudo apt-get install tinyos-utils</code>
+
<pre>sudo apt-get install tinyos-utils</pre>
  
 
== Putty ==
 
== Putty ==
Line 24: Line 24:
 
Putty will be used to communicate with the TelosB using its Serial communication.
 
Putty will be used to communicate with the TelosB using its Serial communication.
  
<code>
+
<pre>
 
wget <nowiki>https://the.earth.li/~sgtatham/putty/latest/putty-0.68.tar.gz</nowiki>
 
wget <nowiki>https://the.earth.li/~sgtatham/putty/latest/putty-0.68.tar.gz</nowiki>
  
Line 36: Line 36:
  
 
sudo make install
 
sudo make install
</code>
+
</pre>
  
 
=== Putty Configuration ===
 
=== Putty Configuration ===
Line 54: Line 54:
 
To get the latest sources download them from github:
 
To get the latest sources download them from github:
  
<code>git clone <nowiki>https://github.com/contiki-os/contiki.git</nowiki></code>
+
<pre>git clone https://github.com/contiki-os/contiki.git</pre>
  
 
If you downloaded Instant Contiki don't forget to pull the latest release:
 
If you downloaded Instant Contiki don't forget to pull the latest release:
  
<code>
+
<pre>
 
cd ~
 
cd ~
  
Line 64: Line 64:
  
 
git pull origin master
 
git pull origin master
</code>
+
</pre>
  
 
== QtCreator ==
 
== QtCreator ==

Revision as of 16:51, 16 March 2017

Preparing your working Environment

Cross compilation for Contiki-OS is easier using Ubuntu OS.

You have two possible ways:


GCC for TelosB

sudo apt-get install gcc-msp430

Tools to program the TelosB

We will use the tos-bsl to upload the ihex file from the computer to the TelosB

sudo apt-get install tinyos-utils

Putty

Putty Installation

Putty will be used to communicate with the TelosB using its Serial communication.

wget https://the.earth.li/~sgtatham/putty/latest/putty-0.68.tar.gz

tar xzf putty-0.68.tar.gz

cd putty-0.68

./configure

make -j4 all

sudo make install

Putty Configuration

Default printf function used in Contiki-OS for TelosB outputs the data on the usb port with a Serial baud rate of 115200.

  1. Connection type: Serial
  2. Find the /dev/ttyUSB* of your board and enter it in the Serial line

ls /dev/ttyUSB*

  1. Default baud rate (if unchanged for default printf function): 115200
  2. Into Terminal Category: Check "Implicit CR in every LF"


Don't forget to run Putty as a root user! Or give general permissions to access your tty to all users.

Download Contiki-OS sources

To get the latest sources download them from github:

git clone https://github.com/contiki-os/contiki.git

If you downloaded Instant Contiki don't forget to pull the latest release:

cd ~

cd contiki

git pull origin master

QtCreator

I prefer QtCreator over other IDE because it is lighter and faster than Eclipse and easier to configure.

The choice is yours as you will be working with it.

Here how to configure it to work with Contiki-OS projects:

Install QtCreator

Easiest part:

sudo apt-get install qtcreator

Creating a new project

You need to create a new empty qt project.

I did mine in a folder named workspace in my home directory.

  • Kit: choose Desktop (this part doesn't matters but is mandatory)
  • Choose either Debug or Release (doesn't matter either as you will be using your own Makefile)

Now you have your empty project. Next step Contiki first project.