Introduction: JTAGulating the Raspberry Pi 2

This instructable will cover how to get a root recovery console on a Raspberry Pi 2 with a NOOBS SD card using a Jtagulator, PuTTY, and three wires. It is thanks to the Instructables Raspberry Pi Build Night sponsored by Instructables and the Rabbit Hole.

What you will need:

@whixr

Step 1: Wiring Up

  • [Pic 1] Place your fresh NOOBS SD card into the sd card reader on your Raspberry Pi 2.
  • [Pic 2] Connect wires to the GND (Pin 1), CH0 (Pin 2), and CH1 (Pin 4) pins on the first header of your Jtagulator

  • [Pic 3] Connect the other ends of these wires to GND (Pin 6), GPIO14 TXD (Pin 8), and GPIO15 RXD (Pin 10) on your Raspberry Pi 2 GPIO header.

    Make sure to use the same wire for both GND connections, the order of the other two are not quite as important, as you will soon see.

Step 2: Setting Up the Session

Connect your Jtagulator to a USB port on your local computer and open your favorite terminal software. For the purpose of this tutorial, I am using PuTTY on a Windows machine.

  • On the PuTTY 'Session' settings:
  • Change 'Connection Type' to Serial

  • Change 'Speed' to 115200

  • Change 'Serial line' to which ever serial port your Jtagulator was picked up on. In my case, this was COM12. If you don't know how to find out which serial port a device is on, there are many guides online for your particular operating system.

Step 3: Optional Echo

  • Click "Terminal' on the 'Category' treeview on the left side of the PuTTY Configuration dialog.
  • Change the Line Discipline option 'Local Echo' to 'Force on'.
  • The Jtagulator doesn't echo back the characters we are going to send it. To make things a little easier to see we can enable a local echo for the next few steps so we can see what we are doing.

Step 4: Jtagulator Setup

Click the 'Open' button on the PuTTY Configuration dialog

  • Jtagulator greets you with a very helpful blank screen. [Pic 1]
  • Hit the H key then Enter [Pic 2]

Ah, there we go! A command list. We start by setting the target system voltage. [Pic 3]

  • Hit the V key then Enter. Type 3.3 then Enter

Now our JTagulator is set up to use the same voltages that the Raspberry Pi 2 uses.

Step 5: Finding the UART

Remember when I said the order of the two non-ground wires didn't matter? One of the features of the Jtagulator is that it can attempt all possible uart wiring and speed permutations to discover a serial port by brute force.

  • Hit the U key and Enter to 'Identify UART Pinout'
  • Hit Enter again to select the default [CR] (carriage return) as the test string that the Jtagulator will send out on each permutation.
  • Hit 2 and Enter to select 2 as the number of channels to use. [Pic 1]

If we didn't know which pins on the Raspberry Pi 2 were our serial port, we could use more channel / more wires here to scan more possibilities. You get the idea.

  • Hit the spacebar [Pic 2]

Here is the last part of all of the text the Jtagulator has sent us while scanning for a UART. As you scroll through them all, take a look at the 'Data:' In my example here, the only one that spit out anything that looks human readable is the last one.

TXD: 0 RXD: 1 Baud: 115200 Data: ..Password: [ same in hex ]

From this we can tell that if we set our Jtagulator to use Channel 0 as TX and Channel 1 as RX at a speed of 115200 baud - we get some kind of login prompt from the Raspberry Pi 2

Step 6: Passing Through

  • [Pic 1]

  • Hit P then Enter to set up serial pass through mode
  • Hit 0 then Enter to set the TX channel to Channel 0
  • Hit 1 then Enter to set the RX channel to Channel 1
  • Type 115200 to set the baud rate to 115200

We are now interacting directly with the serial port on the Raspberry Pi 2

  • Remove and replace the Raspberry Pi 2's power cord to reboot the Raspberry Pi 2 [Pic 2]

We see the Linux Kernel booting up and a recovery console login prompt!

Step 7: EEcchhoo OOffff

Unlike the Jtagulator, the Raspberry Pi 2 terminal will echo back everything we type. To make it easier to see what we are doing I am going to turn off the local echo. [Pic 1]

  • Right click the icon in the upper left hand corner of the PuTTY window
  • Click 'Change Settings' [Pic 2]
  • Click 'Terminal' in the treeview on the left hand side of the PuTTY configuration dialog
  • Change the line discipline option for 'Local Echo' to 'Auto'
  • Click the 'Apply' button

Step 8: Logging In

The default login for the NOOBS recovery console is root:raspberry so

  • Type root and enter at the 'recovery login:' prompt
  • Type raspberry and enter at the 'Password:' prompt

Step 9: Recovery

You are in!

Here I have issued a few simple commands showing that this is indeed a fully functional shell.

Pretty awesome! No SD card funny business, and we never connected a keyboard, mouse, monitor, or even a network cable to our Raspberry Pi 2!

Comments

author
SeanS17 (author)2015-07-30

I was just wondering how I could get the pi to work by by passing the sd card. i thought why did they do that. I dont think it was on purpose either. I think it was just an oversight.

author
MikB (author)2015-05-23

@gada888 It's not really "rooting" the PI (as in crowbarring in new illicit firmware, like you would to certain smartphones/game consoles :) but getting access to a log in -- as root (superuser account), or "pi" or whatever user you want really. A console on a serial TTY is just as useful as a console on a keyboard/monitor.

Your use of "rooting" it is more modern than the Unix use of "root" :)

author
tankapotamus (author)MikB2015-06-30

@MikB rooting on a smartphone is the same thing, just gaining "superuser'' on Android. It isn't adding illicit software, "superuser" is required to add certain 3d party software, that may be illicit. Same thing pretty much, just bastardized by Google for Android.

author
TranceCat (author)2015-06-23

why use Jtagulator for such a trivial thing? ft232 or cp2102 or any other serial-to-USB will work the same. And there's a catch – this will work if ttyAMA0 is spawned. It just won't work if serial is used for communication with peripherals.

author
gada888 (author)2015-05-19

Thanks for sharing,why you want to root the Raspberry PI 2.

author
Tymkrs (author)gada8882015-05-20

Pretty much for any reason why you would want to be root.

About This Instructable

10,275views

72favorites

License:

Bio: Every week two geeky people in Rochester MN spend every ounce of their freetime creating educational videos, podcasts, articles, and music. They publish it all ... More »
More by Tymkrs:Telecom Time MachineTelecom Time Machine Seamstress Desk
Add instructable to: