Jump to content

Serial debugging/Cable schematics: Difference between revisions

From postmarketOS Wiki
Intgr (talk | contribs)
Sony Xperia: There are no longer two separate pages, just one link
m typo
 
(59 intermediate revisions by 25 users not shown)
Line 1: Line 1:
Some phones have a serial port accessible from the outside, this makes debugging boot problems way easier since you can see the boot messages from the bootloader and the early kernel stuff. For example the whole nexus range has serial debugging through the headphone jack.
{{Subpages|Serial debugging}}
 
This page contains schematics for serial cables, as well as device support tables and basic build instructions. For more information about serial debugging, visit the [[Serial debugging]] page.
<!--Note to editors: if you're adding a new debug cable design/schematic for a particular device, put it at the bottom of the page. If it's a design for multiple devices or a series of devices, put it under the SuzyQ cable.-->
 
== microUSB/Carkit debug cable ==
 
Many devices with microUSB ports have the serial port multiplexed with the micro/mini USB connector, initially implemented as part of [[Micro-USB_Interface_Controller|carkit standard]]. The Replicant project has a [https://redmine.replicant.us/projects/replicant/wiki/SamsungSerial page dedicated to serial on Galaxy Nexus] using this cable.
 
[[File:Nexus-usb-debug.png|border|700px]]
 
NOTE: "TX" and "RX" on this image refer to the TX and RX pins on your UART board.
 
Note that some devices and [[MUIC|MUICs]] require a resistor with a different resistance than 150KΩ. '''To find the correct resistor value''', check your device's wiki page, the [[MUIC]] page or follow the guide in [[Serial_debugging#Finding_the_UART_ports_on_your_device|Serial debugging#Finding the UART ports on your device]].
 
{{note|'''Tip:''' If you don't have the exact resistor you need for the cable, you can combine multiple similar resistors (for example 3 56kΩ for ~150kΩ). MUICs typically have a small margin of error where they'll still detect the correct resistance and switch to the right mode even if the value is a bit off.}}


== Nexus debug cable ==
== Nexus debug cable ==


The nexus phones multiplexed the serial debug lines with the headphone audio lines. To switch it into serial mode you have to supply -3V to the mic port. The UART lines themselves are 1.8V. If you use a 3.3V usb-to-uart adapter the signal from the phone will probably work, for the TX side you have to add a resistor divider to lower the voltage for the phone. Here's the schematic for a nexus debug cable:
Some Nexus phones, as well as the first Pixel phone generation, multiplexed the serial debug lines with the headphone audio lines. To switch it into serial mode you have to supply -3V to the mic port. The UART lines themselves are 1.8V. If you use a 3.3V usb-to-uart adapter the signal from the phone will probably work, for the TX side you have to add a resistor divider to lower the voltage for the phone. Here's the schematic for a Nexus debug cable:


[[File:Nexus-debug-cable.png]]
[[File:Nexus-debug-cable.png]]
Line 9: Line 24:
This cable has been tested with:
This cable has been tested with:


* Nexus 5 (hammerhead)
* [[Google Nexus 5 (lg-hammerhead)]]
* Nexus 5X (bullhead)
* [[Google Nexus 5X (lg-bullhead)]]
* Pixel (sailfish)
* [[Google Nexus 6P (huawei-angler)]]
* Nexus 9 (flounder)
* [[Google Nexus 7 2013 (asus-flo)]]
* [[Google Nexus 6 (motorola-shamu)]]
* [[Google Pixel (google-pixel)]]
* [[Google Nexus 9 (htc-flounder)]]
* [[Google Nexus 10 (samsung-manta)]]


It should work fine with:
Some LG devices also support this debug cable:
* [[LG G5 (lg-h850)]]


* Nexus 7 2013 (flo)
The Nexus 7 2012 (grouper) does not work with this setup and likely does not have any serial UART capabilities at all unless you connect to unpopulated pads on board.
 
The Nexus 7 2012 (grouper) does not work with this setup and likely does not have any serial UART capabilities at all.


Google open sourced their own [https://android.googlesource.com/device/google/debugcable/+/master debug cable design] in the AOSP repository.
Google open sourced their own [https://android.googlesource.com/device/google/debugcable/+/master debug cable design] in the AOSP repository.
Line 24: Line 42:
NT: You will have a better luck with FTDI based serial cable.
NT: You will have a better luck with FTDI based serial cable.


== USB debug cable ==
It is unknown if it can work with the A-series Pixel devices. These claims are unsubstantiated, and they are already known to use the "cereal" debugging cable scheme. See: [[Serial_debugging:Cable_schematics#Google_Pixel_.22Android_Debug_Cable.22|Google Pixel "Android Debug Cable"]].
 
* Google Pixel 3a and 3a XL (sargo/bonito)
* Google Pixel 4a (sunfish)
* Google Pixel 4a 5G (bramble)
 
== Mediatek USB debug cable ==
 
Some Mediatek devices expose an 3.3V UART interface at the USB port when a special Mediatek debug cable is attached to the device while booting.
 
The schematic for this debug cable is the same as the Nexus USB debug cable above, except that the ID pin shouldn't be connected.
 
== Suzy-Q debug cable ==
 
The Suzy-Q debug cable isn't strictly a serial debug cable, it accesses the Closed Case Debugging system, it can access multiple busses on the device. Details for the Closed Case Debugging system can be found at
https://chromium.googlesource.com/chromiumos/platform/ec/+/cr50_stab/docs/case_closed_debugging.md
 
{{todo|The usb type-c receptacle pinout is wrong(B8 is SBU2 B5 is CC2, no RFU1), see https://en.wikipedia.org/wiki/USB-C}}
[[File:suzyq-debug-cable.png|600x600px]]
 
The official SuzyQable from Google has an 2 port USB hub into the cable itself, one port connects to the normal usb lines in the USB-C connector and the other port connects to the CC1/RFU1 pair like the diagram above, this way you can use both interfaces at the same time. The debug mode with the cable also only works on one of the two orientations in the USB-C socket. The official cable has a "DBG" mark on the C connector that should be facing up when plugged into the device. The other way around it will act as a normal USB cable.
 
That cable can be used only with ChromeOS based devices for serial access.
 
There are frequent claims that Suzy-Q cables can be used with Pixel phones. This exact design ''cannot be used for the SoC UART''. Suzy-Q cables can be used with <em>some</em> Pixel phones to communicate with the Titan M chip ''only''. See: [[Serial_debugging:Cable_schematics#Google_Pixel_.22Android_Debug_Cable.22|Google Pixel "Android Debug Cable"]].
 
== Raspberry Pi ==
{{todo|This diagram shows how to connect the Raspberry Pi to a Carkit-standard device (as described [[Serial_debugging:Cable_schematics#microUSB/Carkit_debug_cable|above]]). Probably worth splitting this up to only mention the Pi's UART and how to connect to it, not from it.}}
 
[[File:RaspberryPiUART.png|400x450px]]


The Nexus S, Galaxy Nexus and other many other devices have the serial port multiplexed with the micro/mini USB connector, initially implemented as part of [[Micro-USB_Interface_Controller|carkit standard]]. This is the schematic for those devices, <s>For this cable too it's important to have a 3.3V usb-to-uart adapter.</s> It's not known whether the different ICs do level conversion, but if they don't, the voltage would be determined by the SoC's specs (e.g 1.8v for msm8916). For safety, don't transmit to the device with 3.3v UART. It seems you can receive just fine though (tested with raspberry pi zero). If you have a multimeter, it might be nice to make a list of 100% known device+voltage pairs. (I don't have one, so I have to play it safe)
{{warning|Most phones don't take 3.3V to the D+ pin on the MICRO PLUG. That's why we need a voltage divider to turn it down to 1.8V. The resistors R1 and R2 values don't matter as long as D+ is getting ~1.8V.}}


[[File:Nexus-usb-debug.png]]
Next do the following:


It should work with:
* From <code>/boot/cmdline.txt</code>, remove <code>console=serial0,115200</code>
* Disable bluetooth: https://www.raspberrypi.com/documentation/computers/configuration.html#uarts-and-device-tree
** Usually appending <code>dtoverlay=disable-bt</code> at the end of <code>/boot/cmdline.txt</code> works
* <code>sudo raspi-config</code> > <code>3 Interface Options</code> > <code>P6 Serial Port</code> > <code>No to login shell</code> > <code>Yes to Serial Port hardware</code> > Finish and reboot
* Finally do <code>sudo picocom -b 115200 /dev/serial0</code> to actually get logs. Regardless of what program you use, <code>/dev/serial0</code> must be used
** <code>/dev/ttyAMA0</code> might work as well


* Nexus S
{{note|If you get weird characters appearing on your screen, your voltage is probably too low}}
* Galaxy Nexus
* Samsung GT-I8190 (Galaxy S3 mini) (PMIC: AB8505)
* Samsung GT-I5800 (Galaxy 3) (PMIC: MAX8998)
* Samsung GT-P1000 (Galaxy Tab P1000)
* Samsung GT-S8500 (Wave)
* Samsung GT-S5570 (Tass) (IC: FSA9280A)
* Samsung i897 (Captivate)
* Samsung GT-i9195 (Galaxy S4 mini) (IC: TSU6721)
* Samsung klte (Galaxy S5)
* Samsung G530H (IC: SM5502)
* LG P700/P705 (IC: LP8727)
* LG P500 (IC: TS5USBA)


{| class="wikitable"
== Per manufacturer/series ==
  ! colspan="5" | Serial Settings
|-
  !  Speed  !!  Data bits  !!  Stop bits  !!  Parity  !!  Flow control
|-
  | 115200 || 8 || 1 || No || None
|}


{| class="wikitable sortable"
=== Sony Xperia ===
  ! rowspan="2" | Device
  ! rowspan="2" | Codename
  ! colspan="2" | Connection
|-
  !  Resistor (R3) !! Connected VCC
|-
  | style="white-space: nowrap;" | [[Google Galaxy Nexus GSM (samsung-maguro)|Google Galaxy Nexus (GSM)]]
  | style="white-space: nowrap;" | samsung-maguro
  | 619K ohm || No
|-
  | style="white-space: nowrap;" | [[Samsung Galaxy Mini 2 (samsung-s6500d)|Samsung Galaxy Mini 2]]
  | style="white-space: nowrap;" | samsung-s6500d
  | 530K ohm || No
|-
  | style="white-space: nowrap;" | [[Samsung Galaxy S4 Mini LTE]]
  | style="white-space: nowrap;" | samsung-i9195
  | 619K ohm || No
|-
  | style="white-space: nowrap;" | [[Samsung_Galaxy_S5_(samsung-klte)|Samsung Galaxy S5]]
  | style="white-space: nowrap;" | samsung-klte
  | 619K ohm || No
|-
  | style="white-space: nowrap;" | [[Samsung_Galaxy_Note_3_(Samsung-N900)|Samsung Galaxy Note 3]]
  | style="white-space: nowrap;" | samsung-hlte
  | 619K ohm || No
|-
  | style="white-space: nowrap;" | [[Samsung_Galaxy_Note_8.0_(Wi-Fi)_(samsung-n5110)|Samsung Galaxy Note 8.0]]
  | style="white-space: nowrap;" | samsung-n5110
  | 619K ohm || No
|}


== Mediatek USB debug cable ==
See the [https://developer.sony.com/develop/open-devices/guides/access-uart-ports Access UART Ports] page on the Sony Developer Portal.
 
Some devices use the MicroSD card slot to expose an UART interface, check the above page for more details.
 
[[File:MicroSD-RX.jpg|border|450px]]
 
=== Some Motorola Devices ===


Some Mediatek devices expose an 3.3V uart interface at the usb port when a special Mediatek debug cable is attached to the device while booting
On [https://www.romstockbr.com/2020/08/manuais-de-servico-esquema-eletrico_89.html here], find your device, and download and extract the file,then:
* open the one contains schematics.
* search keyword <code>UART</code>(could be <code>MSM_UART_*</code> or <code>*_UART_MSM_*</code> or <code>*_DBG_UART_*</code>) and see where it goes to(usually it's <code>JTAG:MINI</code>).
** in some device(like <code>motorola-harpia</code>),tx and rx will connect to a test pad(<code>TP_*</code>),which makes it easier to access.
* find it in board layout and on the device.


The schematic for this debug cable is the same as the Nexus USB debug cable above, except that the ID pin shouldn't be connected.
== Specific devices ==


== Mozilla Flame ==
=== Mozilla Flame ===


The Flame has open UART pads that are accessible underneath the outer and inner covers.
The Flame has open UART pads that are accessible underneath the outer and inner covers.
Line 99: Line 113:
* '''GND''' - green
* '''GND''' - green


Pull-ups/downs are unneccesary, hook straight up to any FTDI/USB-to-serial.
Pull-ups/downs are unnecessary, hook straight up to any FTDI/USB-to-serial.


[[File:Mozilla-flame-pcb.jpg|400px]]
[[File:Mozilla-flame-pcb.jpg|400px]]


== Nokia N900 ==
=== Nokia N900 ===


See the following links:
See the following links:
Line 112: Line 126:
[[File:N900-serial-cable.jpg]]
[[File:N900-serial-cable.jpg]]


== Motorola Droid 4 ==
=== Samsung Galaxy S7 and S5 ===
See [https://forum.xda-developers.com/galaxy-s7/how-to/guide-samsung-galaxy-s7-uart-t3743895 this guide]. It worked almost exactly for the S5, only kernel MUIC driver was in another directory.
 
=== Motorola Droid 4 ===


A off-the-shelf USB-TTL Adapter with 3.3V signal level can be used together with a MicroUSB connector to access the phone's UART. By using a standard MicroUSB &lt;-&gt; USB A cable and just combine a USB jack with a cheap chinese USB-TTL adapter is space-saving and allows you to use the same MicroUSB cable to access the device in USB mode
A off-the-shelf USB-TTL Adapter with 3.3V signal level can be used together with a MicroUSB connector to access the phone's UART. By using a standard MicroUSB &lt;-&gt; USB A cable and just combine a USB jack with a cheap chinese USB-TTL adapter is space-saving and allows you to use the same MicroUSB cable to access the device in USB mode
Line 119: Line 136:
and http://muru.com/linux/d4/
and http://muru.com/linux/d4/


== Sony Xperia ==
=== Motorola Photon Q (asanti / xt897) ===


See [https://developer.sony.com/develop/open-devices/guides/access-uart-ports this page].
The Motorola Photon Q exposes UART via the JTAG connector, the Tx pin can be seen in the image below, the Rx pin is directly below it. It is also possible to hook up a jumper wire from Tx to the headphone jack pad as shown to allow the PinePhone headphone jack UART cable to be used, however make sure not to hook up Rx without a level converter as the PinePhone UART cable is 3.3v, where the Photon Q is 1.8v.


== Suzy-Q debug cable ==
[[File:Motorola-photon-q-uart.jpg|400px]]
 
=== OnePlus 6/6T and 7 Pro ===
 
OnePlus 6
 
[[File:Oneplus6-uart.jpg|400px]]
 
OnePlus 7 Pro
 
[[File:Oneplus7-pro-uart.jpg|400px]]


The Suzy-Q debug cable isn't strictly a serial debug cable, it accesses the Closed Case Debugging system, it can access multiple busses on the device. This system was originally developed to debug chromebooks but has been used in the newer Pixel phones. Details for the Closed Case Debugging system can be found at https://chromium.googlesource.com/chromiumos/platform/ec/+/master/docs/case_closed_debugging.md


[[File:suzyq-debug-cable.png|600x600px]]
Much like other devices, solder to the Tx test point as shown, as well as a ground point (I used a screwhole). You should see bootloader logs. [https://github.com/torvalds/linux/commit/383409806ed6649c8f6c2ec4fecebedba97692b2 this commit] enables UART output from the mainline kernel.


The official SuzyQable from Google has an 2 port USB hub into the cable itself, one port connects to the normal usb lines in the USB-C connector and the other port connects to the CC1/RFU1 pair like the diagram above, this way you can use both interfaces at the same time. The debug mode with the cable also only works on one of the two orientations in the USB-C socket. The official cable has a "DBG" mark on the C connector that should be facing up when plugged into the device. The other way around it will act as a normal USB cable.
=== Google Pixel "Android Debug Cable" ===


That cable can be used with ChromeOS based devices for serial access.
While reported online that a "Suzy-Q" cable can be used for Android-based Pixel devices, the cable available from Sparkfun, the SuzyQable, is not the right cable for debugging Pixel phones. They are using a different incompatible scheme<sup>[How?]</sup>. On Pixel 2 devices they will not work at all, <s>and on Pixel 3, it is reported they show the console of the Titan M chip only.</s> That seems incorrect - bootloader/dmesg logs are sent over USB UART if you run <code>fastboot oem uart enable</code> first.


== Android Debug Cable ==
Serial access for the Pixel 2, 3 and 4 (unverified with 5) can instead be achieved using the following [https://github.com/Peter-Easton/android-debug-cable-howto Android Debug Cable]. Note that using a pass-through breakout board is not mandatory, but is helpful to keep the serial console active while using ADB.


While reported online that a "Suzy-Q" cable can be used for Android-based Pixel devices, the cable available from Sparkfun, the SuzyQable, is not the right cable for debugging Pixel phones. They are using a different incompatible scheme<sup>[How?]</sup>. On Pixel 2 devices they will not work at all, and on Pixel 3, it is reported they show the console of the Titan M chip only.
Google has also open sourced their own [https://github.com/google/usb-cereal adapter].


Serial access for the Pixel 2 and 3 (unverified with 3a and 4) can instead be achieved using the following [https://github.com/Peter-Easton/android-debug-cable-howto Android Debug Cable]. Note that using a pass-through breakout board is not mandatory, but is helpful to keep the serial console active while using ADB.
This cable has been tested with:


This cable should work with:
* [[Google Pixel 2 XL (google-taimen)]]
* Google Pixel 2 (walleye)
* Google Pixel 3/3 XL (blueline/crosshatch)
* Google Pixel 4 XL (coral)
* Google Pixel 5a (barbet)


* Google Pixel 2
This cable should work fine with:
* Google Pixel 3


== Samsung Galaxy S7 and S5 ==
* Google Pixel 4 (flame)
See [https://forum.xda-developers.com/galaxy-s7/how-to/guide-samsung-galaxy-s7-uart-t3743895 this guide]. It worked almost exactly for the S5, only kernel MUIC driver was in another directory.


== Alternatives to a serial cable ==
This cable might work with:
There might not be a need for a serial cable if you think it is too complicated to make one for your device (although it is much more convenient when it works).
From [https://github.com/crondog/arch-flo there], about the [[Google Nexus 7 2013 (asus-flo)]]:
If you cannot get it booting you will need to reboot into recovery and check /proc/last_kmsg for the errors. Or try and build the UART cable (which I failed at)


Also, a sony employee gave an alternative method [https://talk.sonymobile.com/t5/General-Discussion/xperia-xz1-compact-boot-sequence/m-p/1274488/highlight/true#M1240 here], that might be worth a go:
* Google Pixel 5 (redfin)
Unfortunately the only way to access the serial port is to open the device but....
You have the other option to debug - pstore:
1. flash an aosp recovery image with a working kernel to the recovery partition
2. to flash your new kernel on the main partition and boot
After your new kernel crashes keep volume down pressed and you will boot the working kernel from the recovery partition. From recovery you have access to adb and you can extract the logs from pstore


== Finding the serial port on your device ==
=== Lenovo IdeaTab A3000 ===
Sometimes there is no other solution but to poke at random motherboard pins to find the serial port. This is mostly a lucky process, but you can:
[[File:Lenovo-a3000-uart.jpg|400px]]
* send either garbage, or a repeating pattern to the serial port at <code>/dev/ttysomething</code> (if you have a kernel where it's working), and then try to find the tx pin with a scope.
** If you can't, you can also reboot your phone and hope it writes something during boot (but that's really trying luck)
* tx is usually good enough for debugging, but rx should be quite close, with a high impedance, or more likely a pulling resistor.
** a pull-up or pull-down resistor will make the pin look like gnd or vcc


== Soldering a connector on your device ==
Details in [[Lenovo IdeaTab A3000 (lenovo-a3000)#UART]].
This can be a bit involved, but is generally necessary if you want to use it:
* This procedure is ''dangerous'' for your device, even more so if you are not very experienced
** Prefer to ask help in a hackerspace, makerspace, fablab or similar ''you'll practice another day on something easier''
** If you have to solder it yourself, it's probably a good idea to practice on an old motherboard before
* Prefer soldering short cables to the PCB instead of full-length ones
** The smaller (diameter) the cables, the better, generally
** too long or too thick and the pads you have soldered risk being teared apart by the cables
** too small and it will be a hassle to work with
** The best is to have them a couple (4-8) centimeters long, to solder them, solder a connector on the other end, and scotch tape them to the pcb
** Please, don't forget to pick insulated wires


== See also ==
== See also ==
* [[Mainlining FAQ#Serial_cable]]
* [https://code.paulk.fr/article21/a-hacker-s-journey-freeing-a-phone-from-the-ground-up-second-part exposing UART on the LG Optimus Black (P970)] (OMAP3)


[[Category:Guide]]
* [[Serial debugging]]
* [[Micro-USB Interface Controller]]

Latest revision as of 22:13, 28 January 2025

This page contains schematics for serial cables, as well as device support tables and basic build instructions. For more information about serial debugging, visit the Serial debugging page.

microUSB/Carkit debug cable

Many devices with microUSB ports have the serial port multiplexed with the micro/mini USB connector, initially implemented as part of carkit standard. The Replicant project has a page dedicated to serial on Galaxy Nexus using this cable.

NOTE: "TX" and "RX" on this image refer to the TX and RX pins on your UART board.

Note that some devices and MUICs require a resistor with a different resistance than 150KΩ. To find the correct resistor value, check your device's wiki page, the MUIC page or follow the guide in Serial debugging#Finding the UART ports on your device.

Note Tip: If you don't have the exact resistor you need for the cable, you can combine multiple similar resistors (for example 3 56kΩ for ~150kΩ). MUICs typically have a small margin of error where they'll still detect the correct resistance and switch to the right mode even if the value is a bit off.

Nexus debug cable

Some Nexus phones, as well as the first Pixel phone generation, multiplexed the serial debug lines with the headphone audio lines. To switch it into serial mode you have to supply -3V to the mic port. The UART lines themselves are 1.8V. If you use a 3.3V usb-to-uart adapter the signal from the phone will probably work, for the TX side you have to add a resistor divider to lower the voltage for the phone. Here's the schematic for a Nexus debug cable:

This cable has been tested with:

Some LG devices also support this debug cable:

The Nexus 7 2012 (grouper) does not work with this setup and likely does not have any serial UART capabilities at all unless you connect to unpopulated pads on board.

Google open sourced their own debug cable design in the AOSP repository.

NT: You will have a better luck with FTDI based serial cable.

It is unknown if it can work with the A-series Pixel devices. These claims are unsubstantiated, and they are already known to use the "cereal" debugging cable scheme. See: Google Pixel "Android Debug Cable".

  • Google Pixel 3a and 3a XL (sargo/bonito)
  • Google Pixel 4a (sunfish)
  • Google Pixel 4a 5G (bramble)

Mediatek USB debug cable

Some Mediatek devices expose an 3.3V UART interface at the USB port when a special Mediatek debug cable is attached to the device while booting.

The schematic for this debug cable is the same as the Nexus USB debug cable above, except that the ID pin shouldn't be connected.

Suzy-Q debug cable

The Suzy-Q debug cable isn't strictly a serial debug cable, it accesses the Closed Case Debugging system, it can access multiple busses on the device. Details for the Closed Case Debugging system can be found at https://chromium.googlesource.com/chromiumos/platform/ec/+/cr50_stab/docs/case_closed_debugging.md

TODO TODO: The usb type-c receptacle pinout is wrong(B8 is SBU2 B5 is CC2, no RFU1), see https://en.wikipedia.org/wiki/USB-C

The official SuzyQable from Google has an 2 port USB hub into the cable itself, one port connects to the normal usb lines in the USB-C connector and the other port connects to the CC1/RFU1 pair like the diagram above, this way you can use both interfaces at the same time. The debug mode with the cable also only works on one of the two orientations in the USB-C socket. The official cable has a "DBG" mark on the C connector that should be facing up when plugged into the device. The other way around it will act as a normal USB cable.

That cable can be used only with ChromeOS based devices for serial access.

There are frequent claims that Suzy-Q cables can be used with Pixel phones. This exact design cannot be used for the SoC UART. Suzy-Q cables can be used with some Pixel phones to communicate with the Titan M chip only. See: Google Pixel "Android Debug Cable".

Raspberry Pi

TODO TODO: This diagram shows how to connect the Raspberry Pi to a Carkit-standard device (as described above). Probably worth splitting this up to only mention the Pi's UART and how to connect to it, not from it.

Warning WARNING: Most phones don't take 3.3V to the D+ pin on the MICRO PLUG. That's why we need a voltage divider to turn it down to 1.8V. The resistors R1 and R2 values don't matter as long as D+ is getting ~1.8V.

Next do the following:

  • From /boot/cmdline.txt, remove console=serial0,115200
  • Disable bluetooth: https://www.raspberrypi.com/documentation/computers/configuration.html#uarts-and-device-tree
    • Usually appending dtoverlay=disable-bt at the end of /boot/cmdline.txt works
  • sudo raspi-config > 3 Interface Options > P6 Serial Port > No to login shell > Yes to Serial Port hardware > Finish and reboot
  • Finally do sudo picocom -b 115200 /dev/serial0 to actually get logs. Regardless of what program you use, /dev/serial0 must be used
    • /dev/ttyAMA0 might work as well
Note If you get weird characters appearing on your screen, your voltage is probably too low

Per manufacturer/series

Sony Xperia

See the Access UART Ports page on the Sony Developer Portal.

Some devices use the MicroSD card slot to expose an UART interface, check the above page for more details.

Some Motorola Devices

On here, find your device, and download and extract the file,then:

  • open the one contains schematics.
  • search keyword UART(could be MSM_UART_* or *_UART_MSM_* or *_DBG_UART_*) and see where it goes to(usually it's JTAG:MINI).
    • in some device(like motorola-harpia),tx and rx will connect to a test pad(TP_*),which makes it easier to access.
  • find it in board layout and on the device.

Specific devices

Mozilla Flame

The Flame has open UART pads that are accessible underneath the outer and inner covers.

  • TX - red
  • GND - green

Pull-ups/downs are unnecessary, hook straight up to any FTDI/USB-to-serial.

Nokia N900

See the following links:

Samsung Galaxy S7 and S5

See this guide. It worked almost exactly for the S5, only kernel MUIC driver was in another directory.

Motorola Droid 4

A off-the-shelf USB-TTL Adapter with 3.3V signal level can be used together with a MicroUSB connector to access the phone's UART. By using a standard MicroUSB <-> USB A cable and just combine a USB jack with a cheap chinese USB-TTL adapter is space-saving and allows you to use the same MicroUSB cable to access the device in USB mode

See http://elektranox.org/2017/02/0009-droid-4-root/ and http://muru.com/linux/d4/

Motorola Photon Q (asanti / xt897)

The Motorola Photon Q exposes UART via the JTAG connector, the Tx pin can be seen in the image below, the Rx pin is directly below it. It is also possible to hook up a jumper wire from Tx to the headphone jack pad as shown to allow the PinePhone headphone jack UART cable to be used, however make sure not to hook up Rx without a level converter as the PinePhone UART cable is 3.3v, where the Photon Q is 1.8v.

OnePlus 6/6T and 7 Pro

OnePlus 6

OnePlus 7 Pro


Much like other devices, solder to the Tx test point as shown, as well as a ground point (I used a screwhole). You should see bootloader logs. this commit enables UART output from the mainline kernel.

Google Pixel "Android Debug Cable"

While reported online that a "Suzy-Q" cable can be used for Android-based Pixel devices, the cable available from Sparkfun, the SuzyQable, is not the right cable for debugging Pixel phones. They are using a different incompatible scheme[How?]. On Pixel 2 devices they will not work at all, and on Pixel 3, it is reported they show the console of the Titan M chip only. That seems incorrect - bootloader/dmesg logs are sent over USB UART if you run fastboot oem uart enable first.

Serial access for the Pixel 2, 3 and 4 (unverified with 5) can instead be achieved using the following Android Debug Cable. Note that using a pass-through breakout board is not mandatory, but is helpful to keep the serial console active while using ADB.

Google has also open sourced their own adapter.

This cable has been tested with:

This cable should work fine with:

  • Google Pixel 4 (flame)

This cable might work with:

  • Google Pixel 5 (redfin)

Lenovo IdeaTab A3000

Details in Lenovo IdeaTab A3000 (lenovo-a3000)#UART.

See also