This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problem with MSP430 LaunchPad backchannel USB-serial link

Other Parts Discussed in Thread: MSP430G2553, TUSB3410, MSP430F1611, UNIFLASH


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.

  1. 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.
  2. Verify that the ttyACM0 device has been created:
        frank@bagheera:~$ ls /dev/ttyA*
        /dev/ttyACM0

  3. Set the host device to expect characters at 2400 Baud:
        stty 2400 -F /dev/ttyACM0
  4. Prepare to accept data from the LaunchPad:
        cat /dev/ttyACM0
    You should not see any output yet.
  5. 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)
  6. 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
--



  • I have exactly the same issue on my Kubuntu 13.04 and have no idea on how to get rid of it. Alternatively I use the Unitek Y-105 USB-to-RS232 converter (seen as /dev/ttyUSBn) and it works perfectly.

    This article https://www.rfc1149.net/blog/2013/03/05/what-is-the-difference-between-devttyusbx-and-devttyacmx/ explains the difference between ttyUSBn and ttyACMn and additionally the comment below it suggests what the problem is:
    "[...]the device shows up as ttyACM0 and the PC tries sending AT+ commands for about a minute after my device connects."

    So I guess that renaming the ttyACM0 with udev should fix the problem, not checked yet though...

  • Frank McKenney said:
    ...
    Can anyone offer a method for recovering from this problem which does not require unplugging and replugging the LaunchPad?

    Have you tried to reset the MSP430F1611 chip on the upper part of the board?

  • Frank McKenney said:
    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 never heard of this, but it seems that interupting the transfer somehow breaks the serial port on the Linux side. Maybe when interrupting cat, ttyACM0 is still in use and therefore the next call of cat cannot access it - until the device vanishes (which will break the original usage) and reappears.

    Like an open file that you cannot access if an app did have it open (for write) and crashed.

    I bet it will happen with any kind of serial device, not just with the LaunchPad.

    Frank McKenney said:
        frank@bagheera:~$ cat /dev/ttyACM0         (attempted continuation)

    Well, not really a continuation, but a start of a new program that reads from the port.

  • I wonder how you guy use TI utilities like Uniflash on  Linux....it always looks for ttyUSBx and NOt for ttyACMx

    any hint?

  • Frank McKenney said:

    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.
    <SNIP>
    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!>

    I'm running a Forth compiler (noforth) on the board, with a communication program written in Forth on Linux Debian stable.

    This means total control! I can ask the Launchpad to generate primes till 10,000 and then disconnect, i.e.

    not reading the output, and close the  filedescriptor. This is a surefire way to hang up the device forcing a powercycle.

    Attempts to flush the device (so using the communication driver to program around problems in the 3410) also meets with problems, I see a defect in the select system call. (A return before the timeout with no devices activated.) The communication program sees no data for 5 seconds, so it thinks it can safely close the connection. However, it draws that conclusion before 5 seconds have passed, go figure.

    It is no wonder that it is flaky. There are independant defects in the 3410, the linux driver and also in the software that generates entries in the /dev directory. It keeps deleting and regenerating the /dev/ttyACM0 device, which should not happen, whatever the state of the device.

    The problem lies, of course, with usb, which is one big design error if you ask me. Humans can't make usb work.

    Groetjes Albert

**Attention** This is a public forum