文档章节

contiki 开发日记

张浩淼
 张浩淼
发布于 2012/04/23 23:21
字数 580
阅读 344
收藏 0

「深度学习福利」大神带你进阶工程师,立即查看>>>

contiki 环境平台的搭建参照(主要开发平台采用cc2430):

https://github.com/g-oikonomou/contiki-sensinode/wiki/Prepare-your-System

 

 

This guide is cloned on the contiki wiki. In case of conflicting information, the Contiki wiki wins. Please contact me and let me know about the issue.

In order to compile contiki, you need a version of the SDCC compiler. Unfortunately, the binary packages don't contain all the libraries we need so you will have to compile SDCC from sources.

Information on this page has been tested on Ubuntu and on Mac OS X. Things should work on Cygwin but may require some tweaking.

Before anything else, make sure you don't have a pre-installed version from the Ubuntu archive!

Make sure you have the following installed:

  • gcc

  • flex

  • bison

  • libboost-graph-dev

  • Python

  • srecord (http://srecord.sourceforge.net/)

  • If you want to run border routers on Mac OS X, you will also need TunTap

SDCC supports various device types. You can compile it with support for all of them or only some. The port of interest to us is the mcs51. Disabling all other ports will make the compile considerably faster.

Recent Tested SDCC revisions: 7100

  • Download a recommended revision from the SDCC svn (replace [rev] with one of the numbers above):

svn co -r [rev] https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc

  • cd into the extracted directory. This will be called sdcc

  • Now you need to hack sdcc's build system a bit, in order to get correct library versions.

    • Download and save it to the sdcc directory.

    • Patch sdcc: patch -p0 < contiki-sdcc.patch

    • Edit device/lib/incl.mk.
      We need model-huge and model-large libraries. To instruct the build system to build model-huge libraries, find this line:
      MODELS = small medium large.
      Add huge. You may remove small and medium if you only use SDCC for contiki, but make sure you keep large. So your new line may end up looking like this:
      MODELS = small large huge.

    • Edit device/lib/Makefile.in. Find this line:
      TARGETS += models small-mcs51-stack-auto.
      Replace it with this:
      TARGETS += models model-mcs51-stack-auto

    • You can do this manually:

    • Or you can apply this patch.

  • Run
    ./configure --disable-gbz80-port --disable-z80-port --disable-ds390-port --disable-ds400-port --disable-pic14-port --disable-pic16-port --disable-hc08-port --disable-r2k-port --disable-z180-port --disable-sdcdb --disable-ucsim

    • If you don't have root access you will probably want to change the installation directory. You can do that with the --prefix=dir option of the ./configure stage.

    • If you get any errors about missing packages, fix them.

  • make

  • make install as root or with sudo

You now have a working compiler and libraries. The sdcc executable might be outside the PATH, depending where you installed it. Try running sdcc -v and see if it's in the PATH. If not, add it. If sdcc is in the PATH and you have compiled excluding unused ports, sdcc -v will show you something like this:

SDCC : mcs51 3.0.6 #7000 (Nov 1 2011) (Linux)

The list of supported ports appears after the : and before the version number. If you build everything this message will be a lot longer.

 

With SDCC in place, you can now start using Contiki for your devices.

Clone this repo

git clone git://github.com/g-oikonomou/contiki-sensinode.git

Switch to the correct branch

Make sure you have switched to the correct branch: git checkout cc-ports

Build an example

Some existing examples can be found in examples/sensinode and in examples/cc2530dk. cd into the directory of your choice and run make.

 

张浩淼
粉丝 5
博文 12
码字总数 3441
作品 0
南岸
程序员
私信 提问
加载中
请先登录后再评论。
beego API开发以及自动化文档

beego API开发以及自动化文档 beego1.3版本已经在上个星期发布了,但是还是有很多人不了解如何来进行开发,也是在一步一步的测试中开发,期间QQ群里面很多人都问我如何开发,我的业余时间实在...

astaxie
2014/06/25
2.7W
22
Web开发组件管理器--Bower

Bower 是一个针对Web开发的包管理器。该工具主要用来帮助用户轻松安装CSS、JavaScript、图像等相关包,并管理这些包之间的依赖。 功能有些类似于Component。不同之处是,Component是围绕Git...

匿名
2013/02/01
1.2W
2
跨平台手机应用开发--Gideros

Gideros 可以让你轻松快速创建 iOS 和 Android 应用,提供用户友好的集成开发环境,内建模拟器对应用进行不同屏幕大小、分辨率下的测试,最大的优点是可即时修改代码即时进行测试,无需编译安...

匿名
2013/02/19
2.8K
1
Android3D应用与游戏开发框架--JQGL

JQGL 是一款针对Android设备上3D应用、游戏的开发框架。 核心功能是OpenGL-ES的使用框架,相对于大部分开发者而已,OpenGL是陌生的,没有专门研究无法进行相关的开发。 本框架针对于Android...

Jping
2013/02/21
1.6K
0
高效 Java Web 开发框架--JessMA

JessMA 是功能完备的高性能 Full-Stack Web 应用开发框架,内置可扩展的 MVC Web 基础架构和 DAO 数据库访问组件(内部已提供了 Hibernate、MyBatis 与 JDBC DAO 组件),集成了 Action 拦截...

伤神小怪兽
2012/11/13
9.3K
3

没有更多内容

加载失败,请刷新页面

加载更多

Visa首次发行5亿美元绿色债券和任命首席可持续发展官,扩大对可持续发展的承诺

旧金山--(美国商业资讯)--全球领先的支付技术公司Visa (NYSE: V)今天宣布,公司昨日已成功为其首次发行的总计5亿美元的绿色债券定价,将支付0.75%的半年息票率,2027年8月15日到期。该绿色债...

osc_zjm9j6vk
44分钟前
23
0
Perceptive Advisors携手多个战略联盟创立联拓生物(LianBio)并建构营运平台

联拓生物与BridgeBio Pharma、MyoKardia、BridgeBio Pharma子公司Navire Pharma和QED Therapeutics合作,在中国和亚洲主要市场开发尖端疗法并进行商业化,将创新科学业务拓展至全球,并建立了...

osc_923iryp1
46分钟前
0
0
导入Maven项目时jar包依赖配置失败:Failed to read artifact descriptor for xxx

导入Maven项目时有时会遇到无法自动配置Configrations和yml文件的情况,完了去配置里一看,Library是空的。maven导入jar包的时候应该出了问题。如图操作maven提示重新import change即可。...

osc_45mm6g1p
46分钟前
15
0
SpringBoot手动装配,自定义Enable模块

前言 前面我们介绍了简单详细的SpringBoot自动配置原理解析,今天这篇文章主要是介绍下如何是实现手动配置,自定义Enable模块, 基于注解驱动实现 基于注解的驱动实现是最基本的自定义Enabl...

osc_m8arvi7m
48分钟前
0
0
Esp8266 Web Server 应用实例 - Simple Web Console

Esp8266 Web Server 应用实例 - Simple Web Console 本文旨在向读者介绍使用Esp8266 WiFi板搭建Web Server应用的原理。示例向读者展示了如何创建Web Console,以及如何使Web Console与NodeM...

osc_xdc1vjza
49分钟前
15
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部