Adding a serial console to the Raspberry Pi

I finally found some more time to do some more on the Raspberry Pi.  As part of a much bigger project I'm working on for this it looked like I'd need to rebuild the kernel to include and modify some drivers (which will take me way, way back into my past doing UNIX development at AT&T).  Knowing the way these things go I decided to prepare for the worst, i.e. a kernel that fails to boot properly.  To get as much information as possible it's always good to be able to see the boot messages direct and, after a bit of searching, I found that the kernel boot messages are all output to the serial port on the Raspberry Pi.

Serial ports can be a bit misunderstood since some people tend to use RS-232 and serial communication interchangeably which can lead to some serious disappointment (and cost).  RS-232 uses 12V whereas the UART (Universal Asynchronous Receive and Transmit) which generates the bits is either a 3.3V or 5V device (depending on the board design).  To have the UART on the Pi communicate with the serial port on my PC I would need a conversion circuit.  I've used this before when I did a demo using the WowWee RoboSapien where I had a Sun SPOT connected to the console of the robot via a serial connection.  The necessary circuit is shown below:

MAX3232 Circuit

Note that the 9-pin D-type connector is shown from the front, so you need to remember that when soldering the wires on.

The connections to the Raspberry Pi are made on the GPIO expansion header.  A diagram showing which pins are which can be found here.

Having tested the configuration on a breadboard (always a good idea) I made a small veroboard implementation.  The final result is shown here:

Raspberry Pi Serial Console

To communicate I use good old PuTTY.  The necessary settings are:

  • Speed: 115200 baud
  • Data bits: 8
  • Stop bits: 1
  • Parity: None
  • Flow control: None

Using this I can now see all of the boot messages (and won't lose them if the video were to stop for whatever reason) and I can login over this connection as an alternative to SSH.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

A blog covering aspects of Java SE, JavaFX and embedded Java that I find fun and interesting and want to share with other developers. As part of the Developer Outreach team at Oracle I write a lot of demo code and I use this blog to highlight useful tips and techniques I learn along the way.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today