Home - grumat/glossy-msp430 GitHub Wiki

Glossy MSP430 - Lightning Fast GDB Debug

The Glossy MSP430 GDB Debugger is a conceptually based on the Black Magic Probe used for ARM. It is a modern, in-application debugging tool for embedded MSP430 microprocessors, as a alternative to the TI MSP-FET. It allows you see what is going on 'inside' an application running on an Texas Instruments MSP430 microprocessor while it executes. It is able to control and examine the state of the target microprocessor using a JTAG or Spy-Bi-Wire (SBW) port and on-chip debug logic provided by the microprocessor. The probe connects to a host computer using a standard USB interface. The user is able to control exactly what happens using the GNU source level debugging software, GDB.

Note that MSP-FETs are kind of sluggish. Basically it is host-based and thus the emulation hardware performs very simple operations at every USB request. So, to perform a simple debug operation it requires lots of ins and outs flowing in the USB bus. Then you add the fact that USB is a half-duplex implementation and more a more painful fact, the driver system on a Windows machine is based on a stack of drivers forming a huge set of layers between the user application and the hardware device.
This means that efficient USB on a Windows machine can only be accomplished when transferring really huge packets (>= 256KB), the opposite of what a debugger operation requires. As an example, for a simple request as a "step into", only a couple of chars are transferred between the GDB and the middleware (say gdbproxy++), but this middleware needs to interact to the MSP430.dll a lot more. In PC side is not a real trouble as PCs are powerful, but each request on the MSP430.dll converts to lots of USB interaction sending small packets in and out, to accomplish the initial request. Then the sluggishness is established.

With the GDB protocol embedded in the emulation unit, al the knowledge is embedded into an ARM processor, which quickly interacts with the attached MCU. Even if you use this approach trough a standard RS-232C port (which is not the case!!!) it will outperform the MSP-FET (note that the JTAG 10 MHz is strictly followed in the Glossy MSP430).

This project is not related to the ARM edition. It source code is a complete different approach, even programming language. Also MSP430 uses a partial JTAG implementation. The name was kept because of the concept behind the tool: Open source and hardware and GDB as the debugging software.

Features

  • Targets MSP430 microprocessor and variants, covering all released families.
  • Connects to the target processor using the JTAG or Spy-Bi-Wire Debug (SWD) interface.
  • Provides full debugging functionality, including: flash memory breakpoints, memory and register examination, flash memory programming, etc.
  • Interface to the host computer is a standard USB CDC ACM device (virtual serial port), which does not require special drivers on Linux or OS X (TBD).
  • Implements the GDB extended remote debugging protocol for seamless integration with the GNU debugger and other GNU development tools.
  • Implements USB DFU class for easy firmware upgrade as updates become available (TBD).
  • Works with Windows, Linux and Mac environments.
  • Embeds a database containing almost 500 family devices, with programming parameters, such as memory addresses and flash timing for a seamless compatibility.

The Glossy MSP430 allows you to

  • Load your application into the target Flash memory or RAM.
  • Single step through your program.
  • Run your program in real-time and halt on demand.
  • Examine and modify CPU registers and memory.
  • Obtain a call stack backtrace.
  • Set up to 8 hardware assisted breakpoints (depends on device).

Supported Targets

SLAU049 - MSP430x1xx Family

  • MSP430F11x1, MSP430F11x1A and MSP430F11x2.
  • MSP430F12x and MSP430F12x2.
  • MSP430F133 and MSP430F135.
  • MSP430F147, MSP430F148 and MSP430F149.
  • MSP430F155, MSP430F156 and MSP430F157.
  • MSP430F1610, MSP430F1611, MSP430F1612, MSP430F167, MSP430F168, and MSP430F169.

SLAU056 - MSP430x4xx Family

  • MSP430F4132, MSP430F4152 and MSP430F41x.
  • MSP430F423, MSP430F4230, MSP430F423A, MSP430F425, MSP430F4250, MSP430F425A, MSP430F427, MSP430F427A and MSP430F42x0.
  • MSP430F43x.
  • MSP430F44x.
  • MSP430F47126, MSP430F47127, MSP430F47163, MSP430F47166, MSP430F47167, MSP430F47173, MSP430F47176, MSP430F47177, MSP430F47183, MSP430F47186, MSP430F47187, MSP430F47193, MSP430F47196, MSP430F47197, MSP430F477, MSP430F478, MSP430F4783, MSP430F4784, MSP430F479, MSP430F4793 and MSP430F4794.
  • MSP430FE423, MSP430FE4232, MSP430FE423A, MSP430FE425, MSP430FE425A, MSP430FE427, MSP430FE4272, MSP430FE427A and MSP430FE42x2.
  • MSP430FG4250 and MSP430FG42x0.
  • MSP430FG43x.
  • MSP430FG4616, MSP430FG4617, MSP430FG4618 and MSP430FG4619.
  • MSP430FG477, MSP430FG478 and MSP430FG479.
  • MSP430FW429 and MSP430FW42x.

SLAU144 - MSP430x2xx Family

  • MSP430F20x1, MSP430G2x0x, MSP430G2x1x, MSP430F20x2, MSP430G2x2x, MSP430F20x3 and MSP430G2x3x.
  • MSP430AFE220, MSP430AFE221, MSP430AFE222, MSP430AFE223, MSP430AFE230, MSP430AFE231, MSP430AFE232, MSP430AFE233, MSP430AFE250, MSP430AFE251, MSP430AFE252 and MSP430AFE253.
  • MSP430F2112, MSP430F2122, MSP430F2132, MSP430F21x1.
  • MSP430F2232, MSP430F2234, MSP430F2252, MSP430F2254, MSP430F2272, MSP430F2274.
  • MSP430F233, MSP430F2330, MSP430F235, MSP430F2350, MSP430F2370,
  • MSP430F2410, MSP430F2416, MSP430F2417, MSP430F2418, MSP430F2419, MSP430F247, MSP430F2471, MSP430F248, MSP430F2481, MSP430F249 and MSP430F2491.
  • MSP430F2616, MSP430F2617, MSP430F2618 and MSP430F2619.
  • MSP430G2444, MSP430G2544, MSP430G2744 and MSP430G2x55, MSP430G2xx2 and MSP430G2xx3.
  • MSP430TCH5E.

SLAU208 - MSP430x5xx and MSP430x6xx Family

  • MSP430F5131, MSP430F5132, MSP430F5151, MSP430F5152, MSP430F5171 and MSP430F5172.
  • MSP430F5212, MSP430F5213, MSP430F5214, MSP430F5217, MSP430F5218, MSP430F5219, MSP430F5222, MSP430F5223, MSP430F5224, MSP430F5227, MSP430F5228, MSP430F5229, MSP430F5232, MSP430F5234, MSP430F5237, MSP430F5239, MSP430F5242, MSP430F5244, MSP430F5247, MSP430F5249, MSP430F5252, MSP430F5253, MSP430F5254, MSP430F5255, MSP430F5256, MSP430F5257, MSP430F5258 and MSP430F5259.
  • MSP430F5304, MSP430F5308, MSP430F5309, MSP430F5310, MSP430F5324, MSP430F5325, MSP430F5326, MSP430F5327, MSP430F5328, MSP430F5329, MSP430F5333, MSP430F5335, MSP430F5336, MSP430F5338, MSP430F5340, MSP430F5341, MSP430F5342, MSP430F5358 and MSP430F5359.
  • MSP430F5418, MSP430F5418A, MSP430F5419, MSP430F5419A, MSP430F5435, MSP430F5435A, MSP430F5436, MSP430F5436A, MSP430F5437, MSP430F5437A, MSP430F5438 and MSP430F5438A.
  • MSP430F5500, MSP430F5501, MSP430F5502, MSP430F5503, MSP430F5504, MSP430F5505, MSP430F5506, MSP430F5507, MSP430F5508, MSP430F5509, MSP430F5510, MSP430F5513, MSP430F5514, MSP430F5515, MSP430F5517, MSP430F5519, MSP430F5521, MSP430F5522, MSP430F5524, MSP430F5525, MSP430F5526, MSP430F5527, MSP430F5528, MSP430F5529.
  • MSP430F5630, MSP430F5631, MSP430F5632, MSP430F5633, MSP430F5634, MSP430F5635, MSP430F5636, MSP430F5637, MSP430F5638, MSP430F5658 and MSP430F5659.
  • MSP430F6433, MSP430F6435, MSP430F6436, MSP430F6438, MSP430F6458 and MSP430F6459.
  • MSP430F6630, MSP430F6631, MSP430F6632, MSP430F6633, MSP430F6634, MSP430F6635, MSP430F6636, MSP430F6637, MSP430F6638, MSP430F6658 and MSP430F6659.
  • MSP430F6720, MSP430F6720A, MSP430F6721, MSP430F6721A, MSP430F6722, MSP430F6723, MSP430F6723A, MSP430F6724, MSP430F6724A, MSP430F6725, MSP430F6725A, MSP430F6726, MSP430F6726A, MSP430F6730, MSP430F6730A, MSP430F6731, MSP430F6731A, MSP430F6732, MSP430F6733, MSP430F6733A, MSP430F6734, MSP430F6734A, MSP430F6735, MSP430F6735A, MSP430F6736, MSP430F6736A, MSP430F6745, MSP430F67451, MSP430F67451A, MSP430F6745A, MSP430F6746, MSP430F67461, MSP430F67461A, MSP430F6746A, MSP430F6747, MSP430F67471, MSP430F67471A, MSP430F6747A, MSP430F6748, MSP430F67481, MSP430F67481A, MSP430F6748A, MSP430F6749, MSP430F67491, MSP430F67491A, MSP430F6749A, MSP430F67621, MSP430F67621A, MSP430F67641, MSP430F67641A, MSP430F6765, MSP430F67651, MSP430F67651A, MSP430F6765A, MSP430F6766, MSP430F67661, MSP430F67661A, MSP430F6766A, MSP430F6767, MSP430F67671, MSP430F67671A, MSP430F6767A, MSP430F6768, MSP430F67681, MSP430F67681A, MSP430F6768A, MSP430F6769, MSP430F67691, MSP430F67691A, MSP430F6769A, MSP430F6775, MSP430F67751, MSP430F67751A, MSP430F6775A, MSP430F6776, MSP430F67761, MSP430F67761A, MSP430F6776A, MSP430F6777, MSP430F67771, MSP430F67771A, MSP430F6777A, MSP430F6778, MSP430F67781, MSP430F67781A, MSP430F6778A, MSP430F6779, MSP430F67791, MSP430F67791A and MSP430F6779A.
  • MSP430FG6425, MSP430FG6426, MSP430FG6625, MSP430FG6626 and MSP430SL5438A.

SLAU259 - CC430 Family

  • CC430F5123, CC430F5125, CC430F5133, CC430F5135, CC430F5137, CC430F5143, CC430F5145 and CC430F5147.
  • CC430F6125, CC430F6126, CC430F6127, CC430F6135, CC430F6137, CC430F6143, CC430F6145 and CC430F6147.

SLAU272 - MSP430FR57xx Family

  • MSP430FR5720, MSP430FR5721, MSP430FR5722, MSP430FR5723, MSP430FR5724, MSP430FR5725, MSP430FR5726, MSP430FR5727, MSP430FR5728, MSP430FR5729, MSP430FR5730, MSP430FR5731, MSP430FR5732, MSP430FR5733, MSP430FR5734, MSP430FR5735, MSP430FR5736, MSP430FR5737, MSP430FR5738 and MSP430FR5739.

SLAU321 - MSP430x09x Family

  • MSP430C092 and MSP430L092.

SLAU335 - MSP430i2xx Family

  • MSP430I204x, MSP430I203x and MSP430I202x.

SLAU367 - MSP430FR58xx, MSP430FR59xx, and MSP430FR6xx Family

  • MSP430FR5041, MSP430FR5043 and MSP430FR50431.
  • MSP430FR5847, MSP430FR5848, MSP430FR5849, MSP430FR5857, MSP430FR5858, MSP430FR5859, MSP430FR5867, MSP430FR5868, MSP430FR5869, MSP430FR5870, MSP430FR5872, MSP430FR5887, MSP430FR5888 and MSP430FR5889.
  • MSP430FR5922, MSP430FR5929, MSP430FR5947, MSP430FR5948, MSP430FR5949, MSP430FR5957, MSP430FR5958, MSP430FR5959, MSP430FR5962, MSP430FR5964, MSP430FR5967, MSP430FR5968, MSP430FR5969, MSP430FR5970, MSP430FR5972, MSP430FR5986, MSP430FR5987, MSP430FR5988, MSP430FR5989, MSP430FR5992, MSP430FR5994 and MSP430FR59941.
  • MSP430FR6005, MSP430FR6007, MSP430FR6035, MSP430FR6037, MSP430FR60371, MSP430FR6041, MSP430FR6043, MSP430FR60431, MSP430FR6045, MSP430FR6047 and MSP430FR60471.
  • MSP430FR6820, MSP430FR6822, MSP430FR6870, MSP430FR6872, MSP430FR6877, MSP430FR6879, MSP430FR6887, MSP430FR6888 and MSP430FR6889.
  • MSP430FR6920, MSP430FR6922, MSP430FR6927, MSP430FR6928, MSP430FR6970, MSP430FR6972, MSP430FR6977, MSP430FR6979, MSP430FR6987, MSP430FR6988 and MSP430FR6989.

SLAU445 - MSP430FR4xx and MSP430FR2xx family

  • MSP430FR2000, MSP430FR2032 and MSP430FR2033.
  • MSP430FR2100, MSP430FR2110, MSP430FR2111, MSP430FR2153 and MSP430FR2155.
  • MSP430FR2310, MSP430FR2311, MSP430FR2353 and MSP430FR2355.
  • MSP430FR2422, MSP430FR2433, MSP430FR2475 and MSP430FR2476.
  • MSP430FR2512, MSP430FR2522, MSP430FR2532 and MSP430FR2533.
  • MSP430FR2632, MSP430FR2633, MSP430FR2672, MSP430FR2673, MSP430FR2675 and MSP430FR2676.
  • MSP430FR4131, MSP430FR4132 and MSP430FR4133.

SLAU506 - RF430FRL15xH Family

  • RF430F5144, RF430F5155 and RF430F5175.
  • RF430FRL152H, RF430FRL153H and RF430FRL154H.

Getting Hardware

There are some options where to apply the Glossy MSP430 firmware.

The STM32F103 Blue-Pill

By far the easiest way to test the project is to create a prototype using the Blue-Pill. A simple board design with this option is available in the repository. This version is so simple that one can do using a proto-board or some raster PCB board available on your favorite hobby store.

BluePill-BMP.png

This option is simple and will be enough to drive a target using a fixed voltage of 3.3V, which may not an ideal solution for projects having another requirement.

Just try the Blue-Pill variant and if you are satisfied with the results, jump into a professional looking solution. Firmware are exactly the same.

But the repository also features two interesting alternatives.

The ST-Link Form Factor

The first alternative is a complete setup, having a JTAG port and a separate UART port for the interface to the target MCU. Besides this, it has an exact form factor to replace a ST-Link clone, so you can buy a typical ST-Link on AliExpress or so, remove the bottom sticker to have access to the screws and replace the internal PCB by a new Glossy MSP-430 board. What I've done on this case, I send the PCB gerber files to JLCPCB, which manufactured them, including components soldering. I just needed to solder the through-hole connectors and a had a nice professional looking JTAG emulator.

This is a picture of the first prototype using the form factor:

stlink-open-fs8.png

If you are skilled with the SMD soldering, you can DIY and reduce costs at a very attractive level, far less than a new MSP-FET.

Except for the ST branding and all the plastic inscription, these is definitely the nicest solution. When reassembling all parts together, it should look like this:

stlink-closed-fs8.png

The Baite Form Factor

The second alternative with a more compact look is the Baite form-factor. The Baite form-factor is also an easy to find option on Amazon, eBay or Ali-Express.

It is used for AtMega ICPs and also for ST-Link clones for conventional ARM parts. These are typically made from green plastic where you find the Baite-Logo on the bottom side:

baite-logo-fs8.png

This option is also very nice looking. For this to work, I had to change the concept a bit.

The ATMega/ARM versions comes with a 10 pin connector with a custom pin-out. But I wanted a standard TI 14-pin solution.
To fit the standard TI 14-pin JTAG connector, I've decided to move the connector to the outer border of the plastic case and a perfect fit was achieved.

One problem with this modified concept is that the 10 pin connector is also used to keep the PCB mechanically stable. This means that moving the connector to the outer border of the case, mechanical stability was a compromise.

To overcome this problem I've spend much time shaping the PCB so that edges fits the internal mechanical stops found on the case to provide robustness and stability. As I received the final prototype I was very proud of the final result: the PCB does not moved inside.

baite-open-fs8.png

This form factor resembles an USB flash drive, but a bit larger. Note that because of space constraints this option does not offer a separate UART port, which is not a problem if you are happy with the two UART pins located on the standard TI JTAG connector.

This is how it looks like:

baite-closed-fs8.png

Other Hardware to run the Glossy MSP430 debugger

It is planned to make a firmware variant compatible with ST-Link clones, which are also quick solutions, but has the disadvantage that all JTAG I/O is performed using bit-banging, instead of SPI. SPI signals are far more stable and produces better results. Although still not on my top priorities, I am researching a solution to implement using bit banging with an acceptable quality and programmable speed as an alternative to the SPI approach. Firmware currently implements a Timer+DMA cooperation for TCLK generation. Some improvements can be done on that approach to achieve this.

The second disadvantage is that ST-Link Clones can only operate with 3.3V.
Most MSP430 solutions reduces supply voltage since power consumption gains are significant. So this is not the ideal option.