xGoat
More tea please.

MSP430 Programmer Kernel Patches

Since a couple of days ago, when I wrote about the kernel patches that I generated to get the UIF working, I have had a response on the mspgcc-users mailing list. The problem has already been fixed in 2.6.20, so my patches aren’t required.

The reason that I previously thought that the fix hadn’t found its way into the kernel was that it had been fixed in a different, and better way – thus the code changes I was looking for weren’t there. The fix that’s in the kernel is a much more sane approach than the method I copied off the mspgcc-users mailing list. So I’m now running 2.6.20, and the UIF (and presumably the EZ430 – I don’t have that here at the moment) works fine.

One thing that may slightly irritate people when first installing the UIF is that you need to add a rule to udev. This rule is: (edit: you probably don’t want to use the rule below now – see further below)

SUBSYSTEM=="usb_device" ACTION=="add" SYSFS{product}=="MSP-FET430UIF JTAG Tool" \
  SYSFS{bNumConfigurations}=="2" \
  SYSFS{bConfigurationValue}=="1" \
  RUN+="/bin/sh -c 'echo 2 > /sys%p/device/bConfigurationValue'"

And then it works (remember to reload udev rules with “udevcontrol reload_rules“). I’m not 100% sure what it does, but from looking at the rule and driver code, it would seem that the TI USB->UART chip in the debugger can has more than one configuration, and that affects what firmware gets loaded into the USB->UART chip. The udev rule associates the device description string (“MSP-FET430UIF JTAG Tool”) with the correct config value (2).

Edit: Things have changed in udev since I wrote this post. The rule I now use is:

SUBSYSTEM=="usb" ACTION=="add" ATTR{product}=="MSP-FET430UIF JTAG Tool" \
  ATTR{bNumConfigurations}=="2" \
  RUN+="/bin/sh -c 'echo 2 > /sys%p/bConfigurationValue'"

Edit (27/03/2008): Things have changed even more. Now I use this rule (with udev 118):

SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="MSP-FET430UIF JTAG Tool", \
  ATTR{bNumConfigurations}=="2", ATTR{bConfigurationValue}="2"

Posted at 1:56 am on Friday 9th March 2007
One Comment

PWM Board Now Software Compatible

I just finished sorting out using the toolchain for the PWM board. Problem with the toolchain that I had was that the binutils I had installed (2.16) doesn’t support the MSP430F2013. After some searching around I found the patch I needed to apply to binutils in mspgcc CVS – and then managed to find a post about it on the mailing list.

Once the toolchain was built I ran a simple program that toggled the output pins continuously:

#include <msp430x20x3.h>

static int i = 0;

int main( void )
{
	WDTCTL = WDTHOLD | WDTPW;

	P1SEL = 0;
	P1DIR = 0xFF;

	while(1)
	{
		P1OUT ^= 0xFF;
	}
}

The program ran correctly, and the level translation between the MSP430 and the servo outputs worked nicely. Good. Only motor controller to go now, and then we’ll be living in a softwarey world. Ah yes – the TI USB UIF interface seems to be working perfectly in spy-bi-wire mode :-)

Posted at 1:37 am on Friday 9th March 2007

Site by Rob Gilton. © 2008 - 2019