MSP430.DLL v3 Linux patches
===========================

Daniel Beer <dlbeer@gmail.com>
16 Dec 2011

This patch series modifies the MSP430.DLL source package from Texas
Instruments so that it can be compiled and used on Linux systems.

To build, you will first need the following tools and libraries:

  - g++
  - make
  - quilt
  - libboost (including development headers)

Obtain the archive (slac460.zip) from:

    http://processors.wiki.ti.com/index.php/MSP_Debug_Stack

Or for a direct link:

    http://www-s.ti.com/sc/techzip/slac460.zip

Unpack and patch the sources:

    unzip slac460.zip
    tar xvfz /path/to/slac460-linux-patches-YYYYMMDD.tar.gz
    cd MSP430.DLLv3_OS_Package
    quilt push -a

Then build with "make". This will take a while, and you'll be left with
a binary file named "libmsp430.so". You can either copy it to /usr/lib
(or any other directory in your loader path) or specify the path of the
containing directory by prepending the mspdebug command line with an
appropriate value of LD_LIBRARY_PATH like so:

   LD_LIBRARY_PATH=/path/to/MSP430.DLLv3_OS_Package mspdebug ...

After plugging in FET running V3 firmware, you should end up with a
device file called /dev/ttyACM0 or similar. Connect to it as follows:

    mspdebug tilib -d /dev/ttyACM0

Note that the library requires a matching version of firmware, and may
need to update your FET firmware. By default, this won't happen, and
you'll instead see an error message. If you need to update your FET
firmware, use the following command-line option:

    mspdebug tilib -d /dev/ttyACM0 --allow-fw-update

Note that you may see the following error when you run for the first
time:

    MSP430_Initialize: /dev/ttyACM0
    firmware system error 8004

If this happens, just press Ctrl+\ to kill mspdebug and try again.

License for patches
-------------------

Copyright 2011 Daniel Beer <dlbeer@gmail.com>. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in
      the documentation and/or other materials provided with the
      distribution.

THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
