Adding a JTAG connector to MBED

MBED is cool, but without ability to step through your code with a real debugger it may be very difficult to troubleshoot some programs. While thinking of the problem, it occurred to me that it is possible to add a JTAG connector to MBED. It can be done so that the existing MBED functionality is not affected while the JTAG is unplugged, and once plugged, JTAG can take over the control from the MBED's MBED chip (the little guy that provides USB connection).

The JTAG connector I chose is a standard ARM 20-pin 0.100" connector compatible with J-Link http://shop-us.segger.com/J_Link_EDU_p/8.08.90.htm and other emulators/debuggers.

Connector pinout and wiring is the following:

pinsignalconnect to(Wire color on the pictures)
15nSRSTIC6.17(WHT) + 10k Ohm resistor to +3.3V
19DBGACK/ V5-supply(NC)
20GNDIC1.57/R9/C5 (IF_N_RST)(YEL)

IC1 is the MBED chip

IC6 is LPC1768 chip

+3.3V and GND is convenient to pick up on a bypass cap next to IC6 on top side

All magic of the connector operation happens by wiring connector's pin 20 to MBED chip's reset. Once JTAG is plugged in, MBED chip is kept in reset by shorting pin 57 to ground.

One modification is required - remove R2 (10k) on the backside.

YOU WILL NEED A MICROSCOPE! and very thin wires and steady hands besides a sharp tip solder iron, fine tweezers and some solder & flux.

I chose to solder an SMT connector to a piece of breadboard and glue the breadboard (Loctite) to the top of the LPC1768 chip (after soldering +3.3V & GND wires to the bypass cap). Then solder wires to connector pins, and carefully solder other ends to the pins of IC6/LPC1768 (that's where you need a microscope and fine tweezers). Note that there is a pullup resistor on nSRST which replaces removed pulldown R2 resistor. I placed a 0402 SMT resistor on connector pin and then bridged +3.3V wire across it on the way to the other pin.

Other thoughts

The 20-pin 0.100" connector is quite large and protrudes from MBED board. It is possible to cut off sides of black plastic so it is flush with the board. It is also possible to adapt one of smaller connectors, but for me it requires an adapter, so it is less convenient.


Top view:/media/uploads/iva2k/mbed-jtag-top.jpg
Top view / angle to JTAG signal wires:/media/uploads/iva2k/mbed-jtag-top-angle1a.jpg
Top view / angle to GND pins:/media/uploads/iva2k/mbed-jtag-top-angle2.jpg
Bottom view / angle to IF_N_RST wire:/media/uploads/iva2k/mbed-jtag-bot.jpg
Bottom view / angle to the removed resistor R2 (note it is simply moved to one of two pads - saved for later):/media/uploads/iva2k/mbed-jtag-bot-angle2.jpg

6 comments on JTAG:

14 Aug 2011

This is super. Last year, I went half way through this and then got stuck with disconnecting the MBED magic chip. The idea of putting it in reset is brilliant !

Thanks for posting. I'm going to try this tomorrow.


14 Aug 2011

Very nice!

So how you plan to use it?

Regards, Stas

16 Aug 2011

This is very cool! Great work and thanks for sharing!

16 Aug 2011

Brilliant! Some ninja soldering. Thanks for taking the time to post this!

11 Sep 2011

will this make it into the next version.

12 Sep 2011

Maybe someone from the MBED team can answer that: It would be a great idea to include some JTAG provision on the board.

The best I can think of is using a footprint for this zero-parts method: TC2050 from http://www.tag-connect.com/ (they have TC2050-ARM2010 adapter specifically for ARM, also needs TC2050-IDC cable) - it requires very little space and may be possible to include into the existing board design with some tweaks. Also, it looks like hooking it up to reset the mbed chip when connected can be done since there are two ground pins in the footprint.

Next best would be providing some test points you could solder to, instead of the chip pins. Test points can be scattered where possible.

Please log in to post comments.