Ubuntu16.04中安裝TinyOS

Ubuntu16.04安裝TinyOs:java

1. 卸載以前的工具
sudo apt purge tinyos-tools
sudo dpkg -P `dpkg -l nesc '*tinyos*' | grep ^ii | awk '{ print $2 }' | xargs`
sudo apt cleanpython

sudo apt autoremove --purge nesc tinyos-tools-devel msp430-46 avr-tinyoslinux

2.安裝依賴包
2.1安裝主機開發環境
sudo -s
apt install build-essential stow automake autoconf libtool libc6-dev
apt install git-core git-daemon-run git-doc git-email git-gui gitk gitmagic
apt install openssh-client openssh-server graphviz
apt install python3 python3-serial python python-serial
exitc++

2.2安裝TinyOS工具鏈
sudo -s
echo "deb http://tinyprod.net/repos/debian stretch main" >> /etc/apt/sources.list.d/tinyprod-debian.list
echo "deb http://tinyprod.net/repos/debian msp430-46 main" >> /etc/apt/sources.list.d/tinyprod-debian.list
apt update
exitgit

sudo apt install nesc tinyos-tools tinyos-tools-devel msp430-46 mspdebug avr-tinyosgithub

3.安裝arm工具鏈
3.1下載安裝arm工具鏈
ARM_TOOLS_BASE=https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download
ARM_TOOLS_TAR=gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2
wget -nv -O gcc-arm-none-eabi.tar.bz2 $ARM_TOOLS_BASE/$ARM_TOOLS_TARbash

echo "*** Installing ARM toolchain"
sudo tar xf gcc-arm-none-eabi.tar.bz2 -C /usrapp

3.2給arm工具鏈安裝庫
sudo apt install -qy -V libc6:i386 libx11-6:i386 libasound2:i386 \
libatk1.0-0:i386 libcairo2:i386 libcups2:i386 libdbus-glib-1-2:i386 \
libgconf-2-4:i386 libgdk-pixbuf2.0-0:i386 libgtk-3-0:i386 \
libice6:i386 libncurses5:i386 libsm6:i386 liborbit2:i386 \
libudev1:i386 libusb-0.1-4:i386 libstdc++6:i386 libxt6:i386 \
libxtst6:i386 libgnomeui-0:i386 libusb-1.0-0-dev:i386 \
libcanberra-gtk-module:i386 gtk2-engines-murrine:i386 unzip \
libpython2.7:i386

3.3安裝Jlink
SUPPORT_ARCHIVE=http://tinyprod.net/dev-archive
JLINK_DEB=${SUPPORT_ARCHIVE}/JLink_Linux_V616j_x86_64.deb
wget -nv -O jlink.deb ${JLINK_DEB}
sudo dpkg -i jlink.debpython2.7

3.4 拉取TinyOS 源碼
開發板:
mkdir tinyos-main
cd tinyos-main
git clone -o tos -v git://github.com/tinyos/tinyos-main tinyos-2.x
cd tinyos-2.x
git checkout -b tos

發佈版:
mkdir tinyos-release
cd tinyos-release
git clone -o rel -v git://github.com/tinyos/tinyos-release tinyos-2.x
cd tinyos-2.x
git checkout -b rel

4 配置環境
在~/.bashrc文件的末尾追加以下語句:
export PATH=/usr/bin:/usr/msp430/bin:/usr/gcc-arm-none-eabi-4_9-2015q3/bin:$PATH
export TOOLCHAIN=/usr/gcc-arm-none-eabi-4_9-2015q3
export TOSROOT=~/tinyos-release/tinyos-2.x
export TOSDIR="$TOSROOT/tos"
export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar
export MAKERULES="$TOSROOT/support/make/Makerules"
export PYTHONPATH=$TOSROOT/support/sdk/python:$PYTHONPATH
export MOTECOM="serial@/dev/ttyUSB0:telosb"ssh

5.測試環境
tos-check-env

6.編譯telosb,micazcd tinyos-release/tinyos-2.x/apps/Blinkmake micazmake telosb

相關文章
相關標籤/搜索