Tinyos 2.0使用笔记

1.编译与安装程序到节点

 

引用
$ make mica2


编译mica2 platform

 

 

引用
$ make mica2 install


编译并安装 (using the default parallel port programmer) Blink for the mica2

 

 

引用
$ make mica2 reinstall mib510,/dev/ttyS0


安装已经编译好的应用,使用 MIB510 serial port programmer connected to serial port /dev/ttyS0.

 

 

引用
$ make mica2 reinstall,101 mib510,/dev/ttyS0


安装已经编译好的应用,并设置节点ID为101,使用 MIB510 serial port programmer connected to serial port /dev/ttyS0. (tinyos用节点ID来做为传输地址)



其他参数说明:

  • Target platform: 目标平台。e.g., mica2, telosb, tinynode. 除了使用make clean以外,target platform是必需的。
  • Action: the action to perform. By default, the action is to compile the application in the current directory, but you can also specify:
    • help: display a help message for the target platform.
    • install,N: compile and install. The N argument is optional and specifies the mote id (default 1).
    • reinstall,N: install only (fails if the application wasn't previously compiled). N is as for install.
    • clean: remove compiled application for all platforms.
    • sim: compile for the simulation environment for the specified platform (see Lesson 11 for details). Example: to compile for simulation for the micaz: $ make micaz sim
Compilation option: you can change the way compilation proceeds by specifying: debug: compile for debugging. This enables debugging, and turns off optimisations (e.g., inlining) that make debugging difficult. debugopt: compile for debugging, but leave optimisations enabled. This can be necessary if compiling with debug gives code that is too slow, or if the bug only shows up when optimisation is enabled. 如果debug运行太慢,或者bug是由于optimisation优化造成的,就需要用到这个。 verbose: enable a lot of extra output, showing all commands executed by make and the details of the nesC compilation including the full path of all files loaded. This can be helpful in tracking down problems (e.g., when the wrong version of a component is loaded). wiring, nowiring: enable or disable the use of the nescc-wiring to check the wiring annotations in a nesC program. See the nescc-wiring man page for more details. Example: to do a verbose compilation with debugging on the telosb: $ make debug verbose telosbAdditionally, you can pass additional compilation options by setting the CFLAGS environment variable when you invoke make. For instance, to compile apps/RadioCountoToLeds for a mica2 with a 900MHz radio set to ~916.5MHz, you would do: $ env CFLAGS="-DCC1K_DEF_FREQ=916534800" make mica2 Note that this will not work with applications whose Makefile defines CFLAGS (but this practice is discouraged, see the section on writing Makefiles below).

 

 

Installation option: some platforms have multiple programmers, and some programmers require options (e.g., to specify which serial port to use). The programmer is specified by including its name amongst the make arguments. Known programmers include:

  • bsl for msp430-based platforms
  • avrisp (STK500), dapa (MIB500 and earlier), mib510 (MIB510) and eprb (MIB600) for mica family motes.

Arguments to the programmer are specified with a comma after the programmer name, e.g., $ make mica2dot reinstall mib510,/dev/ttyUSB1 $ make telosb reinstall bsl,/dev/ttyUSB1 to specify that the programmer is connected to serial port /dev/ttyUSB1. More details on the programmers and their options can be found in your mote documentation.


参考:
http://docs.tinyos.net/index.php/TinyOS_Toolchain

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值