Tutorial: setting up mspdebug on Windows

We have released an open-source successor to MSPDebug for Windows: msp430-gdbproxy++. It is based on the officially supported MSP430.DLL and supports hardware, software and data breakpoints. Download it now.

This tutorial shows how to setup the MSPDebug program on Windows and start debugging your MSP430 firmware with gdb.

  1. Download MSPDebug for Windows or build it from sources yourself.
  2. Ensure that you have the msp430 toolchain. If not, download and install it
  3. Build your MSP430 project with the msp430 toolchain. If you don't have a project at hand, follow this tutorial to create one. Here we refer to the built project as firmware.elf.
  4. Test mspdebug with the built-in simulator. This will ensure that the connection between mspdebug and gdb is working before we try it on the actual hardware:
    • First, start simulating your firmware with mspdebug by running this command:
      mspdebug sim "prog firmware.elf" gdb
      Do not forget to quote "prog firmware.elf". Otherwise mspdebug won't start.
    • Then, run gdb:
      msp430-gdb firmware.elf
    • When you started mspdebug, it has reported that it's listening on port 2000 for a connection from GDB. Let's connect gdb to port 2000, set a breakpoint in main and start the app by entering the following commands in the GDB window:
      target remote localhost:2000
      break main
      continue
  5. Exit gdb by typing "quit".
  6. Now we'll use mspdebug to debug an actual msp430 microcontroller over USB. To do it we should prepare a libusb driver and install it. However, first we need to determine the target name, vendor ID and product ID of your on-chip debugger. You can find them out from the table below:
    On-chip debugger Target name Vendor ID Product ID
    eZ430-RF2500 devices rf2500 0x0451 0xf432
    Olimex MSP-JTAG-TINY olimex 0x15ba 0x0002/0x0031
    Olimex MSP-JTAG-TINY olimex-v1 0x15ba 0x0002/0x0031
    Olimex MSP-JTAG-ISO olimex-iso 0x15ba 0x0008
    TI FET430UIF and compatible devices (e.g. eZ430) uif 0x0451 0xf430
  7. Open the usbtools directory inside the directory where you have unpacked mspdebug:
  8. Start the inf-wizard.exe executable:
  9. Select the corresponding device from the list. If you are not sure which device to use, run "mspdebug <your target name>" and look for the "unable to find a device matching xxxx:yyyy" messages. The xxxx and yyyy numbers from those messages correspond to Vendor ID/Product ID of the device you need to select.
    Do not select MSP430 Application UART! If you don't see the "Debug-Interface" option, search for the line containing Vendor ID/Product ID from the table above specifying interface 1.
  10. Verify once again that the Vendor ID and Product ID are correct:
  11.  Save the INF file in your documents folder. Then, click "Install Now" in the final window.
  12. Now we'll test mspdebug with your actual on-chip debugger. Start mspdebug specifying your target name instead of "sim". E.g.:
    mspdebug rf2500 "prog firmware.elf" gdb
    Before running mspdebug ensure that the previous instance has exited. Otherwise it won't be able to open a connection for GDB.
  13. Run GDB the same way as you did with the simulator:
    msp430-gdb firmware.elf
  14. Connect gdb to mspdebug by typing the same commands as with the simulator:
    target remote localhost:2000
    break main
    continue
  15. Now you can debug your MSP430 firmware with gdb. If you want to use Visual Studio as a front-end for your debugging, try VisualGDB. Here's a tutorial on building msp430 firmware with Visual Studio.