Under certain circumstances the backchannel USB-serial link to the MSP430 LaunchPad board will stop communicating, and the link will remain in this "frozen" state until the LaunchPad board is unplugged and replugged. I searched the MSP forum here, but couldn't find any specific description of the problem ( I realize this proves nothing <grin!> ), so I'm posting as complete a description of it as I can.
Here's one way of reproducing the problem, using a fresh-out-of-the-box LaunchPad v1.5 with its MSP430G2553 pre-programmed with the Temperature Measurement Demo Application.
- Plug the LaunchPad v1.5 board into a USB port on the host. You should see LED0 on steady and LEDs 1 and 2 blinking on and off alternately.
-
Verify that the ttyACM0 device has been created:
frank@bagheera:~$ ls /dev/ttyA*
/dev/ttyACM0 - Set the host device to expect characters at 2400 Baud:
stty 2400 -F /dev/ttyACM0 - Prepare to accept data from the LaunchPad:
cat /dev/ttyACM0
You should not see any output yet. - Press LaunchPad button S2 (next to LEDs 1&1, blinking). You should now see LEDs 1&2 go out, and a paced sequence of uppercase ASCII letters generated by the G2553 and representing temperature measurements appearing in the terminal window on the
host, something like the following:
EEEEFEFFFEEEEEFFFEFEFEEFFFFFFFFF... (continues indefinitely) - So far, this is the expected behavior of the program. However, if you interrupt the reception of the data by pressing Ctl-C and then attempt to restart it you see an error:
frank@bagheera:~$ cat /dev/ttyACM0 (step 4 above)
EEEEFEFFFEEEEEFFFEFEFEEFFFFFFFFF^C (output from step 5)
frank@bagheera:~$ cat /dev/ttyACM0 (attempted continuation)
cat: /dev/ttyACM0: Input/output error (Whoops!)
This condition appears to persist until the LaunchPad is unplugged and replugged. In particular, pressing the LaunchPad RESET button (S1)
does not clear the condition, indicating that the problem is either in the host driver or the LaunchPad firmware (e.g. the TUSB3410 USB
interface chip).
This forum post describes it as a driver problem:
Linux Serial Driver for the Launchpad Bugs
http://forum.43oh.com/topic/935-linux-serial-driver-for-the-launchpad-bugs/
but I'm not sure I agree. I reproduced the problem on an embedded Linux system (OpenWrt), then unloaded and reloaded the ti_usb_3410_5052 driver using rmmod and insmod. This did not clear the error condition, which makes me suspect that it might be a TUSB3410 firmware problem.
Here's another wrinkle: It turns out that you can prevent the "freeze" by resetting the G2553 before interrupting the host side of the serial link. That is, when the Demo program is running properly and characters are appearing at the host (step 5 above), the following steps do work:
- Press RESET (S1). LEDs 1&2 resume blinking
- Press Ctl-C on the host, interrupting the 'cat' operation
- Issue another 'cat /dev/ttyACM0' command
- Press S2. LEDs 1&2 go out and characters appear on the host.
Removing and replacing the LaunchPad J3 VCC jumper and replacing it does not clear the problem.
I attempted to reset the /dev/ttyACM0 device using a Linux utility called 'usb_modeswitch':
usb_modeswitch -R -v 0x0451 -p 0xf432
but only succeeded in making /dev/ttyACM0 disappear. Fortunately, unplugging and replugging the LaunchPad brought it back. <grin!>
Assuming that I'm correct, that this problem is a result of the TUSB3410 chip not liking output-to-host characters that no one ever picks up (TUSB3410 internal buffer overrun?), dropping power to the LaunchPad would be likely to clear the problem. The following forum post offers hints on how this might be done, but I was unable to get any visible results on my Dell D630 laptop (Ubuntu 10.04.4 LTS). In any case, I would put it in the "Kids, don't try this at home" category:
Linux USB: turning the power on and off?
http://stackoverflow.com/questions/1163824/linux-usb-turning-the-power-on-and-off
Can anyone offer a method for recovering from this problem which does not require unplugging and replugging the LaunchPad?
Is there any chance that this problem is related to the intermittent "host serial port locks up" problems which other users and I have experienced with the MSP430 LaunchPad in the past?
Any hints, clues, and observations will be appreciated.
Frank McKenney
--
Human beings feel an instinctive urge to ally with the wise, the
generous, the benevolent, and the righteous. Caring people wish to
stand against the brutal, the unfeeling, and the rapacious. We
_feel_ better by constructing alliances with moral individuals or by
linking ourselves with apparently moral qualities, but that's not
always the same as being effective in achieving our desired
practical ends.
-- Tyler Cowen / An Economist Gets Lunch
--