西班牙lv:TinyOS 2.x Eclipse Plugin Yeti 2

来源:百度文库 编辑:偶看新闻 时间:2024/04/18 12:38:56

Installation

Minimal requirements

官方说最好是用Eclipse 3.4,Yeti 2不向后兼容,如果Eclipse是高级版本,则安装不上。

但我试了很多个版本的结果是3.4 ,3.4.2 ,3.5.2都不能完全正确的安装好,最后还是3.7.2才完全安装好。

eclipse 3.4.2 在linux 下安装后启动出错处理

改写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.
    • If using the debugger or the search: Java 1.6
    • If using the debugger: The C development tools, this will be installed automatically when using Eclipse 3.4
  • 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.
    • If using the debugger: A Linux system.
  • 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

  • Short story: The update site is located at http://tos-ide.ethz.ch/update/site.xml.
  • Don't forget to setup the plugin after installation.

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.ethz.ch/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.eclipse.org/tools/gef/updates/releases/直接勾上最后一个,然后next,这个3.7.2好像已经集成了,可以不用安装 继续安装CDT方法与安装GEF一样 name:CDT location:http://download.eclipse.org/tools/cdt/releases/helios

3、Installation of the Graphical Editing Framework

官网这里说的有问题,我试了不行,我的方法和上面一样,添加下面网址:

http://download.eclipse.org/releases/europa/

这是Europa Discovery Site的网址,然后后面安装方法和上面一样的

(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.

上面步骤做完后,做下面设置:

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 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.

好了,到现在就安装完成了。
可以执行TinyOS菜单下的 Check Installation选项,查看配置好没有,有Warmings没关系。配置好后就可以进行make操作了。
如果我们要生成其他体系结构的代码,我们只需要更改相应工具连的路径就可以了,比如我们想生成Stm32的代码,操作方法如下:
我们需要修改环境变量,使得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个级别的环境变量。这个/etc/environment是其中级别较高的一个。

 

      如果我们修改私有的环境变量,Eclipse会提示无法找到arm-none-eabi-gcc。必须修改/etc/environment,才能让Eclipse找到arm-none-eabi-gcc。我猜测这是由于Eclipse运行于JAVA虚拟机上造成的。

      至此,arm-none-eabi-gcc就已经安装完成了,注销一下,再重新登录(开始就是没注销,一直没成功,浪费了很多时间和精力)。基本就ok了!

补充知识:
在 Ubuntu 中有如下幾個文件可以設置環境變數
1. /etc/profile:在登錄時,操作系統定制用戶環境時使用的第一個文件,此文件為系統的每個用戶設置環境信息,當用戶第一次登錄時,該文件被執行。
2. /etc/environment:在登錄時操作系統使用的第二個文件,系統在讀取你自己的profile 前,設置環境文件的環境變數。
3. ~/.bash_profile:在登錄時用到的第三個文件是.profile 文件,每個用戶都可使用該文件輸入專用于自己使用的 shell 信息,當用戶登錄時,該 文件僅僅執行一次!默認
情況下,他設置一些環境變數,執行用戶的.bashrc 文件。/etc/bashrc:為每一個運行 bash shell 的用戶執行此文件.當 bash shell 被打開時,該文件被讀取.
4. ~/.bashrc:該文件包含專用于你的 bash shell 的 bash 信息,當登錄時以及每次打開新的 shell 時,該文件被讀取。

幾個環境變數的優先級
1>2>3
建議將路徑設到第 2 項環境變數中,如設定在其它的項目中,像 eclipse 可能會無法找到交叉編譯器(arm-none-eabi-gcc)