TinyOS在windows中安装步骤

合集下载

win系统安装教程

win系统安装教程

win系统安装教程
1. 首先,准备一个Windows系统的安装光盘或者安装U盘。

确保光盘或U盘的拷贝是正版的,并且能够使用的。

2. 将光盘或者U盘插入电脑的光驱或者USB接口。

3. 开机时按下开机键,并迅速按下F2或者DEL键进入BIOS 设置界面(不同电脑可能不同),将启动方式调整为从光驱或者USB启动。

4. 保存设置并退出BIOS,电脑将会重新启动。

5. 在电脑重启之后,系统会自动识别光盘或者U盘,并启动安装程序。

6. 根据安装程序的指引,选择语言和区域设置。

7. 根据提示选择“安装”选项,然后同意许可协议条款。

8. 接下来,选择系统安装的目标磁盘,可以选择重新分区或者使用已经存在的分区。

9. 在安装过程中,系统会要求输入一些基本的信息,比如用户名、电脑名称等。

10. 安装程序将会开始复制系统文件并进行安装。

11. 安装完成后,电脑将会自动重启。

12. 重启后,按照系统的提示进行一些基本设置,比如网络连接、更新设置等。

13. 最后,系统将进入桌面界面,表示安装成功。

注意事项:
- 在安装过程中,尽量不要中断电源或者关闭电脑。

- 如果需要保留原有文件,务必提前备份,以免丢失重要数据。

- 确保电脑满足Windows系统的最低硬件要求,否则可能会导致安装失败或者系统运行缓慢。

- 如果遇到问题,可以参考安装光盘或者U盘中的帮助手册,
或者上网搜索相关解决方案。

安装TinyOS需要六个步骤

安装TinyOS需要六个步骤

安装TinyOS需要六个步骤。

1.Installing a Java 1.5 JDK.安装java jdk 1.5需要配置环境变量2.Install Cygwin.安装Windows下的Linux模拟器,cygwin3.Installing native compilers.安装单片机工具,AVR或MSP430,根据自己需要。

4.Installing the nesC compiler.安装nesC和TinyOS_tool5.Installing the TinyOS source tree.安装TinyOS2.0.2主文件。

6.Installing the Graphviz visualization tool安装Graphviz并配置环境变量一.安装JDK 1.5下载JDK 2.5 在SUN的官方网站/. 安装并配置JDK的环境变量。

二.安装Cygwin下装Cygwin-1.2a于/dist-1.2.0/tools/windows/cygwin-1.2a.tgz这个版本TinyOS官方测试过,和TinyOS兼容度高。

三.安装单片机工具下载以下五个rpm包1.avr-binutils-2.15tinyos-3.cygwin.i386.rpm(/di st-2.0.0/tools/windows/avr-binutils-2.15tinyos-3.cygwin.i386.rpm)2.avr-gcc-3.4.3-1.cygwin.i386.rpm(/dist-2.0.0/t ools/windows/avr-gcc-3.4.3-1.cygwin.i386.rpm)3.avr-libcavr-libc-1.2.3-1.cygwin.i386.rpm(/dist-2.0.0/too ls/windows/avr-libc-1.2.3-1.cygwin.i386.rpm)4.avariceavarice-2.4-1.cygwin.i386.rpm(/dist-2.0.0/tools/ windows/avarice-2.4-1.cygwin.i386.rpm)5.insight (avr-gdb) avr-insight-6.3-1.cygwin.i386.rpm(/dist-1.2.0/to ols/windows/avr-insight-6.3-1.cygwin.i386.rpm)下载完成之后把五个包都拷贝到Cygwin的tmp文件夹(在Windows操作即可) 依次安装(要按照顺序安装,它们之间有依赖关系),安装命令如下。

【必看】Win10系统安装教程-(insydeBOIS)

【必看】Win10系统安装教程-(insydeBOIS)

注意事项:1.在系统安装之前,请仔细阅读本教程的详细步骤!2.安装系统会清空磁盘的所有数据,请先备份好有用的个人数据!!3.请确保机器的电量在60%以上,防止因为电量低导致系统安装失败!!!准备工作:1.准备带供电的USB HUB和OTG线2.键盘、鼠标(可选)和8GB或更大容量的U盘一个操作步骤:一、制作带启动功能的U盘1.运行UltraISO软件(见目录下的: UltraISO_v9.5.2.2836.exe)。

(如果电脑是WIN8.1或WIN10请以管理员身份运行)2.加载PE镜像(见目录下的: winpe_x86_win10.iso)(此为32位PE,用来安装32位的WIN10系统)3. U 盘插到电脑的USB 接口上,然后依次点击UltraISO 软件上方工具栏的启动—>写入硬盘映像在弹出的菜单上注意如下三个选项:点击写入按钮,即可对U盘创建启动分区。

完成以后退出软件,进到电脑的磁盘管理下,可以看到U盘有一个启动分区,然后另一个磁盘可以格式化成NTFS格式,存放大于4GB的单文件了。

二、安装或更新Win10系统1.在电脑上解压缩下载的压缩包温馨提示:如果是分卷压缩的,如下图所示,一个压缩包分两部分压缩,必须要全部下载下来,然后解压缩其中一个即可.2.把前一步制作好的,带启动功能的U盘连接到电脑上,格式化成NTFS格式,在格式化时要把U盘的磁盘名称改为WINPE(这个很重要,不然在安装系统时,有可能会出现认不到U盘的情况),然后打开前面解压的文件夹,把里面的所有文件复制到U盘上。

复制完成以后,打开U盘显示的目录如下:3.把带供电的USB HUB插上电源,然后插上键盘,鼠标,U盘和OTG线,OTG线另一端连到平板上。

4.按平板的电源键开机,然后连续短按键盘的Esc键,进入BIOS界面。

如下图所示:1)按键盘上的向右方向键选中Boot Manager图标,并按确认键进入。

2)按键盘上的向下方向键选中U盘,并按确认键从U盘启动。

TinyOS2.x安装指南

TinyOS2.x安装指南

一.TinyOS安装官方说明:/tinyos-2.x/doc/html/install-tinyos.html/index.php/Installing_TinyOS_2.1#Manual_installation_on_your_host_OS_ with_RPMs开发基础:熟悉Linux环境及常用Linux命令;熟悉嵌入式系统开发流程;精通模块设计的思想;能深刻理解交叉编译和MAKE等概念;熟悉C,nesC两种编程语言;对C++,JAVA有一定了解;对ZigBee协议熟悉且具有一定的通信基础,能深刻理解地址、通道等概念。

1.JAVE JDK 安装首先,我们安装JAVE 开发工具JAVE JDK :Java SE Development Kit (JDK) 5/6下载地址:/javase/downloads/index.jsp 下载的默认文件名为:jdk-6u10-windows-i586-p.exe / jdk-1_5_0-windows-i586.exe安装过程只需下一步……下一步便可……然后,我们需要设置电脑的环境变量,需要新建两个环境变量,以便使用JDK具体过程如下:右击我的电脑——〉属性——〉高级——〉环境变量——〉系统变量(S)栏——〉新建(W)——〉新建系统变量对话框如下图:变量名(N):JAVA_HOME变量值(V):JDK安装的路径,默认路径为:C:\Program Files\Java\jdk1.6.0_10C:\Program Files\Java\jdk1.5.0变量名(N):CLASSPATH变量值(V):.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;;%JAVA_HOME%\bin;%JAVA_HOME%\jr e\bin;在用户变量的PATH中添加:;%JAVA_HOME%\bin:$PATH;%JAVA_HOME%\jer\bin:$PATH;在系统变量(S)栏选中变量为Path的选项,点编辑在变量值(V)的末尾添加:;%JAVA_HOME%\bin; ;%JAVA_HOME%\jre\bin;系统变量里最好也同样再设置一个CLASSPATH。

tinyos编译环境搭建(windows)

tinyos编译环境搭建(windows)

将Tinyos2.x移植到cc2530编译环境的搭建流程:在windows下建立cygwin平台,并搭建Tinyos的编译环境,然后将基于Tinyos的应用程序编译成hex文件,通过仿真器下载到cc2530片子上运行。

原材料:硬件(cc2530节点,仿真器等)、软件(Cygwin,Keil,TinyOS 2.x,编译环境配置软件包,SmartRF04 Flash Programer等)。

注意:硬件是原来在IAR下能正常使用的CC2530开发硬件就OK声明:一.里面很多东西我借鉴了网上的资料,并写在后面的参考文献中。

并对一些内容进行了修改和强调,以及我遇到的一些问题的解决方法。

= = = = = = = = = = = = = = = = = = = = = =1.安装Keil (Keil uVersion4)这些资源网上很多,百度和谷歌都可以搜到(注:一定要下载keil uVersion4,不可以下载4以下的版本,因为要运行的是cc2530,4以下的版本会找不到相关的编译平台环境)2.安装java 1.5 JDK我开始用1.6了的,反正一直没成功,不知道是不是这个原因。

最好就用1.5这个版本吧。

安装完了在命令行中:java –verson ,出现“java version “1.5.0”表示是1.5版本了。

3.安装Cygwin(1)下载Cygwin,我是在这里下载的:/index.php/Installing_TinyOS_2.0.2#Manual_installation_on_your_host_OS_with_RPMs,在Setp 2: Install Cygwin中第一步有个cygwin-files.zip,点击即可下载。

这个地址好像也可以下载:rmatik.uni-freiburg.de/people/aslam/cygwin-files.zip(2)安装时先解压下载的cygwin,点击setup.exe即可,默认安装在c盘下。

TinyOS学习笔记1

TinyOS学习笔记1

TinyOS学习笔记1-TinyOS安装1、Ubuntu系统的安装安装TinyOS可以在Windows中利用Cygwin进行安装,经过测试在XP中可以正确安装,但是安装的步骤过于麻烦,可以参考官方网站的安装步骤。

在Win7中安装后有问题,不能正确编译。

因此最好使用Linux系统来安装TinyOS,安装过程简单。

安装Ubuntu系统1.Ubuntu的官方网站下载iso镜像,我安装的是10.04版本2.可以有两种方式进行Ubuntu安装。

(1)传统方式安装:在系统中划分出空闲分区,利用U盘制作启动盘,官网有,可下载。

重启系统选择U盘启动。

进行安装。

(2)wubi方式进行安装:以文件形式进行安装,下载wubi,将镜像与wubi放于同一文件夹。

点击wubi进行安装。

3.更新Ubuntu更行Ubuntu时需要注意,更新时grub不更新。

利用wubi安装,我选择了更新grub,重新启动系统出现错误。

解决方法如下:1.另一台电脑,到Ubuntu网站下载镜像,安装到U盘中,制作启动盘。

2.开机,选择从U盘启动,在Boot里设置不好使,像我的ASUS A8,开机按ESC,选择U盘启动。

3.看到Ubuntu的欢迎界面,选择第一项,进入U盘中的Ubuntu系统。

4.在终端中,输入sudo apt-get install lilosudo lilo -M /dev/SD a mbr5.重启系统,问题解决4.使用root登录系统2、在Ubuntu系统下安装TinyOS我安装的时TinyOS2.1.1,安装过程参考TinOS官网的安装指导,但有问题,具体步骤如下:1)在系统的“/etc/apt/sources.list”中,添加如下代码:deb /tinyo ... lt;distribution> main<distribution>可以为(edgy,feisty,gutsy,hardy,jaunty,k ARM ic,lucid)例如 deb /tinyos/dists/ubuntu hardy main以上的源可能有问题,在安装是提示tinyos-2.1.1依赖的包找不到或无法安装,更新源如下解决此问题:deb /tinyos/dists/ubuntu hardy maindeb /tinyos oneiric main2)更新知识库,打开终端,输入sudo apt-get update3)安装TinyOSsudo apt-get install tinyos提示可选的tinyos的版本,选择最新的版本2.1.1sudo apt-get install tinyos-2.1.14)设置环境变量在~/.bashrc或者~/.profile中加入如下代码#Sourcing the tinyos environment variable setup scriptsource /opt/tinyos-2.1.1/tinyos.sh可用如下方法打开~/.bashrc或者~/.profilegedit ~/.bashrc添加成功后需要重新启动终端5)测试是否安装成功cd /opt/tinyos-2.1.1/apps/Blink/(若当前文件夹没有权限创建文件,将Blink复制到当前用户的目录进行运行)make telosb显示如下则安装成功:mkdir -p build/telosbcompiling BlinkAppC to a telosb binaryncc -obuild/telosb/main.exe -Os-O -mdisable-hwmul -fnesc-separator=__ -Wall -Wshadow -Wnesc-all-target=telosb -fnesc-cfile=build/telosb/app.c -board=-DDEFINED_TOS_AM_GROUP=0x22-DIDENT_APPNAME=/"BlinkAppC/"-DIDENT_USERNAME=/"root/"-DIDENT_HOSTNAME=/"ubuntu/"-DIDENT_USERHASH=0xa3473ba6L-DIDENT_TIMESTAMP=0x4c566efbL-DIDENT_UIDHASH=0xd972ea96L BlinkAppC.nc -lmcompiled BlinkAppC to build/telosb/main.exe2648 bytes in ROM54 bytes in RAMMSP430-objcopy --output-target=ihexbuild/telosb/main.exe build/telosb/main.ihexwriting TOS imageTinyOS学习笔记2-TinyOS的IDE-Yeti23.测试TinyOS中的Toosim∙make micaz sim∙提示找不到python2.5∙查看本机python的版本,我的版本为2.6∙进入/opt/tinyos-2.1.1/support/make/sim.extra∙修改python的版本PYTHON_VERSION=2.6∙重新make micazsim∙提示*** Successfullybuilt micaz TOSSIM library.则可运行tossim。

IMINIS1如何安装XP和MINIOS系统

IMINIS1如何安装XP和MINIOS系统

一、硬件需求1、带Windows操作系统且支持USB2.0的电脑一台2、USB转接线(imini S1标配)二、软件要求1、GhostXP,建议11.0以上版本;可以在windows环境执行Ghost操作(文件名为ghost32.exe)2、MiniOS镜像文件。

3 MINI XP 镜像文件。

(有版权问题)4、系统BIOS应在T900R020以上三、MiniOS和XP安装导入(GHOST32)步骤1、确认imini S1的BIOS版本,如果低于T900R020,请更新到T900R020或以上版本;更新BIOS时,请务必保证不要断电;刷新完毕后,拔掉AC再插上AC,开机进入CMOS Setup,导入默认值(Load Optimal Defaults)2、关闭系统,并拔掉AC3、将USB转接线的一端插在imini S1的最前端USB口;另一端接其他电脑(实现USB 硬盘功能)4、在另一台运行XP的机器上启动GhostXP(GHOST32.EXE)(建议使用11.0以上版本)5、选择Ghost模式,[Local]>[Patition]>[From Image];如下图6、A 导入MINIOS: 选择miniOS Ghost 镜像文件,点击[Open]开启,如下图B 导入XP系统:选择XP的镜像文件。

(XP的镜像文件需要自己制作)7、确认源镜像文件分区信息,点击[OK]确认8、选择目标驱动器,点击[OK]确认9、选择目标分区,点击[OK]确认;A 导入MINI OS 选择第一主分区,也就是标示为LINUX的分区。

B 导入XP 选择第二主分区,也就是下图的第二个分区中。

10、Ghost恢复完毕,退出Ghost程序。

TinyOs的安装方法

TinyOs的安装方法

Windows环境下安装TinyOs的方法第一步: Install Java 1.5 JDKWindowsDownload and install Sun's 1.5 JDK from .安装jkd环境变量设置如下:变量名变量值path C:\Program Files\Java\jdk1.5.0_11\binjava_home C:\Program Files\Java\jdk1.5.0_11classpath C:\Program Files\Java\jdk1.5.0_11\lib\tools.jar;C:\ProgramFiles\Java\jdk1.5.0_11\jre\lib\rt.jarWARNING: CLASSPA TH may not include '.' (that is, the symbol for the current working directory). Please add '.' to your CLASSPA TH or you may experience configuration problem.问题解决方法:1.CLASSPA TH=`.:$TOSROOT/tools/java/javapath`2..;C:\tinyos\jdk1.4.1_02\j2sdk1.4.1_02\bin;C:\tinyos\jdk1.4.1_02\j2sdk1.4.1_02\lib\tools.jar第二步: Install CygwinThis step is required for Windows installations only. If you are installing on Linux, skip to step 3. We have put online the cygwin packages that we've confirmed to be compatible with TinyOS. The instructions below use those packages. Y ou can also upgrade your cygwin environment according to the instructions at and your environment will most likely work. A large number of TinyOS users, upgrade their cygwin packages at least monthly from cygnus. However, since we can't test what packages are compatible as they become available daily, we can't confirm that today's set will work.1.Download and install Cygwin from .2.Download the confirmed-compatible cygwin packages from the tinyos web site here.3.In a cygwin shell, unzip the above package into some directory. In these instructions the directory is /cygdrive/c/newcygpkgs.$ cd /cygdrive/c/newcygpkgs$ tar zxvf cygwin-1.2a.tgzThis unzips the packages.4.In Windows Explorer, navigate to /cygdrive/c/newcygpkgs and click on the file setup.exe. Setup.exe is the setup program distributed by Cygnus Solutions.5.Follow these steps when the Cygwin Setup windows appears:Opt to disable the virus scanner (it will be enabled when you're finished).Opt to Install from Local Directory.6.Specify the Root directory to be where your current cygwin installation is. This would be the directory that directories like 'opt' and 'usr' are in. For example, mine is rooted at c:\tinyos\cygwin, so I enter that.7.Select to Install for All Users8.Select the Unix file type (very important!)9.For the Local Packages Directory, specify where you unzipped the cygwin packages tarfile. For example, I would specify c:\newcygpkgs. (The setup.exe program will probably select the right default directory.)10.The next window will allow you to select packages to install. Y ou should see that most of the packages have an X-ed box next to them; these are the packages that are to be installed.11.Click install. Some notes:Y ou might see a message explaining that you need to reboot because some files are in use. This most likely means that your cygwin DLL is loaded and in-use and, therefore, cannot be replaced. When you reboot, the new DLL will be loaded.Related to the above warnings, if you see warnings about the cygwin1.dll not being found, don't worry. All will be well once you reboot and the right DLL is loaded.第三步:Download and install Sun's m package在cygwin下unzip javacomm20-win32.zipcd commapicp win32com.dll "C:\Program Files\Java\jdk1.5.0_11\jre\bin"chmod 755 "C:\Program Files\Java\jdk1.5.0_11\jre\bin\win32com.dll"cp comm.jar "C:\Program Files\Java\jdk1.5.0_11\jre\lib\ext"cp m.properties "C:\Program Files\Java\jdk1.5.0_11\jre\lib"第四步Install native compilersInstall the appropriate version of the following (Windows or Linux, avr or msp430 or both) with the rpm command 'rpm -ivh '. On windows, if you get an error claiming that the rpm was build for an NT computer and you're on a windows NT computer, bypass the erroneous error by using 'rpm -ivh --ignoreos rpmname'. (We have xscale compiler tools online at /dist-1.2.0/tools/ but they have not yet been extensively tested by a large community.)Atmel AVR ToolsTool Windows/Cygwin Linuxavr-binutils†avr-binutils-2.15tinyos-3.cygwin.i386.rpm avr-binutils-2.15tinyos-3.i386.rpm avr-gcc avr-gcc-3.4.3-1.cygwin.i386.rpm avr-gcc-3.4.3-1.i386.rpmavr-libc avr-libc-1.2.3-1.cygwin.i386.rpm avr-libc-1.2.3-1.i386.rpmavarice avarice-2.4-1.cygwin.i386.rpm avarice-2.4-1.i386.rpminsight(avr-gdb)avr-insight-6.3-1.cygwin.i386.rpm avr-insight-6.3-1.i386.rpm†If you receive an rpm error that indicates that you have a newer version already installed, try rpm -Uvh --force第五步Install TinyOS toolchainThe TinyOS-specific tools are the NesC compiler and a set of tools developed in the tinyos-2.x/tools source code repository. They are also installed using rpms. If you using the Cygwin version recommended in these install instructions, you should install the "Recommended" Windows/Cygwin nesC RPM. If you get strange errors when you try to compile TinyOS programs, such as the error message "the procedure entry point basename could not be located in the dynamic link library cygwin1.dll", this is likely due to a Cygwin version incompatibility: try the "Other" Windows/Cygwin RPM (1.2.7a). If you are using Cygwin and installing the nesC RPM causes an error that the RPM was built for Cygwin, add the --ignoreos option.TinyOS-specific ToolsTool RecommendedWindows/CygwinOther Windows/Cygwin Linux CommandNesC nesc-1.2.8a-1.cygwin.i386.rpmnesc-1.2.8b-1.cygwin.i386.rpmnesc-1.2.8a-1.i386.rpmrpm-Uvhrpm-Uvh--ignoreos (ifCygwincomplains)tinyos-t ools tinyos-tools-1.2.3-1.cygwin.i386.rpmtinyos-tools-1.2.3-1.cygwin.i386.rpmtinyos-tools-1.2.3-1.i386.rpmrpm-ivh--force (1.x tree)rpm-Uvh (no1.x tree)第六步Install the TinyOS 2.x source treeNow that the tools are installed, you need only install the tinyos 2.x source tree and then set your environment variables. Install the appropriate version of the following (Window or Linux) with the rpm command 'rpm -ivh '. As with the previous rpms, if you get an error claiming that the rpm was build for an NT computer and you're on a windows NT computer, bypass the erroneous error by using 'rpm -ivh --ignoreos rpmname'.∙Install tinyos-2.xTinyOS 2.xWindows/Cygwin LinuxTinyOS tinyos-2.0.1-5.cygwin.noarch.rpm tinyos-2.0.1-5.noarch.rpm ∙Configure your environmentIdeally, you'll put these environment variables in a shell script that will run when yourshell starts, but you needn't put such a script under /etc/profile.d.The example settings below assume that the tinyos-2.x installation is in /opt/tinyos-2.x.Change the settings to be correct for where you've put your tinyos-2.x tree. Note that thewindows CLASSPATH must be a windows-style path, not a cygwin path. You cangenerate a windows style path from a cygwin-style path using 'cygpath -w'. For example:export CLASSPATH=`cygpath -w$TOSROOT/support/sdk/java/tinyos.jar`export CLASSPATH="$CLASSPATH;."TinyOS 2.xEnvironment VariableWindows Linux TOSROOT /opt/tinyos-2.x same as in Cygwin TOSDIR $TOSROOT/tos same as in CygwinCLASSPAT H C:\tinyos\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar;.$TOSROOT/support/sdk/java/tinyos.jar:.MAKERULES$TOSROOT/support/make/Makerules same as in CygwinPATH†/opt/msp430/bin:$PATH same as in Cygwin†Only necessary if you're using the MSP430 platform/tools.In addition to the above environment variables, do the following on Linux machines:1.Change the ownership on your /opt/tinyos-2.x files: chown -R <youruid> /opt/tinyos-2.x2.Change the permissions on any serial (/dev/ttyS<N>), usb (/dev/tts/usb<N>,/dev/ttyUSB<N>), or parallel (/dev/parport) devices you are going to use:chmod 666 /dev/<devicename>Finally, if you have installed TinyOS 2.0.1, there is a bug in TOSSIM (which will be fixed in 2.0.2). The bug is in file tos/chips/atm128/sim/atm128_sim.h. Change these lines 22 and 23 from:#define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr) + 0x20)#define _SFR_IO16(io_addr) _MMIO_WORD((io_addr) + 0x20) to#define _SFR_IO8(io_addr) _MMIO_BYTE((io_addr))#define _SFR_IO16(io_addr) _MMIO_WORD((io_addr)) If you do not do this, then timers will not work correctly.第七步Installing GraphvizGo to download page of the Graphviz project and download the appropriate RPM. Y ou only need the basic graphviz RPM (graphviz-); you don't need all of the add-ons, such as -devel, -doc, -perl, etc. If you're not sure what version of Linux you're running,uname -amight give you some useful information. Install the rpm with rpm -i rpm-name. In the case ofWindows, there is a simple install program, so you don't need to deal with RPMs. 下载1.10版/tos/dist-1.1.0/tools/windows/graphviz-1.10.exeand install it by executing it.第八步在/etc/profile.d下建立tinyos.sh文件内容如下:export TOSROOT=/opt/tinyos-2.xexport TOSDIR=$TOSROOT/tosexport CLASSPA TH=`cygpath -w $TOSROOT/support/sdk/java/tinyos.jar` export CLASSPA TH="$CLASSPA TH;."export MAKERULES=$TOSROOT/support/make/Makerulestype java >/dev/null 2>/dev/null || PA TH='/usr/local/bin/locate-jre --java':$PA TH type javac >/dev/null 2>/dev/null || PA TH='/usr/local/bin/locate-jre --javac':$PA TH echo $PA TH | grep -q /usr/local/bin || PA TH=/usr/local/bin:$PA TH第九步Tos-check-env。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1.TinyOS
1.1概要
TinyOS应用程序都是有一个或多个组件链接起来,从而形成一个完整的可执行程序。

组件中实现了功能接口,同时也能使用其它组件提供的接口。

在接口定义中可以申明命令函数和事件函数,命令函数由接口提供者实现,事件函数由接口使用者实现。

对于一个组件而言,如果它要使用某个组件接口中的命令,它必须实现这个接口的事件。

一个组件可以使用或提供多个接口以及同一个接口的多个实例。

组件有两种类型:模块(module)和配置(configuration)。

模块提供应用程序代码,实现一个或多个接口;配置则是用来将其它组件装配起来,将各个组件所使用的接口与其它组件提供的接口连接在一起,进行导通。

每个应用程序都由一个顶级配置所描述,其内容就是将该应用程序所用到的所有组件导通起来,形成一个有机整体。

TinyOS应用程序必须包含Main 组件,Main组件是首先被执行的一个组件。

确切的说,在TinyOS 中执行的第一个命令是Main.StdControl.init(),接下来是Main.StdControl.start()。

Main组件完成以下功能:芯片初始化,外围电路初始化,操作系统调度数据结构初始化,子组件初始化,启动子组件件,进入调度死循环从而将控制权交给操作系统,一旦没有任务可以调度就进入休眠状态以降低系统功耗。

TinyOS的调度系统是TinyOS系统的核心部分。

它采用先进先出的排队策略,任务之间不可以抢占,但是中断可以抢占任务,中断是否可以抢占中断则是应用程序自己控制的。

即如果中断处理程序进入中断以后执行了关中断的操作,那么这个中断将是不可抢占的,否则在服务的过程中就有可能被抢占掉。

另外还要注意,在中断服务程序里面是可以创建任务的。

1.2在Cygwin下的安装
在/etc/bash.bashrc文件中增加以下内容:
export TOSROOT=/opt/tinyos-2.x
export TOSDIR=$TOSROOT/tos
export CLASSPATH=C:\cygwin\opt\tinyos-2.x\support\sdk\java\tinyos.jar
export CLASSPATH="$CLASSPATH;."
export MAKERULES=$TOSROOT/support/make/Makerules
export PATH=/opt/msp430/bin:/opt/jflashmm:$PATH
安装以下软件包:
rpm -ivh --ignoreos c:/downloads/avr-binutils-2.17tinyos-3.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/avr-gcc-4.1.2-1.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/avr-libc-1.4.7-1.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/avarice-2.4-1.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/avr-insight-6.3-1.cygwin.i386.rpm
rpm -ivh --force --nodeps c:/downloads/avrdude-tinyos-5.6cvs-1.cygwin.i386.rpm rpm -ivh --ignoreos c:/downloads/nesc-1.3.1-1.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/tinyos-deputy-1.1-1.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/tinyos-tools-1.4.0-3.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/tinyos-2.1.1-3.cygwin.noarch.rpm
rpm -ivh --ignoreos c:/downloads/msp430tools-base-0.1-20050607.cygwin.i386.rpm rpm -ivh --ignoreos c:/downloads/msp430tools-python-tools-1.0-1.cygwin.noarch.rpm
rpm -ivh --ignoreos c:/downloads/msp430tools-binutils-2.16-20050607.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/msp430tools-gcc-3.2.3-20050607.cygwin.i386.rpm rpm -ivh --ignoreos c:/downloads/msp430tools-libc-20080808-1.cygwin.i386.rpm rpm -ivh --ignoreos c:/downloads/xscale-elf-binutils-2.15-1.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/xscale-elf-gcc-3.4.3-1.cygwin.i386.rpm
rpm -ivh --ignoreos c:/downloads/xscale-elf-newlib-1.11.0tinyos-1.cygwin.i386.rpm
修改执行/usr/bin/tos-install-jni文件:
change: "for lib in $tinyoslibdir/*-$bits.dll" to "for lib in $tinyoslibdir/*.dll" /usr/bin/tos-install-jni
修改/usr/bin/python2.5-config文件:
change: "/tmp/python.6884/usr/bin/python2.5.exe" to "/usr/bin/python2.5.exe"
编译Blink测试是否安装成功:
cd /opt/tinyos-2.x/apps/Blink
make telosb
make mica2
make micaz
make micaz sim
1.3Blink程序结构
Blink.nc文件
configuration Blink {
}
implementation {
components Main, BlinkM, SingleTimer, LedsC;
Main.StdControl -> SingleTimer.StdControl;
Main.StdControl -> BlinkM.StdControl;
BlinkM.Timer -> SingleTimer.Timer;
BlinkM.Leds -> LedsC;
}
BlinkM.nc文件
module BlinkM {
provides {
interface StdControl;
}
uses {
interface Timer;
interface Leds;
}
}
因为它提供了StdControl 接口,所以它必须实现StdControl.init(),StdControl.start()及StdControl.stop()等命令,因为它使用了Timer接口,所以它必须实现Timer.fired()事件
implementation {
command result_t StdControl.init() {
call Leds.init();
return SUCCESS;
}
command result_t StdControl.start() {
// Start a repeating timer that fires every 1000ms
return call Timer.start(TIMER_REPEAT, 1000);
}
command result_t StdControl.stop() {
return call Timer.stop();
}
event result_t Timer.fired()
{
call Leds.redToggle();
return SUCCESS;
}
}
-----精心整理,希望对您有所帮助!。

相关文档
最新文档