Monday 12 February 2018

Pixel Debug Cable

Hacking around with building your own Android / AOSP system images can lead to difficult to debug problems during early boot.  

Fortunately, the Pixel XL (and several other Nexus and Pixel devices) includes a serial debug port that uses the pins on the headphone jack.  It’s possible to get early debug output (from the boot loader and kernel) by issuing a special fastboot command, and connecting a simple serial adapter.



To build one, you’ll need to following components:

At a minimum, you’ll need a 3.3V FTDI board and TRRS jack, but I included the jumper wires and shrink wrap for tidiness sake.

Below is a simple Fritzing diagram that should make everything abundantly clear.


Note that the colors of the wires in the TRRS cable do not necessarily match the colors on the digram above (ie. black is most likely not ground). You should check the wires with a multimeter before connecting them to the serial board.

To enable the serial console, you’ll need to have unlocked the bootloader, have the device in fastboot mode, and issue the following fastboot command:

fastboot oem uart enable

You can then connect to the serial console at 115200, 8N1 (with no flow control), though this may depend on the device.

Enjoy!


Notes:
  • This worked for me on a Pixel XL running bootloader version 8996-012001-1709121620 
  • Credit to jmcnicol for his original post:  http://people.redhat.com/jmcnicol/nexus_debug/
  • I’ve heard a rumour that most Nexus and Pixel devices support a serial console on the headphone jack
  • I have not been able to enable the serial console on the N5X itself, the boot loader version may have changed
  • The fastboot OEM commands are boot loader dependant and may change without warning.  The commands seem to vary between devices
  • Please comment below if you managed to get this working on other devices



No comments :

Post a Comment