Wednesday, May 7, 2014

A Low Cost JTAG Debugger for the Raspberry Pi

Setting up the MiniMod FT2232H For JTAG Debugging on a Raspberry Pi

The MiniMod FT2232H is an evaluation module for the FTDI FT2232H USB interface part. This part can be used to bridge a number of embedded interfaces to USB. There are many JTAG debugger interfaces that are implemented using this chip.
For this setup, we will use the low cost MiniMod, some jumper wires, and the OpenOCD software to provide JTAG debug interface to the Raspberry Pi.
The JTAG interface, along with the Open Source OpenOCD software can be used to load and debug the Raspberry Pi from your development machine. In addition to the JTAG, the MiniMod can be used to provide the UART interface for the Raspberry Pi UART, all through the same USB connection to the PC! This is an inexpensive solution too. I bought my FT2232H MiniMod for $20.00 USD.
Tip I was able to get this all working thanks to the amazing work of David Welch. David’s github site has all of the information about JTAG debuggers on the Raspberry Pi. Many of the setup instructions here are similar to David’s although I had to adjust the pinouts slightly for the FT2232H module.

Caution When you work on your Pi hardware, make sure it is not plugged in to power first! Also, be sure to avoid static electricity when working with your Pi and the MiniModule.

Collect the parts you need :

You will need the following
  1. FT2232H MiniMod. I found mine on ebay for $20 USD.
  2. A pack of jumper wires. You could also wire up a Pi GPIO header so you can easily remove the debug setup.
  3. A USB cable to connect the MiniModule to your development computer.
When looking at the MiniMod connector pins facing you, this is how the pins are numbered:

2 1
4 3
6 5
8 7
10 9
12 11
14 13
16 15
18 17
20 19
22 21
24 23
26 25

The Pins on the pi are reversed: Pin 1 is at the bottom since we are looking at the bottom of the connector on the MiniMod and the Top of the connector on the Pi:


A view of the Pins on the MiniMod:

The Pins on the Raspberry Pi:

Wire up the MiniMod module to the Pi :

We need to connect 10 of these jumper wires between the Pi GPIO header and the FT2232H MiniMod. The following tables guide you through the connections you need to make. Some of the connections will go from one pin to another pin on the same connector:
Raspberry Pi to Raspberry Pi Connections:
Pin number on Pi Pin Number on Pi
1 15

Minimod Connector 2 (CN2) to Minimod Connector 2 Connections:
Pin number on MiniMod CN2 Pin Number on MiniMod CN2
1 11

Minimod Connector 3 (CN3) to Minimod Connector 3 Connections:
Pin number on MiniMod CN3 Pin Number on MiniMod CN3
1 3

Minimod Connector 3 (CN3) to The Raspberry Pi Connections:
Pin number on MiniMod CN3 Pin Number on Pi
25 8
26 10

Minimod Connector 2 (CN2) to The Raspberry Pi Connections:
Pin number on MiniMod CN2 Pin Number on Pi
2 6
7 22
9 18
10 7
12 13

When you are finished, it should look something like this:

Next, we are going to get the MiniMod working as the UART and JTAG interface for your Pi!

Thursday, May 1, 2014

Starting up Pi/RTEMS development again, updates on the way!

Coming soon to a Pi near you

I have finally started to get back into my RTEMS Raspberry Pi development. I have a few updates that I will try to get on here soon:

  • I have updated my development environment to Ubuntu 14.04 LTS

  • I have been experimenting with alternative ways of loading the RTEMS code (u-boot, jtag). I will document how to set up a TFTP based network boot for RTEMS images.

  • I purchased and set up a very inexpensive JTAG solution for the Pi. I will document how this all works.

  • I am going to mentor a Google Summer of Code student this summer to add peripheral support to the RTEMS Raspberry Pi BSP

So, stay tuned!