contiki 参考
文章出处
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 参考相关推荐
- Contiki Process概述
本文涉及到的Protothread机制知识,在http://www.cnblogs.com/songdechiu/p/5793717.html 一.进程类型 进程类型主要有协同式(cooperativ ...
- Contiki OS 开发快速入门
笔者之前研究过一段时间 Contiki OS ,万事开头难,入门时会走不少弯路,现在将此过程分享出来.首先介绍一下 Contiki OS: Contiki是一个小型.开源.极易移植的多任务电脑操作系统 ...
- MSP430G2553 移植 Contiki RTOS 实时操作系统
目录 新建工程 移植过程 关于时间 多任务示例 main.c 内存使用情况 效果 平台:Code Composer Studio 10.4.0 MSP-EXP430G2 LaunchPad 试验板 M ...
- Contiki Etimer 模块
一.Etimer概述 Etimer提供产生时间事件(timed event)的机制,当设定好的timer到期时,将会给设定etimer的process发送一个PROCESS_EVENT_TIMER 事 ...
- contiki makefile框架分析 contiki学习之一
在linux下的工程编译,基本都可以使用makefile这个工具来完成.Contiki OS亦如此,下面分析contiki整个Makefile的框架,对makefile的具体内容暂不做分析.本文依赖于 ...
- 物联网操作系统 - Contiki
What is Contiki? Contiki is an open source operating system for the Internet of Things. Contiki conn ...
- contiki笔记2-contiki的第一个程序
1.编写helloworld源代码 Contiki中每一个应用程序都需要一个单独的文件夹,我们为helloworld!建立一个名为helloworld的文件夹,并在其中创建 helloworld.c和 ...
- Instant Contiki
1.前言 [更多contiki和物联网笔记请参考--物联网学习笔记--索引博文] [如果您使用的Instant Contiki版本为2.7 请忽略此文,Instant Coniti2. ...
- Eclipse+WIN7+CC2538移植开发Contiki
Eclipse+WIN7+CC2538的Contiki开发,题目好长啊,不少人不熟悉Linux开发环境,当然也我也不是很习惯,所以呢就想找个Windows环境下开发喽,这一次谈谈如何在Windows下 ...
最新文章
- 复数 Complex Number 教程
- Lua5.3手册标准库拾遗
- U2L蔚然成风,曙光为什么能抢了VMware的风头?
- 双linux grub rescue,Grub Rescue修复方法
- liunx 上传 代码到github
- 如果使用StateServer或SQLServer,会遇到的问题。。。。
- 解决 git pull 报错 fatal: refusing to merge unrelated histories
- leetcode No.21 合并两个有序链表
- 华为P50保护壳曝光:双环形后置相机模组实锤
- jQ+jQ UI制作的一个简单的二级可多选穿梭框
- Duplicate class com.xxx.xxx found in modules
- I2C完整讲解(二)
- Java 程序员,年薪 40W 需要什么水平?
- 计算机广告设计发展前景,2018广告设计与制作专业就业前景和就业方向分析
- 按键手机怎么装java_怎样把USB键盘接到Android手机上
- Golang 调用http 文件上传接口 进行上传文件
- Code for city 黑客松大赛——万元大奖等你来拿
- android第三方开源音频播放器,Android第三方开源SeekBarCompat:音乐类播放器等APP进度条常用...
- SpringBoot邮件服务spring-boot-starter-mail
- [编程] Java8 Stream(流式计算) 常见的一些用法汇总