开发环境:Ubuntu13.10
1. 添加源,并安装tinyos-2.11:
sudo gedit /etc/apt/sources.list #往里边添加deb lucid mainsudo apt-get updatesudo apt-get install -y tinyos-2.1.12. 安装好wine,及安装Keil:sudo apt-get install wine #安装wine,在Linux上运行Windows程序文件下载:
利用wine安装好Keil_C51_V8.09,之后的编译时会使用得到; 3. 安装Ubuntu13.10编译过程中的一些依赖环境:sudo apt-get install g++ python2.7-dev安装jdk1.6(略过,网上搜索结果一大把)4. 安装tinyos-2.x-contrib:需要文件: 解压方法:cd /optsudo tar zxf TinyOS8051wg-0.1pre4.tgz5. 一些文件修改过程:文件1:/opt/tinyos-2.1.1/support/make/sim.extra将其中:PYTHON_VERSION=2.5修改为:PYTHON_VERSION=2.7将其中:PYDIR = $(shell python$(PYTHON_VERSION)-config –prefix)/usr/include/python$(PYTHON_VERSION)修改为:PYDIR =/usr/include/python$(PYTHON_VERSION)将其中:-L/$(PYDIR)/config修改为:-L/bin文件2:/opt/tinyos-2.x-contrib/diku/mcs51/support/make/mcs51/mcs51.rules将其中: MCS51_WINE_IAR=env WINEPREFIX=$(MCS51_WINE_IAR_PATH) LC_ALL=en_US wine MCS51_WINE_KEIL=env WINEPREFIX=$(MCS51_WINE_KEIL_PATH) LC_ALL=en_US wine cmd /c修改为: MCS51_WINE_IAR=env WINEPREFIX=$(MCS51_WINE_IAR_PATH) LC_ALL=en_US; wine MCS51_WINE_KEIL=env WINEPREFIX=$(MCS51_WINE_KEIL_PATH) LC_ALL=en_US; wine cmd /c文件3:/opt/tinyos-2.x-contrib/diku/env将其中:export TOSROOT=/opt/tinyos-2.x修改为:export TOSROOT=/opt/tinyos-2.1.16. 编译过程:source /opt/tinyos-2.x-contrib/diku/envcd /opt/tinyos-2.x-contrib/diku/common/apps/BlinkNoTimerTaskmake cc2430em7. 输出结果:
8. 生成的文件展示:[scue@Link:BlinkNoTimerTask]$ ls -1 build/cc2430em/ APP app.c app.hex app.lst app.map app.obj app.preMangle.c app.reg APP.SBR CC2430-F128.bat ident_flags.txt startup.a51 startup.bat startup.LST startup.OBJ
9. 烧写至开发板(这一步要在Windows上操作,可使用虚拟机):
需要工具:
安装好之后,操作步骤: 1). System-on-Chip:要显有设备,不显示则: 2). Flash image路径:选择好刚刚编译出来的app.hex文件; 3). 点击Read IEEE,并勾选:Retain IEEE address when reprogramming the chip 4). Actions:勾选第二项的Erase, program and verify 5). 最后点击"Perform actions",完成刷入;参考文档:
1.
2.
3.
4.
5.
6.