« »

MSP430 LaunchPad in Ubuntu

November
15
member
sucotronic

There are a few sites with info about how to use the TI’s Launchpad platform in linux, but none of them worked for me, but mixing them I’ve got a functional development enviroment in my ubuntu box.

These are the steps I’ve done to compile and burn program into the microcontroller:

  1. Install required packages:

    sudo aptitude install git-core gcc-4.4 texinfo patch libncurses5-dev zlibc zlib1g-dev libx11-dev libusb-dev libreadline6-dev

  2. Download and compile mspgcc:

    git clone git://mspgcc4.git.sourceforge.net/gitroot/mspgcc4/mspgcc4
    cd mspgcc4
    sudo sh buildgcc.sh

    Press enter to use the default answers when the scripts ask you. Only write yes when it ask “Do you want to start build right now? (y/n) [n] ” because the default is no.

  3. Download and compile mspdebug:

    wget -O mspdebug.tar.gz http://sourceforge.net/projects/mspdebug/files/latest
    tar -zxvf mspdebug.tar.gz
    cd mspdebug
    make
    sudo make install

  4. Create a udev rule to be able to use the usb debug shield

    sudo nano /etc/udev/rules.d/46-TI_launchpad.rules

    Now paste inside the following rule:

    ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0660", GROUP="plugdev"
    

    Restart the udev service:

    sudo restart udev

  5. Create a file named led.c and paste the following:
    /* Blink LED example */
    
    #include <msp430g2231.h>
    
    /** Delay function. **/
    delay(unsigned int d) {
      int i;
      for (i = 0; i<d; i++) {
        nop();
      }
    }
    
    int main(void) {
      WDTCTL = WDTPW | WDTHOLD;
      P1DIR = 0xFF;
      P1OUT = 0x01;
    
      for (;;) {
        P1OUT = ~P1OUT;
        delay(0x4fff);
      }
    }
    

    The include is wrong, but will do the trick for the example.

  6. Compile the source code and create de elf file data to be uploaded to the chip:

    /opt/msp430-gcc-4.4.5/bin/msp430-gcc -Os -mmcu=msp430x2231 -o led.elf led.c

  7. Connect the platform to the pc and upload the program to chip:

    mspdebug rf2500
    prog led.elf
    run

  8. Now you have to see red and green lights blinking alternatively. Let’s try to do your own changes to the code and create awesome projects!

Sources: hackaday.com and mylightswitch.

Updated 18/11/2010: thanks to hvontres I’ve changed the retrieval of th mspgcc4 code and now it download the latest version from git. Indeed it has support for the microcontrollers that come with the Launchpad, so I also changed the sample code to include the correct header and the compilation command.
Updated 28/05/2011: thanks to Andrew I’ve changed the mspdebug download link to always download the latest release.


date Posted on: Monday, November 15, 2010 at 20:57 pm
Category electrónica.
Puedes seguir las respuestas de esta entrada a traves de l feed RSS 2.0.

Puedes dejar una respuesta, o trackback desde tu propio sitio.



56 Respuestas to “MSP430 LaunchPad in Ubuntu”

  1. BrEin

    @sucotronic,
    OK, thank, that’s cool.

    Another (very similar) question. Are you familiar with eclipse, more with CCS5 (Code Composer Studio)?
    It is an IDE, provided by TI which works with an eclipse installation. As I know it has already the MSP430-GCC compiler in the toolchain.

    I have it installed twice. One time under Windows, one time under Linux on the same machine. I can run and debug it under Windows without any problem. But my preferred system is Linux (LinuxMINT and Ubuntu). I can use and run CCS under Linux but when I what to debug an error appears as follows:
    ___
    Error initializing emulator:
    No USB FET was found
    ___
    I skipped the part with the MSP430-GCC and carried on with the other points of your instruction which worked, but the problem is still the same.

    Even MSPDEBUG cannot find any device and I don’t no why.

    Do you have any hint for me?

    Thank you
    Fabian

    [Responder]

    June 3rd, 2012 at 19:59 pm
     
  2. Cross-Compiling for TI MSP430 Launchpad | MitchTech

    […] by this […]

    June 23rd, 2012 at 14:03 pm
     
  3. MSP-GCC 编译器安装与使用小记 « andy的linux小屋

    […] MSP430 LaunchPad in Ubuntu MSP430 LaunchPad on Linux […]

    July 19th, 2012 at 12:55 pm
     
  4. lexi

    Hi guys, thanks for the tutorial it works for me, everything awesome.
    BUTTTTTTTTT:
    Anybody managed to get the VCP working in Ubuntu 12.04 to get UART chars from the board??
    It works on older kernels, Windows and even on my OSX I managed it.
    But in Ubuntu 12.04 I always get I/O errors… are the usb-chip drivers not fit for kernel 3.2?

    sudo cat /dev/ttyACM0
    cat: /dev/ttyACM0: Input/output error

    minicom gives
    minicom: cannot open /dev/ttyACM0: No such file or directory

    screen is more or less the same…

    anybody managed to get it running?
    thanks!

    [Responder]

    sucotronic Reply:

    @lexi, sorry, currently I don’t have any machine with ubuntu 12.04 to try it; what I only can say is that in 10.04 it’s possible to get characters through ACM0

    [Responder]

    August 15th, 2012 at 12:37 pm
     
  5. CoffeeBreak Tutorial #1 : Setting up Ubuntu 12.04LTS 64bit to say hi to MSP430 | Indian Tinker

    […] Sometimes you may also need to add a udev rule so that the system can identify the msp430 launchpad.Follow this […]

    February 17th, 2014 at 15:50 pm
     

Escribe un comentario


a trastear un poco is powered by WordPress
Theme is Coded&Designed by Wordpress Themes at ricdes