文章出处

http://www.amobbs.com/thread-5515866-1-1.html

搞zigbee算是国内第一批了,很早就知道6lowpan。用cc2430时,从研究http://www.tinyos8051wg.net,找寻资料了解到 Nanostack1.0.0,直到Nanostack1.1.0 之后就转为contiki了。好久没发帖了,发个帖Mark一下,先!

1. Download Instant Contiki

1. Download Instant Contiki
http://sourceforge.net/projects/contiki/files/Instant%20Contiki/
2. Install VMWare Player
https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0
3. Log into Instant Contiki. 
password is: user
4. 编译~/contiki/examples/cc2530dk下例子,需要先安装SDCC.
  参考文档
   https://github.com/contiki-os/contiki/wiki/8051-Requirements
  4.1)下载SDCC
  cd /opt
  sudo svn co -r 7100  https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc/
  4.2) 更改配置
  sudo vi /opt/sdcc/device/libs/incl.mk
  将最后一行
  MODELS = small medium large
  替换为
  MODELS = small large huge
  sudo vi /opt/sdcc/device/libs/Makefile.in
  将最后一行
  TARGETS += models small-mcs51-stack-auto
  替换为
  TARGETS += models model-mcs51-stack-auto
  cd /opt/sdcc
  •Run this:
   sudo ./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
  此过程若出现 
  configure: error: boost library not found (boost/graph/adjacency_list.hpp)
  执行
  sudo apt-get install libboost-graph-dev
  完成后,重新执行
    sudo ./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

  4.3)编译,安装
  sudo make
  sudo make install
  4.4)完成
  sdcc -v
  显示
  SDCC : mcs51 3.1.1 #7100 (Jan 10 2013) (Linux)
5. 编译cc2530dk
  5.1) hello world
  cd ~/contiki/examples/cc2530dk
  make hello-world
  编译完成
   user@instant-contiki:~/contiki/examples/cc2530dk$  ls
  blink-hello.c         hello-world.c         obj_cc2530dk           timer-test.c
  blink-hello.cc2530dk  hello-world.cc2530dk  sensors-demo.c         timer-test.cc2530dk
  blink-hello.cdb       hello-world.cdb       sensors-demo.cc2530dk  timer-test.cdb
  blink-hello.hex       hello-world.hex       sensors-demo.cdb       timer-test.hex
  blink-hello.lk        hello-world.lk        sensors-demo.hex       timer-test.lk
  blink-hello.map       hello-world.map       sensors-demo.lk        timer-test.map
  blink-hello.mem       hello-world.mem       sensors-demo.map       timer-test.mem
  blink-hello.omf       hello-world.omf       sensors-demo.mem       timer-test.omf
  border-router         Makefile              sensors-demo.omf       udp-ipv6
  contiki-cc2530dk.lib  Makefile.target       sniffer
  5.2) udp-ipv6
  cd ~/contiki/examples/cc2530dk/udp-ipv6
  make
  报错,缺少srecord
  Pack hex file
  ===============
  srec_cat -disable_sequence_warnings client.banked-hex -intel -crop 0x18000 0x1FFFF -offset -65536 -o bank1.hex -intel
  /bin/sh: 5: srec_cat: not found
  srec_cat -disable_sequence_warnings client.banked-hex -intel -crop 0x28000 0x2FFFF -offset -98304 -o bank2.hex -intel
  /bin/sh: 5: srec_cat: not found
  srec_cat -disable_sequence_warnings client.banked-hex -intel -crop 0x38000 0x3FFFF -offset -131072 -o bank3.hex -intel
  /bin/sh: 5: srec_cat: not found
  srec_cat -disable_sequence_warnings client.banked-hex -intel -crop 0x48000 0x4FFFF -offset -163840 -o bank4.hex -intel
  /bin/sh: 5: srec_cat: not found
  make: *** [client.hex] Error 127
  执行
  sudo apt-get install srecord
6. TI SmartRF Flash Programmer 烧录 *.hex
  已烧录hello-world.hex为例,CC2530 UART0 会打印输出如下信息:
  ##########################################
  Contiki-2.6
  TI SmartRF05 EB
  cc2530-F256, 08KB SRAM
  SDCC Build:
    --model-large
    --stack-auto
   Net: Rime
   MAC: CSMA
   RDC: nullrdc
  ##########################################
  Rime is 0x02 bytes long
  Reading MAC from Info Page
  Rime configured with address c6:1c
  Rime is 0x02 bytes long
  Reading MAC from Info Page
  Rime configured with address 67:af
  Hello World!
7. 建立自己的硬件平台[我的是:edutech]和工程[我的是:edutech]
  7.1) cpu
   cd ~/contiki/cpu/cc253x
  cp Makefile.cc253x Makefile.cc253x-edutech
  cp bank-alloc.py bank-alloc-edutech.py
  vi Makefile.cc253x-edutech
  编辑第14行
  BANK_ALLOC = $(CONTIKI_CPU)/bank-alloc.py
  为
  BANK_ALLOC = $(CONTIKI_CPU)/bank-alloc-edutech.py
  保存
:wq
  vi bank-alloc-edutech.py
  编辑第101行
  file_pat = re.compile('obj_cc2530dk[^ ]+\.')
  为
file_pat = re.compile('obj_edutech[^ ]+\.')
  将文中4处,157、158、172、173行中
  bank-alloc.py 替换为 bank-alloc-edutech.py 
  保存
:wq
  7.2) platform
  cd ~/contiki/platform
  cp cc2530dk edutech -R
  cd edutech
  mv Makefile.cc2530dk  Makefile.edutech
  vi Makefile.edutech
  编辑第1行[非必须]
  # cc2530dk platform makefile
  为
  # edutech platform makefile
  编辑第19行
  CLEAN += *.cc2530dk
  为
  CLEAN +=  *.edutech *.native
  编辑第52行,最后一行
  include $(CONTIKI_CPU)/Makefile.cc253x
  为
  include $(CONTIKI_CPU)/Makefile.cc253x-edutech
  保存
  :wq
  接下来根据实际硬件情况,编辑或创建驱动文件
  7.3) project
  cd ~/contiki/examples
  cp cc2530dk/ edutech -R
  cd edutech
  vi Makefile.target 
  编辑第1行
  TARGET = cc2530dk
  为
  TARGET = edutech
  保存
  :wq
  make 
  之后,根据实际情况,继续。。。

contiki 参考相关推荐

  1. Contiki Process概述

    本文涉及到的Protothread机制知识,在http://www.cnblogs.com/songdechiu/p/5793717.html 一.进程类型 进程类型主要有协同式(cooperativ ...

  2. Contiki OS 开发快速入门

    笔者之前研究过一段时间 Contiki OS ,万事开头难,入门时会走不少弯路,现在将此过程分享出来.首先介绍一下 Contiki OS: Contiki是一个小型.开源.极易移植的多任务电脑操作系统 ...

  3. MSP430G2553 移植 Contiki RTOS 实时操作系统

    目录 新建工程 移植过程 关于时间 多任务示例 main.c 内存使用情况 效果 平台:Code Composer Studio 10.4.0 MSP-EXP430G2 LaunchPad 试验板 M ...

  4. Contiki Etimer 模块

    一.Etimer概述 Etimer提供产生时间事件(timed event)的机制,当设定好的timer到期时,将会给设定etimer的process发送一个PROCESS_EVENT_TIMER 事 ...

  5. contiki makefile框架分析 contiki学习之一

    在linux下的工程编译,基本都可以使用makefile这个工具来完成.Contiki OS亦如此,下面分析contiki整个Makefile的框架,对makefile的具体内容暂不做分析.本文依赖于 ...

  6. 物联网操作系统 - Contiki

    What is Contiki? Contiki is an open source operating system for the Internet of Things. Contiki conn ...

  7. contiki笔记2-contiki的第一个程序

    1.编写helloworld源代码 Contiki中每一个应用程序都需要一个单独的文件夹,我们为helloworld!建立一个名为helloworld的文件夹,并在其中创建 helloworld.c和 ...

  8. Instant Contiki

    1.前言     [更多contiki和物联网笔记请参考--物联网学习笔记--索引博文]     [如果您使用的Instant Contiki版本为2.7 请忽略此文,Instant Coniti2. ...

  9. Eclipse+WIN7+CC2538移植开发Contiki

    Eclipse+WIN7+CC2538的Contiki开发,题目好长啊,不少人不熟悉Linux开发环境,当然也我也不是很习惯,所以呢就想找个Windows环境下开发喽,这一次谈谈如何在Windows下 ...

最新文章

  1. 复数 Complex Number 教程
  2. Lua5.3手册标准库拾遗
  3. U2L蔚然成风,曙光为什么能抢了VMware的风头?
  4. 双linux grub rescue,Grub Rescue修复方法
  5. liunx 上传 代码到github
  6. 如果使用StateServer或SQLServer,会遇到的问题。。。。
  7. 解决 git pull 报错 fatal: refusing to merge unrelated histories
  8. leetcode No.21 合并两个有序链表
  9. 华为P50保护壳曝光:双环形后置相机模组实锤
  10. jQ+jQ UI制作的一个简单的二级可多选穿梭框
  11. Duplicate class com.xxx.xxx found in modules
  12. I2C完整讲解(二)
  13. Java 程序员,年薪 40W 需要什么水平?
  14. 计算机广告设计发展前景,2018广告设计与制作专业就业前景和就业方向分析
  15. 按键手机怎么装java_怎样把USB键盘接到Android手机上
  16. Golang 调用http 文件上传接口 进行上传文件
  17. Code for city 黑客松大赛——万元大奖等你来拿
  18. android第三方开源音频播放器,Android第三方开源SeekBarCompat:音乐类播放器等APP进度条常用...
  19. SpringBoot邮件服务spring-boot-starter-mail
  20. [编程] Java8 Stream(流式计算) 常见的一些用法汇总

热门文章

  1. 英语基础-疑问句概述
  2. 【Proteus8+keil5的仿真使用】
  3. C++中strlen函数
  4. 电脑自动关机是什么原因?为什么电脑会自动关机?轻松弄懂
  5. 快速将PDF图片转成PPT
  6. 博客阅读:图解Transformer(The Illustrated Transformer)
  7. c#怎么在github上快速找到相关的开源项目
  8. python量化分析系列之---5行代码实现1秒内获取一次所有股票的实时分笔数据
  9. 持续交付的软件系统架构
  10. C语言:围圈报号排序问题