📄 verifyhw.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head> <title>TinyOS Tutorial: Hardware Verification</title></head><body bgcolor="#f8f8ff" link="#005bb7" vlink="#005bb7"><table border="0" hspace="4" cellspacing="2" width="100%" cellpadding="3"> <tbody> <tr bgcolor="#e0e0ff"> <td width="100%"> <font face="tahoma,arial,helvetica"><b><big><big>TinyOS Tutorial: System and Hardware Verification</big></big></b> </font> <p> <font face="tahoma,arial,helvetica">Last updated 23 September2003 </font> </p> </td> </tr> </tbody></table><p> When working with embedded devices, it is very difficult to debugapplications. Because of this, you want to make sure that thetools you are using are working properly and that the hardware isfunctioning correctly. This will save you countless hours of searchingfor bugs in your application when the real problem is in the tools.This lesson will show you how to check your system and the hardware.</p><p><table border="0" hspace="4" cellspacing="2" width="100%" cellpadding="3"> <tbody> <tr bgcolor="#e0e0ff"> <td width="100%"><nobr><b><font face="arial,helvetica">PC toolsverification</font></b></nobr></td> </tr> </tbody></table></p><p> A TinyOS development environment requires the use of avr gcccompiler, perl, flex, cygwin if you use windows operationsystem, and JDK 1.3.x or above. We provide a tool named <tt>toscheck</tt>to check if the tools have been installed correctly and that theenvironment variables are set. </p><p>Run <span style="font-family: monospace;">toscheck</span> (it shouldbe in your path - a copy is also in <span style="font-family: monospace;">tinyos-1.x/tools/scripts</span>). Theoutput should be something like:</p><p> <font face="Courier New" size="1">toscheck <br>Path:<br>/usr/local/bin<br>/usr/bin<br>/bin<br>/cygdrive/c/jdk1.3.1_01/bin<br>/cygdrive/c/WINDOWS/system32<br>/cygdrive/c/WINDOWS<br>/cygdrive/c/avrgcc/bin<br>.<br><br>Classpath:<br>/c/alpha/tools/java:.:/c/jdk1.3.1_01/lib/comm.jar<br><br>avrgcc:<br>/cygdrive/c/avrgcc/bin/avr-gcc<br>Version: 3.0.2<br><br>perl:<br>/usr/bin/perl<br>Version: v5.6.1 built for cygwin-multi<br><br>flex:<br>/usr/bin/flex<br><br>bison:<br>/usr/bin/bison<br><br>java:<br>/cygdrive/c/jdk1.3.1_01/bin/java<br>java version "1.3.1_01"<br>Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)<br>Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)<br><br>Cygwin:<br>cygwin1.dll major: 1003<br>cygwin1.dll minor: 3<br>cygwin1.dll malloc env: 28<br><br>uisp:<br>/usr/local/bin/uisp<br>uisp version 20010909<br><br><br>toscheck completed without error.</font><br> </p><p> The last line is the most important. If any errors arereported, make sure to fix the problem.</p><p><table border="0" hspace="4" cellspacing="2" width="100%" cellpadding="3"> <tbody> <tr bgcolor="#e0e0ff"> <td width="100%"><nobr><b><font face="arial,helvetica"> HardwareVerification</font></b></nobr></td> </tr> </tbody></table></p><p> To test the hardware, we have provided an application: <font color="#0000ff"> MicaHWVerify</font>. It is designed for the purpose of verifying mica/mica2/mica2dot mote hardwareonly. If you have a different hardware platform, this applicationis not suitable. </p><p>Change to the <font color="#0000ff"><a href="../../apps/MicaHWVerify">apps/MicaHWVerify</a></font> directoryand type</p><center><table border="0" hspace="4" cellspacing="2" width="80%" cellpadding="3"> <tbody> <tr bgcolor="#e0e0e0"> <td width="100%"> <pre><i>(mica platform)</i> make mica </pre> <pre><i>(mica2/mica2dot)</i> PFLAGS=-DCC1K_DEF_FREQ=<freq> make [mica2|mica2dot] <br></pre> </td> </tr> </tbody></table></center><p> For the mica2/mica2dot, see the <a href="../mica2radio/CC1000.html">MICA2Radio documentation</a> for how to choose <tt><freq></tt>. Thecompilation process should complete without any errors (Compilation forthe mica2dot will generate a warning about the SerialID component). Ifit compiled correctly, it will print out a profile of the memory used bythe application. While the exact build directory and memory footprintswill vary depending on your platform, it should look like:</p><p> <font face="Courier New" size="1"> compiled MicaHWVerify tobuild/mica2/main.exe <br> 10386 bytes in ROM <br> 390 bytes in RAM <br>avr-objcopy --output-target=srec build/mica2/main.exebuild/mica2/main.srec</font></p><font face="Courier New" size="1"> </font><p> Next step is to install the application onto a mote. Place apowered-on node into a programming board. The red LED on theprogramming board should light. Connect the programming boardto the parallel port of your computer. To load the program onto the device, using a parallel port programmer, type </p><center><table border="0" hspace="4" cellspacing="2" width="80%" cellpadding="3"> <tbody> <tr bgcolor="#e0e0e0"> <td width="100%"> <pre> make reinstall [mica|mica2|mica2dot]<br></pre> </td> </tr> </tbody></table></center><p>See "<a href="programmers.html">Device Programmer Tools</a>" forinstallation instructions for other programmers. The output should looklike:</p><p> <font face="Courier New" size="1"> installing mica2 binary <br>uisp -dprog=<yourprogrammer> -dhost=c62b270 -dpart=ATmega128--wr_fuse_e=ff --erase --upload if=build/mica2/main.srec <br>Atmel AVR ATmega128 is found. <br>Uploading: flash <br>Fuse Extended Byte set to 0xff</font></p><p> Now you know that the programming tools and the computer's parallelport are working. The next step is to verify the mote hardware.First, confirm that the LEDs are blinking like a binary counter. Next,connect the programming board to the serial port of the computer. Thehardware verify program will send data over the UART that contains itstatus. To read from the serial port, we provide a java toolcalled <tt>hardware_check.java</tt>. It is located in the samedirectory. Build and run this tool. The commands are shown belowassuming you are using <tt>COM1</tt> at 57.6 KBaud to connect to theprogramming board. </p><blockquote> <table border="0" hspace="4" cellspacing="2" width="80%" cellpadding="3"> <tbody> <tr bgcolor="#e0e0e0"> <td width="100%"> <pre> <br> make -f jmakefile<br> MOTECOM=serial@COM1:57600 java hardware_check<br></pre> </td> </tr> </tbody> </table></blockquote><p><font face="Times New Roman">See "<a href="../serialcomm/index.html">Serial-linecommunication in TinyOS</a>" for more information on how to specify aserial port (or other communication method) for use with </font><span style="font-family: monospace;">hardware_check</span><font face="Times New Roman">. The output on the PC should be somethinglike: </font></p><p><font face="Courier New" size="1">hardware_check started<font color="#ff0000"><br></font>Hardware verification successful.<br>Node Serial ID: 1 60 48 fb 6 0 0 1d</font><br></p><p> This program checks the serial ID of the mote (except on themica2dot), the flash connectivity, the UART functionality and theexternal clock. If all status checks are positive, thehardware verification successful message will be printed on your PCscream. If you see any failure report on your monitor, you mightneed get another mote.</p><p><table border="0" hspace="4" cellspacing="2" width="100%" cellpadding="3"> <tbody> <tr bgcolor="#e0e0ff"> <td width="100%"><nobr><b><font face="arial,helvetica">RadioVerification</font></b></nobr></td> </tr> </tbody></table></p><p> To verify radio, you need two nodes. Take a second node (thathas passed the hardware check up to this point) and install it with <tt>TOSBase</tt>.This node will act as a radio gateway to a second node. Onceinstalled, leave this node in the programming board and place theoriginal node next to it. Re-run the <tt>hardware_check</tt> javaapplication. The output should be the same as shown in the previoussection (but will display the serial ID of the remote mote). Theindication of a working radio system is, again, something like:<br></p><p><font face="Courier New" size="1">hardware_check started<font color="#ff0000"><br></font>Hardware verification successful.<br>Node Serial ID: 1 60 48 fb 6 0 0 1d</font><br></p><p>If the remote mote is turned off or not functioning, it will returna message "Node transmission failure".</p><p> If your system and hardware pass all the above tests, you are allset for having some fun with TinyOS. Congratulations. </p><p> </p><hr> <b><a href="index.html"> Tutorial Index </a></b></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -