Installation
Minimal requirements
官方說最好是用Eclipse 3.4,Yeti 2不向后兼容,如果Eclipse是高級版本,則安裝不上。
但我試了很多個版本的結(jié)果是3.4 ,3.4.2 ,3.5.2都不能完全正確的安裝好,最后還是3.7.2才完全安裝好。
改寫eclipse配置文件eclipse.ini如下:
-startup
plugins/org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.100.v20080606
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Xms40m
-Xmx256m
-Dorg.eclipse.swt.browser.XULRunnerPath=
在配置文件中加入最后一行。
- Eclipse 3.5 or newer. The plug-in still works on Eclipse 3.4.2, but support may stop with any new update.
- The Graphical Editing Framework, this will be installed automatically when using Eclipse 3.4
- Java 1.6. The plug-in still works with Java 1.5, but support may stop with any new update.
- A Linux system, e.g. Ubuntu or a Windows XP system. MacOS, Solaris, and Windows Vista are not tested. The plug-in is optimized for Linux.
- A complete installation of TinyOS 2.x. On windows that means that cygwin has to be installed.
- TinyOS applications must compile from the command line
- The plugin has a size of ~3 MB
Note: it is imperative to check the correctness of the include paths after installation.
Quick Install
If you don't know how to use this information, continue reading.
1、Installation of Yeti 2
To prevent conflicts it is strongly recommended not to have more than
one plugin for TinyOS in an Eclipse installation.
If any plugins for TinyOS are already installed, you should either use a
new separate Eclipse installation and workspace for this plugin or
uninstall the other plugin. It seems that NESCDT can be combined with our plugin, but we really do not recommend such a combination.
The installation starts with selecting "Help > Software Updates...".
Now the update manager opens. You need to add a new update site, so click "Add site...".
Enter the update site http://tos-ide./update/site.xml into the dialog.
You are now able to select the plugins to install. You
should select all entries except those which are clearly not meant for
your operating system (one of TinyOS Linux/Windows for TinyOS 2.x). The
meaning of the entries is as follows:
- TinyOS Core plugin: The main plugin, adds a new editor, new views (like Outline) and the whole project management stuff to Eclipse.
- NesC 1.2.x Parser: A preprocessor for C and parser for NesC 1.2.x.
- Base Environment: Some additional functionality like a dialog for mig and ncg.
- TinyOS Linux for TinyOS 2.x: Access to TinyOS 2.x on Unix machines.
- TinyOS Windows for TinyOS 2.x: Access to TinyOS 2.x on Windows machines.
Make sure to restart Eclipse after installation.
我在安裝的時候,有個包安裝不上:Yeti 2 -Optional 選項下的Yeti 2 - Refactoring(Optional) 。我就沒安裝這個,其他的都可以安裝,記得安裝完后重啟Eclipse。
2、然后就是先安裝必要的插件,如果安裝Yeti的時候提示缺少組建 ,可以放第一步安裝
打開ecllipse help->install new software->add
name:GEF
location:http://download./tools/gef/updates/releases/
直接勾上最后一個,然后next,這個3.7.2好像已經(jīng)集成了,可以不用安裝。
繼續(xù)安裝CDT
方法與安裝GEF一樣
name:CDT
location:http://download./tools/cdt/releases/helios
3、Installation of the Graphical Editing Framework
官網(wǎng)這里說的有問題,我試了不行,我的方法和上面一樣,添加下面網(wǎng)址:
http://download./releases/europa/
這是
Europa Discovery Site的網(wǎng)址,然后后面安裝方法和上面一樣的
(The Graphical Editing Framework GEF should be installed automatically, if not: follow the steps below.
First select "Help > Software Updates > Find and Install...", then select "Search for new features to install".
Now select the "Europa Discovery Site")
Finally select the "Graphical Editing Framework". Press next, accept the license, install.
Don't forget to setup the plugin after installation.
上面步驟做完后,做下面設(shè)置:
3、Basic Setup
After installation you should make some basic setup.
Perspective
First change the perspective to TinyOS. Start with selecting "Window > Open Perspective > Other..."
Then select the entry "TinyOS".
TinyOS Location and Header Directories
The plugin needs to know where TinyOS is installed. These settings need to be made in the preferences.
After selecting "Window > Preferences" a dialog opens where you can
set the paths. It would be a good idea to check the paths before
starting to work. If Eclipse seems not to use the new paths, a restart
can help!
- TinyOS Tree Layout:
How to resolve the standard paths of TinyOS. Note that while this allows
you to use TinyOS 1.x, the plugin still behaves as if parsing and
checking a TinyOS 2.x application.
- TinyOS Root Directory: This must be the very root of TinyOS, the directory which includes all files of TinyOS.
- TinyOS TOS Directory: This directory contains all the source files that come with TinyOS (not including the examples).
- TinyOS Application Directory: Contains the example applications.
- TinyOS Makerules: the Makerules file, also
known as environment variable MAKERULES. This file contains the standard
rules needed to compile a TinyOS application through make.
- GCC Include Directories: The directories in
which gcc would find its header files. The plugin will use these paths
whenever it needs to parse something. The default value is blank, and
under ordinary circumstances there needs nothing to be in this field.
Separate paths with the systems path separator (unix: a colon, windows: a
semicolon).
- Architecture Paths: Directories used when parsing files for some platform (like mica2, tinynode...). The three columns in the table mean:
- Architecture: the architecture for which the
paths are used. The available architectures are calculated automatically
as soon as the correct paths in the "System Paths"-group are set. The
entry <default> is always present and is used when a platform or project cannot be associated with any architecture.
- Uses: whether the default value or a path set by the user should be used. If default is selected, then the default paths are used. These paths are recalculated ony every startup of Eclpise. If user defined is selected, then the path in the next column is used. Click onto the field to switch the state.
- Path: the paths that are really used. If Uses is set to default, then this field is not editable. If Uses is set to user defined
then a click onto the field makes it editable. Paths have to be
separated by the systems path separator (unix: a colon, windows: a
semicolon).
- Update Default Paths: When clicking
this button, then the default paths are recalculated using the current
setting of this page. Calculating the paths needs some time, when
clicking the button during an update, another update is scheduled. There
is however no more than one update in the queue.
- Reset User Path: changes the user defined path of the selected entry to be the default path.
好了,到現(xiàn)在就安裝完成了。
可以執(zhí)行TinyOS菜單下的 Check Installation選項,查看配置好沒有,有Warmings沒關(guān)系。配置好后就可以進(jìn)行make操作了。
如果我們要生成其他體系結(jié)構(gòu)的代碼,我們只需要更改相應(yīng)工具連的路徑就可以了,比如我們想生成Stm32的代碼,操作方法如下:
我們需要修改環(huán)境變量,使得Linux可以找到arm-none-eabi-gcc。使用gedit打開/etc/environment,在原有語句后面加上/home/libo/arm-none-eabi/bin。
我的/etc/environment是這樣的:
PATH="/home/libo/arm-none-eabi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
注意:Linux中有3個級別的環(huán)境變量。這個/etc/environment是其中級別較高的一個。
如果我們修改私有的環(huán)境變量,Eclipse會提示無法找到arm-none-eabi-gcc。必須修改/etc/environment,才能讓Eclipse找到arm-none-eabi-gcc。我猜測這是由于Eclipse運行于JAVA虛擬機(jī)上造成的。
至此,arm-none-eabi-gcc就已經(jīng)安裝完成了,注銷一下,再重新登錄(開始就是沒注銷,一直沒成功,浪費了很多時間和精力)?;揪蚾k了!
補(bǔ)充知識:
在 Ubuntu 中有如下幾個文件可以設(shè)置環(huán)境變數(shù)
1. /etc/profile:在登錄時,操作系統(tǒng)定制用戶環(huán)境時使用的第一個文件,此文件為系統(tǒng)的每個用戶設(shè)置環(huán)境信息,當(dāng)用戶第一次登錄時,該文件被執(zhí)行。
2. /etc/environment:在登錄時操作系統(tǒng)使用的第二個文件,系統(tǒng)在讀取你自己的profile 前,設(shè)置環(huán)境文件的環(huán)境變數(shù)。
3. ~/.bash_profile:在登錄時用到的第三個文件是.profile 文件,每個用戶都可使用該文件輸入專用于自己使用的 shell 信息,當(dāng)用戶登錄時,該 文件僅僅執(zhí)行一次!默認(rèn)
情況下,他設(shè)置一些環(huán)境變數(shù),執(zhí)行用戶的.bashrc 文件。/etc/bashrc:為每一個運行 bash shell 的用戶執(zhí)行此文件.當(dāng) bash shell 被打開時,該文件被讀取.
4. ~/.bashrc:該文件包含專用于你的 bash shell 的 bash 信息,當(dāng)?shù)卿洉r以及每次打開新的 shell 時,該文件被讀取。
幾個環(huán)境變數(shù)的優(yōu)先級
1>2>3
建議將路徑設(shè)到第 2 項環(huán)境變數(shù)中,如設(shè)定在其它的項目中,像 eclipse 可能會無法找到交叉編譯器(arm-none-eabi-gcc)