⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 esb.txt

📁 是瑞典科学院开发的世界最小的嵌入式操作系统,并且包括了TCP/IP协议,是最新版本
💻 TXT
字号:
/** \addtogroup platform * @{ **//**\defgroup esb The ESB Embedded Sensor BoardThe ESB (Embedded Sensor Board) is a prototype wireless sensor networkdevice developed at Freie Universit鋞 Berlin.<img src="img/esb/esb.jpg" align="right">The ESB consists of a Texas Instruments MSP430 low-powermicrocontroller with 2k RAM and 60k flash ROM, a TR1001 radiotransceiver, a 32k serial EEPROM, an RS232 port, a JTAG port, abeeper, and a number of sensors (passive IR, active IRsender/receiver, vibration/tilt, microphone, temperature).The Contiki/ESB port contains drivers for most of the sensors. Thedrivers were mostly adapted from sources from FU Berlin.\section esb-getting-started Getting started with Contiki for the ESB platformThe ESB is equipped with an MSP430 microcontroller. The first step togetting started with Contiki for the ESB is to install the developmenttools for compiling Contiki for the MSP430.Windows users, see \ref esb-win-setup. FreeBSD users, see \ref esb-freebsd-setup\section esb-win-setup Setting up the Windows environmentThe Contiki development environment under Windows uses the Cygwinenvironment. Cygwin is a Linux-like environment for Windows. Cygwincan be found at http://www.cygwin.com. Click on the icon "InstallCygwin Now" to the right to get the installation started.Choose "Install from Internet" and then specify where you want toinstall cygwin (recommended installation path:<tt>C:\\cygwin</tt>). Continue with the installation until you areasked to select packages. Most packages can be left as "Default" butthere is one package that are not installed by default. Install thefollowing package by clicking at "Default" until it changes to"Install":- Devel - contains things for developers (make, etc).<img src="img/esb/cygwin6b.jpg" align="center">When cygwin is installed there should be a cygwin icon that startsup a cygwin bash when clicked on. Whenever it is time to compile andsend programs to the ESB nodes it will be done from a cygwin shell.\subsection winintro-installing-editor C programming editorIf you do not already have a nice programming editor it is a goodidea to download and install one. The Crimson editor is a nicewindows based editor that is both easy to get started with andfairly powerful.Crimson Editor can be found at:http://www.crimsoneditor.com/The editor is useful both when editing C programs and whenmodifying scripts and configuration files.\subsection winintro-installing-compiler MSP430 Compiler and toolsA compiler is needed to compile the programs to the MSP430microprocessor that is used on the ESB sensor nodes. Download andinstall the GCC toolchain for MSP430 (recommended installation path:C:\\MSP430\\).The GCC toolchain for MSP430 can be found at:http://sourceforge.net/projects/mspgcc/When the above software is installed you also need to set-up thePATH so that all of the necessary tools can be reached. In cygwinthis is done by the following line (given that you have installedat recommended locations):<tt>export PATH=\$PATH:/cygdrive/c/MSP430/mspgcc/bin</tt>This line can also be added to the .profile startup file in your cygwinhome directory(<tt>C:\\cygwin\\home\\\<YOUR USERNAME\>\\.profile</tt>).If your home directory is located elsewhere you can find it bystarting cygwin and running \c cd followed by \c pwd.\subsection winintro-installing-contiki The Contiki operating system, including examplesWhen programming the ESB sensor nodes it is very useful to have anoperating system that takes care of some of the low-level tasks andalso gives you as a programmer APIs for things like events, hardwareand networking.  We will use the Contiki operating system developed byAdam Dunkels, SICS, which is very well suited when programming smallembedded systems.The Contiki OS can be found at:http://www.sics.se/~adam/contiki/Unzip the Contiki OS at (for example) C:\\and you will get the following directories among others:- contiki-2.x/core - the contiki operating system- contiki-2.x/platform/esb - the contiki operating system drivers, etc for the ESB- contiki-2.x/platform/esb/apps/ - example applications for the ESB\subsection winintro-testing Testing the toolsNow everything necessary to start developing Contiki-based sensor netapplications should be installed. Start cygwin and change to thedirectory <tt>contiki-2.x/platform/esb/</tt>. Then call <tt>makebeeper.co</tt>.If you get an error about multiple cygwin dlls when compiling, youneed to delete <tt>cygwin1.dll</tt> from the MSP430 GCC toolchain(<tt>C:\\MSP430\\bin\\cygwin1.dll</tt>).Connect a node and turn it on. Upload the test application by calling<tt>make beeper.u</tt>.\subsection winintro-testing-development Development tools- <tt>make \<SPEC\></tt> will compile and make a executable file readyfor sending to the ESB nodes. Depending on the \c SPEC it might evenstartup the application that sends the executable to thenode. Typically you would write things like <tt>"make beeper.u"</tt>to get the file <tt>beeper.c</tt> compiled, linked and sent out to theESB node\subsection winintro-testing-shell Some basic shell commands- <tt> cd \<DIR\></tt> change to a specified directory (same as in DOS)- <tt> pwd \<DIR\></tt> shows your current directory- <tt> ls</tt> list the directory- <tt> mkdir \<DIR\></tt> creates a new directory- <tt> cp \<SRC\> \<DEST\></tt> copies a file\section esb-freebsd-setup Setting up the FreeBSD environmentDownload the msp430-gcc, msp430-binutils, andmsp430-libc packages fromhttp://www.sics.se/~adam/contiki/freebsd-packages/. Install thepackages (as root) with <tt>pkg_add</tt>. \section esb-test-compilation Compiling your first Contiki system\section esb-burn-node-id Burning node IDs to EEPROMThe Contiki ESB port comes with a small program, <tt>burn-nodeid</tt>that semi-permanently stores a (unique) node ID number in the ESBEEPROM. When the Contiki ESB port boots up, this node ID is restoredfrom the EEPROM. To compile and run this program, go into your projectdirectory and run<tt>make burn-nodeid.u nodeid=X</tt>Where <tt>X</tt> is the node ID that will be burned into EEPROM. The<tt>burn-nodeid</tt> program stores the node ID in EEPROM, reads itback, and writes the output@{*//** @} *//** @} */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -