Skip to content

在Ubuntu 13.04下设置contiki工具链

Benoît Thébaudeau edited this page Sep 23, 2019 · 5 revisions

本文描述如何在一个新安装的Ubuntu 13.04上设置Contiki工具链。

  1. 在终端运行下面的命令,让URLs指向正确的仓库(老的仓库被搬移到架构服务器上了):

    sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
    sudo apt-get update
    
  2. 安装下面的包:

    sudo apt-get install build-essential binutils-msp430 gcc-msp430 msp430-libc binutils-avr gcc-avr gdb-avr avr-libc avrdude openjdk-7-jdk openjdk-7-jre ant libncurses5-dev doxygen git
    

    这样你就能交叉编译MSP430-和AVR-平台了。

  3. 从Github克隆Contiki源码:

     git clone --recursive git:https://github.com/contiki-os/contiki.git contiki
    

    这样你就能继续下去了。

  4. 为了测试你的设置是否正确,你可以以下面的方式编译、运行hello-world例程:

    cd contiki/examples/hello-world
    make TARGET=native hello-world
    ./hello-world.native
    

    最后一个命令将产生下面的输出:

    Contiki-2.6-584-g807293a started
    Rime started with address 2.1
    MAC nullmac RDC nullrdc NETWORK Rime
    Hello, world
    
Clone this wiki locally