You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

142 lines
8.4 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<title>Start the RIOT</title>
<link href="riot.css" media="all" rel="stylesheet" type="text/css" >
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<h1>Start the RIOT - Getting started with RIOT</h1>
<div id="toc">
<ol start="0">
<li><a href="#requirements" title="Required tools and libraries">Requirements</a></li>
<li><a href="#getcode" title="How to obtain RIOT">Get the source code</a></li>
<li><a href="#toolchains" title="How to install and configure the toolchains">Setup the toolchain</a></li>
<li><a href="#flasher" title="How to install a flasher">Setup a flashing tool</a></li>
<li><a href="#hello" title="Build and run the famous hello world program">Hello World!</a></li>
<li><a href="#firstapp" title="First Application">Write your first applicatoin</a></li>
<h2 id="requirements">Requirements</h2>
<li>Git (<a href="" title="A distributed version control
system" target="_blank"></a>)</li>
<li>Python (for the terminal script) (<a href="" title="Python Programming Language" target="_blank"></a>)</li>
<li>A toolchain (see <a href="#toolchains" title="How to install and configure
the toolchains">Setup the toolchain</a>)</li>
<p>You may not to install additional packages for particular toolchains or flashing tools. For the MSB-A2 check the requirements in the <a href="" title="MSB-A2 Toolchain Installation" target="_blank">Github Wiki</a>.</p>
<h2 id="getcode">Get the source code</h2>
<p>You can obtain RIOT either by cloning the git repositories or download the latest tarballs.</p>
<h3>Using the git repository</h3>
<p>In order to obtain RIOT from the official <a href="" title="RIOT at GitHub" target="_blank">GitHub</a> repositories, please perform the following commands:</p>
<h4>The kernel</h4>
git clone git://
<h4>The platform configurations</h4>
git clone git://
git clone git://
git clone git://
<h4><em>Optional (recommended):</em> Examplary projects</h4>
git clone git://
<h3>Download the tarballs</h3>
<p class="todo">TODO: Build tarballs!</p>
<h2 id="toolchains">Setup the toolchain</h2>
<p>You can either build RIOT for one of the supported hardware platforms (check
our <a href="" title="RIOT usage"
target="_blank">website</a>) or try the native port. As a special platform,
you will find a CPU and board called <i>native</i> in the repository. This
target allows you to run RIOT as a process on Linux on most supported hardware
platforms. Just set <tt>CPU</tt> and <tt>BOARD</tt> to native in your
project's Makefile, call <tt>make</tt>, and execute the resulting elf-file.</p>
<h3>For ARM</h3>
<p>The recommended toolchain for RIOT on ARM is an older version (2008q3) of CodeBench (formerly CodeSourcery) from <a href="" title="Company Web Page">Mentor Graphics</a>. It can be obtained <a class="download" href="" title="CodeSourcery 2008q3">here</a>.</p>
<p>Direct links for Linux are </p>
<p class="download"><a href="" title="Installer for Linux version"></a> (with installer)</p>
<p> or</p>
<p class="download"><a href="" title="Binary archive for Linux"></a>.</p>
<p><em>Please note</em> that you will have to add the directory with executables (<tt>arm-none-eabi-gcc</tt>, <tt>arm-none-eabi-as</tt> etc.) to your <a href="" title="Wikipedia article about the PATH variable" target="_blank">PATH variable</a> in both cases.
On a typical shell like bash or zsh this can be done using export, e.g.</p>
export PATH=${PATH}:/path/to/arm-none-eabi-gcc
<p>The direct link for the Windows version is</p>
<p class="download"><a href="" title="Installer for Windows version"></a>.</p>
<h4>Mac OS X</h4>
<p>There is a tutorial to install the CodeSourcery toolchain on Mac OS X: <a href="" title="CodeSourcery ARM (2008q3) bare-metal toolchain on OS X"></a>.</p>
<h4>Build the toolchain from sources</h4>
<p>There is also the possibility to build the toolchain from the sources, allowing for newer versions of GCC, binutils, and Newlib. A script to build a toolchain for the MSB-A2 is available in the RIOT git repository at <br>
<h3>For MSP430</h3>
<p>Download and install <a class="download" href=""title="MSPGCC" target="_blank">GCC toolchain for MSP430</a> according to the information provided on the website.</p>
<h3>For the native port</h3>
<p>In order to build RIOT for the native port, you just need the <a class="download" href="" title="GCC, the GNU Compiler Collection" target="_blank">GNU
Compiler Collection</a>.</p>
<h2 id="flasher">Setup a flashing tool</h2>
<h3>For MSB-A2</h3>
<li>Enter the <i>boards</i> directory and change to <i>msba2-common/tools</i>.</li>
<li>Call <tt>make</tt>.</li>
<li>Either run <tt>make install</tt> (you will need probably superuser
rights to do this, i.e. you could run <tt>sudo make install</tt>) or add
<i>boards/msba2-common/tools/bin/</i> to your <a
href="" title="Wikipedia article
about the PATH variable" target="_blank">PATH variable</a>.</li>
<li>Install the driver for the FTDI chip from
<a href="" title="Virtual COM Port
Drivers" target="_blank">FTDI homepage</a>.</li>
<h3>For MSB-430H</h3>
<p>Download and install <a class="download" href="" title="Debugging and programming tool for MSP430 MCUs" target="_blank">MSPDebug</a> according to the information provided on the website. You can also use MSPDebug for debugging.</p>
<h3>For redbee-econotag</h3>
<p>Folow the instructions for <a href="" title="LIBMC1322X"target="_blank">Getting Started with MC1322x</a>.
<h3>For STM32F4DISCOVERY</h3>
<p class="todo">TODO</p>
<h2 id="hello"><em>Optional:</em> Hello World!</h2>
If you have obtained a copy of the projects repository, you can build the
famous <em>Hello World</em> application for RIOT.
<li>Enter the <i>projects</i> directory and change to <tt>hello-world</tt>.</li>
<li>Edit the <tt>Makefile</tt> to set the variables <tt>RIOTBASE</tt> and
<tt>RIOTBOARD</tt> according to where your copies of the RIOT repositories are located.</li>
<li>Dependent on your target platform set the <tt>BOARD</tt> environment
variable and call <tt>make</tt>, e.g. <tt>BOARD=msb-430h make</tt>.</li>
<li>Now you program the resulting hex file on your target platform by calling
<tt>make flash</tt>.</li>
<li>Finally see the output of the application by running <tt>make term</tt>.</li>
<h2 id="firstapp">Write your first application</h2>
<p>To write your own RIOT application, you just need a <tt>Makefile</tt> and C file(s)
containing your source code. A template Makefile is available in the dist
folder of the RIOT repository.</p>
<p>One of the C files has to provide a main function according to this
int main(void);
<p>Within your project's Makefile, you can define the modules you want to use.</p>
<p>Unless specified otherwise, make will create an
elf-file as well as an Intel hex file in the bin folder of your project