Difference between revisions of "Add a Serial port to the MIPS Linkstation"
Davy gravy (Talk | contribs) (→Attach Header to the Board) |
|||
(24 intermediate revisions by 9 users not shown) | |||
Line 1: | Line 1: | ||
− | {{Template:Articles}}<center><font color=red>''Originally by frontalot and nix from linkstationwiki.org. | + | {{Template:Articles}}<center><font color=red>''Originally by frontalot and nix from linkstationwiki.org. LS2 specific details and photos by Kuroguy''</font></center> |
<br> | <br> | ||
<br> | <br> | ||
+ | |||
+ | [[Image:Ls2hacks2.JPG|right|thumb|320px|[[LS2]] homemade serial level converter on top of J1 and a red jumper at J2 to enable the serial console. Electrical tape on the back of the level converter prevents short circuiting the main board. (Also on the picture installed JTAG header and R64.)]] | ||
+ | [[Image:Ls2hacks3.JPG|right|thumb|320px|Serial port connector installed on the back of the LS2 below the red button.]] | ||
+ | ==Introduction== | ||
The console is the text output device for system administration messages. These messages come from the kernel, from the init system and from the system logger. On modern small computers the console is usually the computer's attached monitor and keyboard. The LinkStation, however, doesn't have monitor output; instead, it uses a serial connection for console output. Not only does the serial console provide valuable debugging output, it also allows root access! | The console is the text output device for system administration messages. These messages come from the kernel, from the init system and from the system logger. On modern small computers the console is usually the computer's attached monitor and keyboard. The LinkStation, however, doesn't have monitor output; instead, it uses a serial connection for console output. Not only does the serial console provide valuable debugging output, it also allows root access! | ||
+ | ==Background== | ||
+ | |||
+ | Most of the information on this page was originally only speculation, based on roughly deciphered information from a [http://translate.google.com/translate?hl=en&sl=ja&u=http://www.yamasita.jp/linkstation/BBS/2453.html&prev=/search%3Fq%3DHD-HLAN%2B(IENOBU)%26hl%3Den%26lr%3D%26c2coff%3D1%26sa%3DG Japanes web page]. At the end of 2006 the community bought a bricked LS2 and handed it over to [http://www.kurobox.com/mwiki/index.php/User:Dtaylor Tampakuro] aka Kuroguy for trying out various hardware modifications. While at it, kuroguy also verified the procedure for installing a serial console interface. This page has been updated with the information and photos he provided in [[Hardware Hacks for the LS2]]. | ||
== Prerequisites == | == Prerequisites == | ||
Line 9: | Line 16: | ||
* (1)Electronic-grade soldering iron (think really small) | * (1)Electronic-grade soldering iron (think really small) | ||
* (1) 0.015", 1 oz solder | * (1) 0.015", 1 oz solder | ||
− | * (1) 0.1” series PCB header plug, 4-pin | + | * (1) 0.1” series PCB header plug, 4-pin (for the serial port on J1) the 90-degree bend type is nice if you want to attach it on the back of the board |
− | * (1) Serial converter (or build your own - see [[Add a Serial port to the MIPS Linkstation# | + | * (1) 0.1” series PCB header plug, 2-pin (for the enabling jumper on J2) 90-degree also nice here, same as above |
+ | * (1) jumper for the header on J2 - the kind from an old IDE hdd is ideal | ||
+ | * (1) Serial converter (or build your own - see [[Add a Serial port to the MIPS Linkstation#The_Serial_Converter | step 4]]) | ||
− | + | == Access the Board == | |
− | == | + | |
* [[Articles/GeneralDisassemble | Disassemble the LinkStation]]. | * [[Articles/GeneralDisassemble | Disassemble the LinkStation]]. | ||
Line 20: | Line 28: | ||
− | == | + | == Attach Headers to the Board == |
+ | |||
+ | * The console header needs to be attached to the J1 pad, the jumper head to J2. | ||
+ | * Remove the preexisting solder from J1 and/or J2. Some boards have no solder in the holes. If they do, a solder wick or solder syringe are idea for this. | ||
+ | * If you are using angled/90-degree-bend headers, attaching them to the back/outside of the circuit board is ideal. | ||
+ | * Solder carefully and quickly to avoid board damage. | ||
+ | * If you are using the back-of-the-board placement, labeling the pins 1-4 w/ a marker saves you time in when it comes to hooking up your adapter. | ||
− | |||
− | |||
Line 46: | Line 58: | ||
|} | |} | ||
− | == | + | == Enable Full Serial Tx/Rx == |
− | To enable write support across the serial port, simply bridge R186. | + | <strike>To enable write support across the serial port, simply bridge R186.</strike> |
+ | Install R186 using a 330 ohm resistor. Simply bridging R186 will stop the microcontroller from sending data to the CPU. | ||
− | == | + | == The Serial Converter == |
− | + | {{Level Shifter}} | |
− | + | ||
− | + | ||
− | === | + | == Enabling the Serial Console == |
− | + | ===Hardware=== | |
− | + | ||
− | + | ||
− | + | As the LS2 only has a single serial port which is used by the housekeeping microcontroller, it is necessary to enable the serial console. This is done by jumpering the pins of J2 and disabling the watchdog timer on startup (by pressing the red button and powering it up). It is easiest to install J2 on the back of the board as it will be accessible by removing the cover and not the board from the chassis I used a red jumper so it can be easily located. Another option to removing the cover is to drill a 3/8" hole in the case directly above J2 and make a handle for your jumper from a piece of tape. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | Note that the jumper doesn't change the hardware configuration but its state can be read by the CPU using GPIO8 ("0" jumper on, "1" jumper off). The original Linux kernel registers the serial console if the jumper is on. | ||
− | + | ===Software=== | |
+ | Make sure that the distro you are booting actually has a some means to offer you a login window through the serial connection. A standard way of doing this would be to make sure that /etc/inittab has some line, perhaps at the end, like this: | ||
+ | T0:23:respawn:/sbin/getty -L ttyS0 57600 | ||
− | + | Also remember to switch output to the serial port with a bootargs statement such as : | |
+ | setenv bootargs console=ttyS0 root=/dev/hda1 rw | ||
+ | instead of the netconsole= option. | ||
+ | == Using the Serial Console == | ||
− | + | Of course you need a serial cable to connect to the serial port. Depending on how you wired the plug on the LS, you will need a null modem, too, or a null modem cable. | |
− | + | ||
− | + | ;Windows:You may access the serial console using Windows HyperTerminal (included with Windows) or [http://hp.vector.co.jp/authors/VA002416/teraterm.html TeraTerm Pro] terminal emulator. | |
+ | ;classic Unix:If you have a classic Unix you should either have '''tip'''(1) or '''cu'''(1) (or both). They are suitable to set up a serial connection. Linux typically doesn't have these. | ||
+ | ;Linux:If you are on Linux, consider the trusted and tried [http://alioth.debian.org/projects/minicom/ miniterm] terminal emulator. 'minicom' also works nicely. | ||
+ | ;Terminal:If you are the proud owner of a real oldschool terminal, this is your chance to make use of the old dust catcher :-) | ||
− | |||
===Serial Port Settings=== | ===Serial Port Settings=== | ||
{| style="background:Gainsboro;border-collapse:collapse;border:solid 1px black" | {| style="background:Gainsboro;border-collapse:collapse;border:solid 1px black" | ||
Line 111: | Line 122: | ||
[[Category:LS2]] | [[Category:LS2]] | ||
− | |||
[[Category:Hardware]] | [[Category:Hardware]] | ||
[[Category:Howto]] | [[Category:Howto]] |
Latest revision as of 01:30, 16 September 2008
Contents
Introduction
The console is the text output device for system administration messages. These messages come from the kernel, from the init system and from the system logger. On modern small computers the console is usually the computer's attached monitor and keyboard. The LinkStation, however, doesn't have monitor output; instead, it uses a serial connection for console output. Not only does the serial console provide valuable debugging output, it also allows root access!
Background
Most of the information on this page was originally only speculation, based on roughly deciphered information from a Japanes web page. At the end of 2006 the community bought a bricked LS2 and handed it over to Tampakuro aka Kuroguy for trying out various hardware modifications. While at it, kuroguy also verified the procedure for installing a serial console interface. This page has been updated with the information and photos he provided in Hardware Hacks for the LS2.
Prerequisites
- (1)Electronic-grade soldering iron (think really small)
- (1) 0.015", 1 oz solder
- (1) 0.1” series PCB header plug, 4-pin (for the serial port on J1) the 90-degree bend type is nice if you want to attach it on the back of the board
- (1) 0.1” series PCB header plug, 2-pin (for the enabling jumper on J2) 90-degree also nice here, same as above
- (1) jumper for the header on J2 - the kind from an old IDE hdd is ideal
- (1) Serial converter (or build your own - see step 4)
Access the Board
- Disassemble the LinkStation.
- Remove the main circuit board by removing the 4 mounting screws:
- Place the circuit board on a static-free work area:
Attach Headers to the Board
- The console header needs to be attached to the J1 pad, the jumper head to J2.
- Remove the preexisting solder from J1 and/or J2. Some boards have no solder in the holes. If they do, a solder wick or solder syringe are idea for this.
- If you are using angled/90-degree-bend headers, attaching them to the back/outside of the circuit board is ideal.
- Solder carefully and quickly to avoid board damage.
- If you are using the back-of-the-board placement, labeling the pins 1-4 w/ a marker saves you time in when it comes to hooking up your adapter.
J1 Pinout
Pin | Signal |
1 | Transmit (TX) |
2 | Receive (RX) |
3 | Power (3.3V)* |
4 | Ground (GND) |
Enable Full Serial Tx/Rx
To enable write support across the serial port, simply bridge R186.
Install R186 using a 330 ohm resistor. Simply bridging R186 will stop the microcontroller from sending data to the CPU.
The Serial Converter
The serial port signals from the processor are only 3.3V. For proper RS-232 12V signaling, an RS-232 level shifter needs to be added. These are very common in PDA serial cables also, but can be purchased
Build your own LVTTL/RS232 or LVTTL/USB interface
- LVTTL/RS232 - Building a Custom Serial Interface
- LVTTL/USB - Use a Nokia Serial Cable on an ARM9 Linkstation
- LVTTL/USB - Use a cheap phone sync cable with the serial port
Buy your own TTL Level Shifter
- LVTTL/RS232 - MAX232 based from Futurelec - MINIRS2323V
- LVTTL/USB - FTDI chip based cable - TTL-232R-3V3
Usage considerations for the TTL-232R-3V3
|
A working/tested pinout/wire-color scheme is:
|
- Solder the 4-pin header to the board. Make sure you don't have shorts.
- You will need to switch wires on the TTL-232R-3V3 cable. Use a sharp object to lift the plastic tabs and carefully pull the wires out. Rearrange them according to the table above (black, empty, orange, yellow, empty, empty) and slide those wires back in. Tape the other wires to make sure they don't short anything.
- When plugging in the cable, make sure black aligns with GND, yellow with TXD, and orange with RXD.
- Connect the USB cable to your computer, start a terminal program with the right settings.
- Turn on the device, you should see output from the bootloader in couple seconds.
Enabling the Serial Console
Hardware
As the LS2 only has a single serial port which is used by the housekeeping microcontroller, it is necessary to enable the serial console. This is done by jumpering the pins of J2 and disabling the watchdog timer on startup (by pressing the red button and powering it up). It is easiest to install J2 on the back of the board as it will be accessible by removing the cover and not the board from the chassis I used a red jumper so it can be easily located. Another option to removing the cover is to drill a 3/8" hole in the case directly above J2 and make a handle for your jumper from a piece of tape.
Note that the jumper doesn't change the hardware configuration but its state can be read by the CPU using GPIO8 ("0" jumper on, "1" jumper off). The original Linux kernel registers the serial console if the jumper is on.
Software
Make sure that the distro you are booting actually has a some means to offer you a login window through the serial connection. A standard way of doing this would be to make sure that /etc/inittab has some line, perhaps at the end, like this:
T0:23:respawn:/sbin/getty -L ttyS0 57600
Also remember to switch output to the serial port with a bootargs statement such as :
setenv bootargs console=ttyS0 root=/dev/hda1 rw
instead of the netconsole= option.
Using the Serial Console
Of course you need a serial cable to connect to the serial port. Depending on how you wired the plug on the LS, you will need a null modem, too, or a null modem cable.
- Windows
- You may access the serial console using Windows HyperTerminal (included with Windows) or TeraTerm Pro terminal emulator.
- classic Unix
- If you have a classic Unix you should either have tip(1) or cu(1) (or both). They are suitable to set up a serial connection. Linux typically doesn't have these.
- Linux
- If you are on Linux, consider the trusted and tried miniterm terminal emulator. 'minicom' also works nicely.
- Terminal
- If you are the proud owner of a real oldschool terminal, this is your chance to make use of the old dust catcher :-)
Serial Port Settings
Data | Settings |
Baudrate | 57600 |
Data bits | 8 |
Stop bits | 1 |
Parity | None |
Flow Control | None |