OpenOCD for IMote2 Wiggler

From TinyOS Wiki
Revision as of 13:31, 11 August 2008 by Nilmish (talk | contribs)
Jump to: navigation, search

OpenOCD JTAG programming for IMote2 using pc parallel port Wiggler cable

Wiggler cable is generically available and can also be made easily. The below instructions are for [wiggler cable from Diy gadgets]. Instructions to make wiggler cable can be found [here].

Build OpenOCD

  • check out OpenOCD svn repository
svn checkout http://svn.berlios.de/svnroot/repos/openocd/trunk openocd-svn
  • build OpenOCD with parallel port wiggler
 cd openocd-svn
 ./bootstrap
 ./configure --enable-parport
 make
  • install OpenOCD
 sudo make install
 sudo chmod 4755 /usr/local/bin/openocd
 sudo mkdir -p /usr/local/etc
 sudo cp arm-wiggler.cfg /usr/local/etc
 sudo chmod 755 /usr/local/etc/arm-wiggler.cfg

Get the arm-wiggler.cfg [here] This will install openocd to /usr/local/bin. Be sure this is on your PATH.

Program iMote2 with OpenOCD

  • Connect iMote2 to the debug board.
  • Connect JTAG interface to debug board and then connect to PC parallel port.
  • Press the reset button on the iMote2.
  • compile binary:
cd /opt/tinyos-2.x/apps/Blink
make intelmote2 install.100 openocd

Note that this will try to run "imote2-ocd-program-wiggler.py" with the executable as an argument. This program is assumed to be in $TOSROOT/tools/platforms/intelmote2/openocd/; The script can be found at [here]. Alternately, you can manually install the binary on the mote by running:

$TOSROOT/tools/platforms/intelmote2/openocd/imote2-ocd-program-wiggler.py build/intelmote2/main.exe

Manual programming method.

The above uses our custom "imote2-ocd-program-wiggler.py" program that is a wrapper for running openocd and programming the mote. You can also run openocd by hand:

 openocd -f /usr/local/etc/arm-wiggler.cfg

and then connect to it with:

 telnet localhost 3333

Various commands you can use:

halt
poll
reset
resume
flash info 0