|
From: Lin Gu <li...@us...> - 2005-04-20 19:43:23
|
Update of /cvsroot/vert/shamrock/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11162/doc Modified Files: vdb-tutorial.txt Log Message: vdbavr updated Index: vdb-tutorial.txt =================================================================== RCS file: /cvsroot/vert/shamrock/doc/vdb-tutorial.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** vdb-tutorial.txt 20 Apr 2005 19:05:27 -0000 1.1.1.1 --- vdb-tutorial.txt 20 Apr 2005 19:43:01 -0000 1.2 *************** *** 1,31 **** ! README for MagClassify ! Author/Contact: Lin Gu / li...@cs... ! This is a stand-alone application testing the magnetic sensing algorithm. ! Configuration: ! This application depends on some modules which do not exist in the TinyOS source tree. Hence, please configure it before compiling and running the application. ! 1. Set up the SHAMROCKDIR environment variable to the path where the shamrock directory is, e.g.: ! export SHAMROCKDIR=/usr/src/shamrock ! 2. Set up the TOSMAKE_PATH environment variable as follows: ! export TOSMAKE_PATH=$SHAMROCKDIR/src/sys/arch/xsm ! 3. Run "configenv" in the $SHAMROCKDIR directory, e.g., ! ! cd $SHAMROCK ! ./configenv ! Build ! ===== ! Make sure the SHAMROCKDIR and TOSMAKE_PATH is set correctly. ! Build the application as in TinyOS, e.g., ! make xsm --- 1,68 ---- ! Tutorial of VDB ! =============== ! By Lin Gu <li...@cs...>, Liqian Luo <ll...@cs...> ! VDB is a simple utility that help debug TinyOS programs. The best way to learn VDB is by examples. This tutorial provides several short examples with step-by-step descriptions. All the files used are in the shamrock package named "shamrock.tar.gz". This tutorial is applicable to Berkeley Mica2 platforms, like Mica2, XSM1, Exscal, etc. + Example 1: printing debug information to the serial port (UART). ! 1. Make sure the TinyOS environment is set up correctly. ! For example, the TOSDIR environment is correctly set. ! 2. Uncompress the shamrock package, and move the shamrock directory to a desirable location. From this point on, we use SHAMROCKDIR to denote the path to the shamrock directory. ! For example, in a Unix-like environment(e.g., Linux, cygwin), you may uncompress the package with the following command: ! gzip -dc shamrock.tar.gz | tar xvf - ! 3. Copy the hello application to the TinyOS application directory. The hello application is in SHAMROCKDIR/src/app/hello. ! For example, the following command copies the application in a Unix-like environment. ! cp -R SHAMROCKDIR/src/app/hello $TOSDIR/../apps ! Remember to substitute the correct path for SHAMROCKDIR in the above command. + 4. Copy the VDB source files (vdbavr.*) into the hello application's directory. The VDB source files are in SHAMROCKDIR/src/util/vdb. Example: + + cp SHAMROCKDIR/src/util/vdb/vdbavr.* $TOSDIR/../apps/hello + + 5. Go to the hello appliction's directory, open the file HelloM.nc, and include the file "vdbavr.inc" in the "implementation" block of the NesC program. + + For example, add the following line at the beginning of the "implementation" block. + + #include "vdbavr.inc" + + 6. In the "Timer.fired()" event, add a call to vdbPrintln4() to print debug information via the UART. + + For example, add the following line in Timer.fired(), + + vdbPrintln4("hello world", lTick, 0, 0, 0); + + 7. Build the hello application. Example: + + make mica2 + + 8. Upload the hello application to the mote. + + For example, if using an MIB510 serial programming board, you may run the following command: + + make mica2 reinstall mib510 + + 9. Set up the java CLASSPATH to include SHAMROCK/src/util/vdb. Example: + + export CLASSPATH=$CLASSPATH:SHAMROCK/src/util/vdb + + 10. Run VDB terminal to display the debug output, specify the COM port if necessary (the default is COM1). + + For example, if you are using COM1, run the following command: + + java VDBTerm + + If you are using COM2, run the following command. + + java VDBTerm COM2 + + The "hello world" messages should be displayed on the terminal. |