Nexus 5 UART Cable
A serial console can be obtained from the phone through the headphone jack and requires building a custom cable that converts between the different voltage levels found on the PC and the phone.
- USB to TTL Serial Cable
- SparkFun Solder-able Breadboard - Mini
- SparkFun TRRS 3.5mm Jack Breakout
- Audio Cable TRRS - 1ft
- 3 x 1K resistors to make a voltage divider to convert the 3.3V TX output from the USB serial cable to 1.8V for the RX pin on the phone.
- 3.3V 250mA Linear Voltage Regulator - L4931-3.3 TO-92 to convert the 5-5.2V from the PC to a fixed 3.3V.
- 2 x 10 uF capacitors for the input and output on the voltage regulator.
Pin mapping and voltages
|5V||Voltage Regulator||TIP (3.3V)|
|TX (3.3V)||Voltage Divider||Ring 1 (RX 1.8V)|
|RX||Ring 2 (TX 1.8V)|
Version 1 of my cable used a voltage divider for the 3.3V on the tip of the headphone jack, however I moved to the 3.3V voltage regulator because the USB-C on my laptop puts out 5.2V, and the USB-A puts out 5.0V. The phone expects close to 3.3V on the tip pin in order to enable the serial console on startup and this slight voltage difference was enough to cause the serial console to not work.
Booting the phone
With the phone off, plug the cable in, and start the phone with the volume-down and power buttons pressed simultaneously to boot into the phone’s bootloader. The following messages will come through over the serial cable:
welcome to hammerhead bootloader  Power on reason 10  DDR: elpida  Loaded IMGDATA at 0x11000000  Display Init: Start  MDP GDSC already enabled  bpp 24  Config MIPI_CMD_PANEL.  display panel: ORISE  display panel: Default setting  Turn on MIPI_CMD_PANEL.  Display Init: Done  cable type from shared memory: 8  vibe  USB init ept @ 0xf96b000  secured device: 1  fastboot_init()  splash: fastboot_op FASTBOOT MODE PRODUCT_NAME - hammerhead VARIANT - hammerhead D820(E) 16GB HW VERSION - rev_11 BOOTLOADER VERSION - HHZ20h BASEBAND VERSION - M8974A-22.214.171.124.29 CARRIER INFO - None SERIAL NUMBER - XXX SIGNING - production SECURE BOOT - enabled LOCK STATE - unlocked  splash: start  Fastboot mode started  udc_start()  -- reset --  -- portchange --  -- reset --  -- portchange --  fastboot: processing commands
You can use the minicom package to access the serial console. Here’s my ~/.minirc.dfl file:
pu port /dev/ttyUSB0 pu rtscts No