Recover a broken FET on the MSP430F5529 Launchpad after CCS crashes during firmware update

The Issue

CCS crashed during MSP430F5529 Launchpad firmware update (precisely the eZ-FET lite), leaving the launchpad unrecognizable by the operating system (Ubuntu 14.04). When plugged in, /dev/ttyACM0 and /dev/ttyACM1 do not appear.

fafaliel@justitia:~$ mspdebug tilib
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

tilib: can't find libmsp430.so: libmsp430.so: cannot open shared object file: No such file or directory

The solution

Step 1: Install mspdebug

Install mspdebug (from Ubuntu repositories or from the sources https://github.com/dlbeer/mspdebug )

From Ubuntu repositories

sudo apt-get install msp430-libc binutils-msp430 msp430mcu mspdebug

From the latest sources

git clone https://github.com/dlbeer/mspdebug.git
make
sudo make install

NB: One may have to enable the USB header files  (sudo apt-get install libusb-dev)

Step 2: Obtain TI MSP430 library

The next step is to acquire TI MSP430 library libmsp430.so. We will reuse the one in Energia distribution.

Donwload Energia at http://energia.nu/download/

Extract libmsp430.so to /tmp

sudo cp /tmp/libmsp430.so /usr/lib

Step 3: update the firmware

fafaliel@justitia:~$ sudo mspdebug tilib --allow-fw-update
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: HID_FET
MSP430_Initialize: HID_FET
FET firmware update is required.
Starting firmware update (this may take some time)...
Initializing bootloader...
Programming new firmware...
     0 percent done
    34 percent done
    67 percent done
   100 percent done
Update complete
Done, finishing...
MSP430_VCC: 3000 mV
tilib: MSP430_VCC: Internal error (error = 68)
tilib: device initialization failed

At this point, the corresponding devices /dev/ttyACM should be available.

Repeat the previous step (Notice the change in the behaviour)

fafaliel@justitia:~$ sudo mspdebug tilib --allow-fw-update
MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
FET firmware update is required.
Starting firmware update (this may take some time)...
Initializing bootloader...
Programming new firmware...
     4 percent done
     4 percent done
     4 percent done
     4 percent done
     4 percent done
     4 percent done
     4 percent done
    20 percent done
    20 percent done
    20 percent done
    20 percent done
    20 percent done
    36 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    52 percent done
    68 percent done
    84 percent done
    84 percent done
    84 percent done
    84 percent done
    84 percent done
   100 percent done
Update complete
Done, finishing...
MSP430_VCC: 3000 mV
MSP430_OpenDevice
MSP430_GetFoundDevice
Device: MSP430F5529 (id = 0x0030)
8 breakpoints available
MSP430_EEM_Init
Chip ID data: 55 29 18

Available commands:
    =           erase       isearch     power       save_raw    simio       
    alias       exit        load        prog        set         step        
    break       fill        load_raw    read        setbreak    sym         
    cgraph      gdb         md          regs        setwatch    verify      
    delbreak    help        mw          reset       setwatch_r  verify_raw  
    dis         hexout      opt         run         setwatch_w  

Available options:
    color                       gdb_loop                    
    enable_bsl_access           gdbc_xfer_size              
    enable_locked_flash_access  iradix                      
    fet_block_size              quiet                       
    gdb_default_port            

Type "help <topic>" for more information.
Use the "opt" command ("help opt") to set options.
Press Ctrl+D to quit.

(mspdebug) 

Step 4: Test the recovered launchpad

Create a file blink.c

#include <msp430.h>
 
main()
{
  unsigned int i = 0;
  P1DIR = 1;
 
  while(1)
  {
    P1OUT = 1;
    for (i=0; i < 65535; i++);
    P1OUT = 0;
    for (i=0; i < 65535; i++);
  }
}

 msp430-gcc -mmcu=msp430f5529 -mdisable-watchdog blink.c

Program the chip with mspdebug

sudo mspdebug tilib
(mspdebug) prog a.out

or 

(mspdebug) prog path/to/binary/binary

Run the debugger

(mspdebug) run

or 

(mspdebug) step

 

Smile and wink at the blink, your launchpad is back to life.

 

Startup Growth Lite is a free theme, contributed to the Drupal Community by More than Themes.