PostHeaderIcon MSP430G2211: Why the Two-Wire Debug Port Fails on Real Boards

The two-wire debug interface is one of the better decisions in this family’s design. It puts a full debug connection on two pins, which is what makes it possible to fit a debug port on a board with fourteen usable pins.

The cost is that both clock and data travel on the same pair, and the protocol distinguishes them by the state of one line when the other transitions. Anything that degrades an edge therefore corrupts both signals at once. On a development kit this never shows. On a product board with a long trace, a decoupling capacitor placed for a different reason, and a supplier’s pull resistor, it fails often enough to be worth understanding.

How the protocol uses two wires

One line is the reset, the other is the test pin. Outside a debug session the reset line does what its name says and the test pin is a general-purpose input.

When a session begins, the tool holds the reset line in its active state and drives the test pin through a specific sequence. From that point the roles change: transitions on the reset line become clock edges, and the state of the test pin at each edge is the data bit. The device distinguishes a clock from a data bit by which line moved.

Line Outside a session During a session
Reset Resets the device Clock
Test General-purpose input, sampled at boot Data, sampled on each clock edge

That dual role is why the test pin’s external circuit matters more than its schematic suggests. Anything attached to it is attached to the data line of a synchronous interface.

The three electrical failures

In practice the failures cluster into three causes, and they are distinguishable by their symptoms.

Capacitance on the test pin. A capacitor placed for noise immunity, or a long trace with a ground plane nearby, forms an RC with the pull resistor. The rising edge becomes a curve, and the sampling instant at the far end of the curve is where the bit is read. Symptoms: intermittent failures that change with temperature and with the length of the cable to the tool.

Pull resistor value. Too weak and the line does not return to its idle level between bits; too strong and the tool cannot drive it against the pull within the edge. Symptoms: works with a short cable, fails with a long one, or works at low speed only.

Supply impedance. The interface has no separate reference, so both lines are interpreted relative to the device’s own supply. A supply that moves during the session moves the thresholds with it. Symptoms: failures correlated with the device doing work, or with another part of the board switching.

Diagnosing which one you have

The symptoms overlap enough that guessing is unproductive. Three measurements separate them.

  1. Scope the test pin during an attempted connection. A clean square wave means the problem is elsewhere; a rounded or slow edge means capacitance or a weak pull.
  2. Measure the supply at the device pins during the session, not at the connector. Any movement is a supply problem regardless of what else is found.
  3. Reduce the interface speed if the tool allows it. A connection that succeeds at a lower speed is a timing margin problem, which points at the first two causes rather than the third.

The first measurement is the one that ends the argument. A connection that fails with a visible edge problem is an electrical problem, and no amount of retrying or software configuration will change it.

What to do about each

For capacitance, the fix is removal or isolation: lift the capacitor, cut the trace, or connect the tool at the device pin rather than at a header.

For the pull resistor, the fix depends on the direction. A pull that is too strong for the tool to drive has to be increased; a pull that is too weak to restore the idle level has to be decreased. Both are one-resistor changes and both are worth trying before concluding that the device is protected.

For supply impedance, the fix is a local reservoir close to the device and, where possible, powering the board from a bench supply during the session instead of from its own converter.

Why this matters before anything else

Every one of those failures produces the same message from the tool: cannot connect. And cannot connect is the same message a protected device produces, because protection does not announce itself either.

The order of work on an unknown board is therefore electrical first, logical second. Confirm the interface works on a device known to be open — a new part on the same board, or the same board with a replacement device — and only then interpret a failure as protection.

Skipping that step leads to the most expensive error in this work: concluding that a device is locked when it is merely badly connected, and proceeding to a destructive method to deal with a capacitor.

When the interface works and the device is still closed

If the connection is clean and the device reports that access is denied, the electrical question is settled and the protection question begins. On this family that is a single state with a single meaning, which is a relief after the ambiguity of the electrical diagnosis.

At that point the options are the ones that do not require the debug interface: the bootstrap loader if it exists and its password can be derived, or a physical route. The behaviour of the device under its own program remains observable throughout, and on a small part that behaviour is often enough to reconstruct what it does.

Related reading

FAQ

Can the test pin be used as an input in the product? Yes, and that is exactly why something is usually attached to it.

Does a slower interface speed help? It increases margin, which is diagnostic as well as useful.

Is a failed connection evidence of protection? No. It is evidence of a failed connection until the electrical layer is excluded.

Can the debug interface be disabled in software? The pin can be reused, and the protection state can block access, but the interface itself remains.

Conclusion

The two-wire port is robust in the lab and marginal on a board, because both signals share two pins and everything attached to those pins is in the timing path. Scope the test pin, measure the supply at the device, and try a slower speed. Establish that the interface works before concluding that the device is closed.

Comments are closed.