ubuntu14.04+TinyOS-2.1.2

来源:互联网 发布:阿里云主机租用费用 编辑:程序博客网 时间:2024/05/05 05:46

多次在ubuntu14.04上搭建环境但经常出现以下错误:

mkdir -p build/telosb
compiling BlinkAppC to a telosb binary
ncc -o build/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=0×22 -DIDENT_APPNAME=\”BlinkAppC\” -DIDENT_USERNAME=\”liruan\” -DIDENT_HOSTNAME=\”liruan-desktop\” -DIDENT_USERHASH=0x93f2e5efL -DIDENT_TIMESTAMP=0x4e98142bL -DIDENT_UIDHASH=0x40bf25adL BlinkAppC.nc -lm
In file included from /opt/tinyos-2.1.1/tos/platforms/telosa/PlatformLedsC.nc:38,
from /opt/tinyos-2.1.1/tos/system/LedsC.nc:38,
from BlinkAppC.nc:45:
In component `HplMsp430GeneralIOC’:
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:227: syntax error before `;’
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:321: cannot find `P30′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:322: cannot find `P31′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:323: cannot find `P31′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:324: cannot find `P32′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:325: cannot find `P33′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:326: cannot find `P33′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:327: cannot find `P34′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:328: cannot find `P35′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:330: cannot find `P50′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:331: cannot find `P51′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:332: cannot find `P52′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:333: cannot find `P53′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:334: cannot find `P36′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:335: cannot find `P37′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:337: cannot find `P60′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:338: cannot find `P61′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:339: cannot find `P62′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:340: cannot find `P63′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:341: cannot find `P64′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:342: cannot find `P65′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:343: cannot find `P66′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:344: cannot find `P67′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:346: cannot find `P66′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:347: cannot find `P67′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:349: cannot find `P67′
/opt/tinyos-2.1.1/tos/chips/msp430/pins/HplMsp430GeneralIOC.nc:350: cannot find `P57′
In component `PlatformLedsC’:
/opt/tinyos-2.1.1/tos/platforms/telosa/PlatformLedsC.nc:48: cannot find `Port54′
/opt/tinyos-2.1.1/tos/platforms/telosa/PlatformLedsC.nc:51: cannot find `Port55′
/opt/tinyos-2.1.1/tos/platforms/telosa/PlatformLedsC.nc:54: cannot find `Port56′
make: *** [exe0] Error 1


然后参考了一下http://demo.netfoucs.com/tianzhihen_wq/article/details/37505697的方法就成功的装上了

具体如下:

1.sudo gedit /etc/apt/sources.list
添加源
# TinyOS Install
deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main

2.sudo apt-get update

3.sudo apt-get install tinyos-2.1.2

4.sudo gedit /opt/tinyos-2.1.2/tinyos.sh
创建添加一下内容:
#! /usr/bin/env bash
# Here we setup the environment
# variables needed by the tinyos 
# make system


echo "Setting up for TinyOS 2.1.2"
export TOSROOT=
export TOSDIR=
export MAKERULES=


TOSROOT="/opt/tinyos-2.1.2"
TOSDIR="$TOSROOT/tos"
CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:.
MAKERULES="$TOSROOT/support/make/Makerules"


export TOSROOT
export TOSDIR
export CLASSPATH
export MAKERULES


5.配置一下环境变量

sudo gedit ~/.bashrc

# TinyOS setup
source /opt/tinyos-2.1.2/tinyos.sh


6.sudo tos-install-jni


7.msp430-gcc --version
已经安装了这个编译器但是版本在4.6.3以下
卸载老版本的msp430-gcc
sudo apt-get autoremove --purge msp430*


gpg --keyserver keyserver.ubuntu.com --recv-keys 34EC655A 
gpg -a --export 34EC655A | sudo apt-key add -
sudo gedit /etc/apt/sources.list
添加
# TinyOS MSP430 GCC Compiler Repository
deb http://tinyprod.net/repos/debian squeeze main
deb http://tinyprod.net/repos/debian msp430-46 main

8.sudo apt-get update
sudo apt-get install msp430-46 nesc tinyos-tools

9.sudo chown 用户名 -R /opt/tinyos-2.1.2/

10.cd /opt/tinyos-2.1.1/apps/Blink
make telosb

0 0
原创粉丝点击