Installing MansOS

From DiLab
Revision as of 23:01, 7 November 2010 by Leo (talk | contribs) (Linux and *BSD)
Jump to: navigation, search

When you install MansOS development environment you need to know two things:

  • What is the development host where you will compile your applications. All of the major desktop operating systems (Linux, Windows, MacOS) are supported as MansOS development hosts.
  • What is the target platform or platforms that you will be developing for. At least you should know what is the main micro controller. MansOS supports several popular target controller families: TI msp430, 8-bit Atmega controllers and Nordic Semiconductor nRF24LE1. One can also compile the application for the current PC host, for example, for simulation and debugging purposes.

Step 1: Prerequisites

In general, the following programs are needed:

  • Compiler and binutils
    • For example, msp430-gcc for TelosB and msp430 platforms or avr-gcc for Atmega platform
  • GNU make
  • Python

If you already have them, you can skip this section.

Linux (e.g. Ubuntu) and *BSD

As often, you have two options: installing (and compiling) the latest and greatest tools by hand, or have an automated installation of some fairly recent version.

Using manual installation

For MSP430 based platforms, download and install either of these:

After installing msp430-gcc you'll need to set up you $PATH correctly. Add this line to your ~/.bashrc file (assuming msp430-gcc is installed in /opt):

export PATH="/opt/msp430-gcc/bin:$PATH"

Using package management software

Install MSP430 tools:

http://mansos.net/deb/binutils-msp430_2.17-2_i386.deb - MSP430 binutils
http://mansos.net/deb/gcc-msp430_3.2.3-2_i386.deb - MSP430 GCC compiler
http://mansos.net/deb/msp430-libc_20071026_i386.deb - MSP430 libc
http://mansos.net/deb/msp430-tools_i386.deb - MSP430 tools metapackage

Alternatively, install the tool packages provided by TinyOS.

MacOS X

Developper tools must be installed to support compilation environment. It can be found either on MacOS X installation DVD, or on Apple web page.

TelosB/Epic/MSP430 platform

MSP430 toolchain is required. The easiest way is to install MCP430 GCC v4, which has a pretty straightforward installation script prepared. Download it from http://mspgcc4.sourceforge.net/ .

Alterntively there is a pre-built Contiki OS package for MacOS X, provided by the Contiki Team at SICS. It includes MSP430 toolchain (version 3.3, works for TelosB) as part of Contiki OS.

Also MSP430 toolchain is included in TinyOS.

Arduino/ATMega platform

Arduino platform requires AVR-GCC toolchain. Although it is included in TinyOS, the version included is too old and does not support ATMega328P MCU, which is a part of Arduino Duemillanove. Therefore a manual procedure of AVR-GCC toolchain compilation must be performed to run MansOS application on Arduino Duemilanove or other ATMega328P-having platforms. Read AVR toolchain compilation instructions.

Windows

MansOS on Windows is supported using Cygwin. (It may also work with MinGW.)

Download and install Cygwin. Here's a direct link to the setup program.

Make sure to select the following Cygwin packages:

  • gcc
  • make
  • python
  • svn
  • openssh (required only if you'll want to use non-anonymous SVN access)
  • rpm (required only if you'll want to use the pre-made RPM packages for installation)

After this you'll need to install msp430 tools. There are two options for this:

  1. Installing the tools manually
  2. Installing the tools from RPM packages provided by TinyOS

Manual installation

Follow the instructions in mspgcc homepages. Download and install either of these:

Installation using RPM packages

You may already have certain compilers and tools installed if you have TinyOS. Or you could install TinyOS rpm packages. The RPM packages are available here:

http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-base-0.1-20050607.cygwin.i386.rpm
http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-python-tools-1.0-1.cygwin.noarch.rpm
http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-binutils-2.16-20050607.cygwin.i386.rpm
http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-gcc-3.2.3-20050607.cygwin.i386.rpm
http://www.tinyos.net/dist-2.0.0/tools/windows/msp430tools-libc-20050308cvs-20050608.cygwin.i386.rpm

Install the RPM packages:

$ rpm -ivh --force --nodeps --ignoreos *.rpm

Finishing installation

Set up you $PATH to point to msp430-gcc tools. Add this line to your ~/.bashrc file (assuming msp430-gcc is installed in /opt):

export PATH="/opt/msp430-gcc/bin:$PATH"

The .bashrc file can be found in your home directory, which is a location like this: C:\cygwin\home\username\.bashrc.

Support for serial port interfacing with sensor nodes

To upload compiled programs to a mote you'll need to install proper USB to serial port drivers first. The drivers are included in Tmote Sky driver CD. If you don't have the CD, download the drivers from here. For more details consult the Tmote Sky Quick Start Guide, section USB Serial COM Driver Install (page 7). The guide is availabe at http://www.cems.uvm.edu/~crobinso/mote/tmote-sky-quickstart-110.pdf.

Now install MansOS sources and check that motelist detects all motes attached to the Windows PC:

$ motelist
Reference   CommPort   Description
----------  ---------- ----------------------------------
M4AOQGBQ    COM8       tmote sky

Step 2: Getting MansOS sources

MansOS source code is available either using SVN version control or in a pre-packaged form.

Using version control system

MansOS sources are available for anonymous checkout from SVN:

 $ svn co http://mansos.net/svn/mansos/ mansos
 A    mansos/archive
 A    mansos/archive/test
 ...
 Checked out revision 732.

Mansos-svn.png

If you also want to receive SVN write access, contact MansOS developers.

Using package management software

Get and install the MansOS Debian package: http://mansos.net/box/mansos-0.1.0_20101101_all.deb

The package depends on either msp430-tools metapackage, tinyos-required-msp430 package, or tinyos-required-avr package.

Step 3: Testing your installation

$ ls mansos
apps  archive  CREDITS.txt  doc  mos  pc  README.txt  USE_AND_DISCLAIMER.txt

Mansos-ls.png

To test building for TelosB (Tmote Sky):

$ cd mansos/apps/demo/Blink
$ make telosb

Mansos-build.png

If you have motes attached:

$ make telosb upload

Mansos-build-upload.png

To test serial port output:

$ cd mansos/apps/demo/CounterToSerial
$ make telosb upload

Now you can use a tool like minicom or putty (on Windows) to monitor the serial port. The settings: baudrate=38400, flow-control turned off. Mansos-serial.png

To test the PC simulator:

$ make pc
$ make pc run

Mansos-pc.png