Embedded Systems

Embedded Systems

This is just a scratchpad area for notes I make while working with embedded systems (mostly TinyOS). At any given moment they are probably out of date and/or inaccurate. However, I still find them useful as a reference, so maybe you will too!

Contents


Embedded Systems News

Top


TinyOS

Links

Avrora

These are the commands I use to run avrora. Probably not very helpful to anybody else.

avr-objdump -zhD simple.elf > simple.od

java net.tinyos.sf.SerialForwarder -comm network@127.0.0.1:2390

java net.tinyos.surge.MainClass 0x7d

cp avrora/test/topology/grid3x3.top .

avrora -action=simulate -simulation=sensor-network -monitors=packet,serial,memory -platform=mica2 -stagger-start=500000 -real-time -seconds=1200 -nodecount=1,1,1,1,1,1,1,1,1 -topology=./grid3x3.top ./surge.od ./surge.od ./surge.od ./surge.od ./surge.od ./surge.od ./surge.od ./surge.od ./surge.od

Installation

Linux with root

Installing on linux is fairly straightforward if you have root privileges. The only trick is finding the correct place to start from, which is also fairly straightforward if you are not simultaneously trying to install TinyOS on a machine with only user privileges.
  1. Follow the instructions on the TinyOS website for Installing from RPMs.
  2. Run toscheck to make sure that worked fine.
  3. Follow the instructions on the TinyOS website for Using the CVS tinyos-1.x tree.
  4. Run toscheck to make sure that worked fine.
  5. Download the Crossbow contibutions to TinyOS from their download site and save it in tinyos-1.x/contrib.
  6. Remove the tinyos-1.x/contrib/xbow folder and untar the Crossbow download.
  7. Have fun with TinyOS! I would suggest looking through Crossbow's Getting Started Guide if you have not already done so.

Top

Linux without root

While installing TinyOS on my personal machines was simple, setting it up for my school account was more complicated. I did use some cheats and asked the support people to install some things, but the majority was done independent of them (so I could upgrade and modify it myself).
  1. These steps loosely follow the Installing from source guide on the TinyOS web site. Go ahead and open that up.
  2. Follow step A) (remove everything) and then go to "On Linux:"
  3. Follow the first bullet, except you will want the tgz formats. Untar the SDK where you want it to go. Then untar the communications package in the same place. Put the location of "IBMJava2-142/bin" in your path. Type in "which java" and make sure that it points to the right java (the one you just installed). Here is the url they give you to find this stuff: https://www6.software.ibm.com/dl/lxdk/lxdk-p
  4. For the next bullet, you will need to have the system administrators set the permissions correctly. Just ask them to do both the serial port and the parallel port.
  5. Now proceed to "Common Installation (Linux and Windows)" on the guide.
  6. Download sources for tools. Here is the url to find all the stuff: http://webs.cs.berkeley.edu/tos/dist-1.1.0/tools/source/. Do NOT install them as explained in the guide. Just un-tar them (using -j to untar bzip files).
  7. There is a flag that the configure files need in order to install properly (without root privileges). So, follow the guide (bullet one under "Common Installation"), except add the --prefix=$HOME/local flag everytime you run "configure" (and for "doconf" with libc). For msp430, you must adjust the makefile directly. This will create a "fake" root structure in your home directory. You should add $HOME/local/bin to your path.
  8. Ignore the warning about removing libiberty.a and libmmalloc.a in the instructions for installing avarice. Not much we can do about that. However, I did get an error when making and had to edit the source. If you get an error from jtagprog.cc, change the function from bfd_get_section_size_before_reloc to bfd_get_section_size. Hopefully that will work.
  9. Time to move on to the next bullet. Download TinyOS and extract the tarball where you want to keep TinyOS. Here is where you find the tarballs: http://webs.cs.berkeley.edu/tos/dist-1.1.0/tinyos/source/.
  10. Download nesC and compile it as it says in the guide, with one exception: Remember to use the --prefix=$HOME/local flag when running configure.
  11. Now, when changing back to the tinyos-1.x directory, edit the makefile so that the prefix is $HOME/local. Then run "make" and "make install" as directed.
  12. Access to profile.d is probably not available, so instead of putting tinyos.sh into that directory, append it to .bashrc and make the necessary modifications. I corrected $TOSROOT (including changing the directory for tinyos-1.x to tinyos-1.1.9). I also had to put the correct path for the bin directory (my $HOME/local instead of /usr).
  13. Run toscheck here. I got a couple warnings when I did this, but they weren't actually problems.
  14. Make sure you are using the IBM version of java. Type in env and look at the java environment variables. If they are not pointing to where you put IBM's java SDK (they probably won't be) you need to put a reassignment in your startup script. I needed to deal with JRE_HOME, JAVA_BINDIR, JAVA_HOME, SDK_HOME, JDK_HOME and JAVA_ROOT.
  15. Follow the last bullet of the guide to compile the java tools and then you are done, unless you want to install the Crossbow apps.
  16. To install the Crossbow apps, go to their download site. Download the mote firmware (should be Xbow.tgz and called "Mote firmware") to the $TOSROOT/contrib directory. You may have to make this directory (I did). Untar the files and you now have Crossbow's stuff.

Top

Windows with Crossbow CD

Because Crossbow is selling a commercial product, they provide good support and a pretty easy to follow installation guide. However, there were a few steps I used that are not mentioned in their guide.
  1. Go to Crossbow's website and download their Getting Started Guide. You probably want to print it too.
  2. Follow the instructions on the TinyOS website for uninstalling Cygwin.
  3. Optional Uninstall java SDK. The first time I tried to just update mine and run from it, but that did not work so well. Having the CD install everything is best, because they know that works. If you do not do this, you need to install Sun's javax.comm package by following the instructions on the Installing from RPMs website. It is the third bullet under "WINDOWS INSTALLATION (Win 2K and XP)."
  4. Install from CD by following instructions in section 2.2.1 of Crossbow's Getting Started Guide.
  5. Run toscheck to make sure that it worked fine
  6. Follow the Using the CVS tinyos-1.x tree website to upgrade to the newest version.
  7. Run toscheck to make sure that it worked fine
  8. Download the Crossbow contibutions to TinyOS from their download site and save it in tinyos-1.x/contrib.
  9. Remove the tinyos-1.x/contrib/xbow folder and untar the Crossbow download.
  10. Have fun with TinyOS! I would suggest looking through the rest of Crossbow's Getting Started Guide if you have not already done so.

Top

Random Notes

In order to get avr-gcc 3.4.3 compiled (from source), I had to configure with "--disable-nls --target=avr --enable-languages=c --prefix=/home/coop/local/" and then compile.

Top


Top

Back