Navigation |
Install
In order to use this port you need the following prerequisites. The tool chain assumes that the compiler and tools are installed in particular locations and that you setup your environment variables as described below.
1. TinyOS 2 installTinyOS 2 must be installed separate from this port, either in Windows through Cygwin or natively in Linux (or similar). For Cygwin or Linux users (or similar) follow the instructions from tinyos.net. For Cygwin users remember to install rpm and gcc-mingw. Alternatively Windows users may want to run the Linux through a virtual machine such as Virtual PC or VMWare Server. XubunTOS provides an install image with TinyOS pre-installed. XubunTOS can also be downloaded ad a ready-to-run virtual machine here. 2. 8051 compilerTo compile programs using this port an 8051 C-compiler is required. We recommend Keil PK51 - this port is written and tested using the Keil compiler. In addition IAR or SDCC may be used, but these are not tested. There are numerous other companies providing compilers that might or might not work, but additional compilers are not supported through the tool chain. Which compiler to used is selected using the environment variable MCS51_COMPILER (see Section 3). Keil and IAR are Windows only compilers, to use them in Linux they are run through Wine. Each compiler is installed in a separate Wine directory (eg. .wine.keil for Keil) to avoid interference. First install wine and create the appropriate wine directory (using Ubunto or Xubuntos):
2.1 Installing Keil PK51Keil PK51 is a commercial 8051 compiler that can be purchased from http://www.keil.com. A trial version is available with a 2 KiB code size limit on the compiled binaries. For either Cygwin or Wine install Keil in the default location (C:Keil). 2.1.1 LinuxThe tool chain assumes Keil is install using the Wine environment in the directory named ~/.wine.keil. Run the Keil installer using Wine (either from the provided CD-rom or downloaded binary):
To enter your license code start the uVision development environment and enter it the same way you would in Linux:
2.1.2 WindowsSimply install the compiler using the appropriate installer. 2.2 Installing SDCCSDCC is a free, open souce C compiler with native Linux and Windows support. SDCC versions 2.6 and greater provide native inline support. We have not been able to successfully compile a TinyOS application using this inliner. We recommend using the stand alone inline tool provided with this TinyOS port. 2.2.1 LinuxTo install sdcc using Debian, Ubuntu or XUbunTOS run the following command:
2.2.2 WindowsDownload and install the compiler from http://sdcc.sourceforge.net. Answer yes to the question "Add to path". 2.3 Installing IARIar is a commercial compiler for Windows. It has a 30 day evaluation is available here. In either Windows or Linux set the path of the compiler in the environment variable MCS51_IAR_PATH, for example the default is:
2.3.1 LinuxInstall the compiler using Wine:
2.3.1 WindowsSimply install the compiler using the native installer. 3. 8051 port from TinyOS-contribThe code is located in the TinyOS-2.x-contrib section and is downloaded separately from TinyOS. See download for more. 3.1 Environment variablesThe ports need a few environment variables in addition to the default TinyOS variables. These variables enable the TinyOS make system to locate the Make rules and the source files.
In addition a few optional variables control and select which compiler to use:
An example script is provided as diku/env which sets up these variables, to include them run the following command (for bash and zsh):
4. Hardware programming tools.In order to transfer the compiled binary to the chip you need the chip or platform maintainer's tool for this purpose.
5. Test the setupWith the above prerequisites your setup should be ready to go. To test the setup compile one of the example applications:
If all goes well you should see the following message:
|