JTAG TelosB Windows
Howto: Debugging Tmote sky with MSP FET430UIF on Windows XP
This page describes my experience of setting up TI's JTAG device (MSP-FET430UIF) to debug motiev's tmote platform (telosb) which is equipped with an MSP430x1611. This mcu supports JTAG debugging which is a really helpful feature and following is how to go about it.The Machine I tried this on was:
HPtx1000z (AMD Turion X2) with Windows XP sp2
Step 1:
Download mspgcc-20080619.exe from href http://sourceforge.net/project/showfiles.php?group_id=42303.Run this installer and install the tools, prefrebaly in c:\mspgcc
Step 2:
Download and unzip drivers for MSP-FET430UIF as explained here OR from accompanying CD. Plugin JTAG device into a usb port on your system. Hopefully Windows will recognize it automatically. If it doesn't and asks for the drivers, point to <folder you selected for installation>\IAR Systems\Embedded Workbench x.x\430\drivers\TIUSBFET\WinXP and hopefully then it will install your hardware.Step 3:
At this point if everything went well you should be able to connect to JTAG device. Before moving forward, connect JTAG device to mote. Mote should be powered on either using battery pack or USB.To connect JTAG open a command window and type following command:
msp430-gdbproxy msp430 --selftest-usb-fet TIUSBIn response to this you should get an output like
Remote proxy for GDB, v0.7.1, Copyright (C) 1999 Quality Quorum Inc. MSP430 adaption Copyright (C) 2002 Chris Liechti and Steve Underwood GDBproxy comes with ABSOLUTELY NO WARRANTY; for details use `--warranty' option. This is Open Source software. You are welcome to redistribute it under certain conditions. Use the '--copying' option for details. notice: msp430: TI USB FET self-test requested debug: MSP430_Initialize() debug: MSP430_FET_SelfTest() notice: msp430: Self test passed debug: MSP430_Initialize() debug: MSP430_Configure() debug: MSP430_VCC(3000) debug: MSP430_Identify() info: msp430: Target device is a 'MSP430F1611' (type 42) debug: MSP430_Configure() notice: msp430-gdbproxy: waiting on TCP port 2000If instead you see an error message that firmware is not uptodate, update it using following command
msp430-gdbproxy msp430 --update-usb-fet TIUSBThis will update the firmware and then you will be able to perform self test using second-last command.
Step 4:
Make a file named main.c with following contents and save it.
///////////////////
#include
void wait(); /* prototype for wait() */
int main()
{
/* main function, called by startup-code */
P5DIR = 0xFF; /* port 5 = output */
P5OUT = 0x70; /* set bits 4-6 in port 5 */
for(;;) {
/* infinite loop */
P5OUT ^= 0x10; /* invert port 5 bit 4 */
wait(); /* call delay function */
}
}
void wait()
{
/* simple delay function */
volatile int i; /* declare i as volatile int */
for(i = 0; i < 32000; i++)
; /* repeat 32000 times (nop) */
}
///////////////////
Step 5:
In another command window, compile the file uisng following commandmsp430-gcc main.c -mmcu=msp430x1611 -o main.elf
Step 6:
Now open gdb, and load the generated elf file using following commandsmsp430-gdb main.elf (gdb) target remote localhost:2000 (gdb) monitor erase all (gdb) load (gdb) contAt this point if everything went well, the red led on mote should be blinking. If it does Congratulations.
To set up Eclipse you might want to take a look at [1], [2] and [3]. Somehow [1] and [2] missed installation of Zylin-embedded CDT, a plugin in Eclipse which can be installed from within Eclpise using update site: http://www.zylin.com/zylincdt
Refrences:
[1] http://www.scribd.com/doc/219845/msp430-mspgcc-eclipse-ubuntu-tutorial[2] http://msp430.techcontent.net/wiki/index.php/IDEs/Eclipse
[3] http://homepage.hispeed.ch/py430/mspgcc/
Please send any suggestions, comments, critique to Waqaas Munawar


