peter-easton / android-debug-cable-howto Goto Github PK
View Code? Open in Web Editor NEWThis is a simple how-to to create your own android kernel debugging cable using commercially available parts.
This is a simple how-to to create your own android kernel debugging cable using commercially available parts.
I was able to enable UART on my Pixel 2 XL and set up an adapter as described. I get plenty of UART output both in bootloader mode and when the phone is booting up. But there does not seem to be any 'console' or 'prompt'; it seems the text I send over the serial connection is not acknowledged by the phone. I don't see any "Press any key to interrupt boot" (etc.) prompt in the UART log, as this is what some other android phones use to break into a UART shell/console.
Is UART merely a log, or should I be able to get a console with commands?
(The guide mentions that it is possible to obtain root via the UART console; I can't see how this would be done without a console interface.)
I tried two different USB-to-serial adapters, one running at 3.3V and one at 1.8V (the phone's UART TX is 1.8V so it should be expecting RX at 1.8V) with no luck.
Thanks for creating this guide
Side note: this is not an "issue" per se, but since the discussion tab isn't enabled, I filed it as one. Any chance you want to enable discussions on this repo?
I have successfully used this on the Pixel 8 Pro.
I used a USB UART cable from Adafruit, which uses the SiLabs CP2102 chipset and like the one you used, does 3.3V TX output, which is not the 1.8V that it seems Pixel devices were designed for.
So I put a voltage divider (with two 10k resistors I had) on the TX line to cut the voltage in half to be safe.
With the USB-C breakout board plugged into the phone with the "A" side USB-C pins facing up toward the device screen, it worked with pin A8/SBU1 connected to the UART cable's RX line and B8/SBU2 connected to the TX line. (*See tech note below)
I think it's not reversible, and if the board's connector was plugged in the other way with the B side pins up, then RX and TX would end up getting swapped and I suspect it would not work without swapping A8 to TX and B8 to RX.
minicom seemed to default to 115200 baud with 8N1, which worked.
I used a different breakout board too due to shipping times.
* Tech note: I don't actually know if the USB receptacle in the phone has A pins on the screen side, so I can't say for sure that the true A8 (from the phone's perspective) is actually what should connect to the UART RX, so I am just using that terminology by convention based on the breakout board labeling. You also have to look at your breakout board to see which side (top/bottom) of the connector is connected to A vs B pins in order to plug it in correctly. See Google's old repo for their cable for their (brief) mention of orientation:
Determine correct orientation - top vs. bottom - the tool operates correctly only when SBU1 pin corresponds to TX and SBU2 pin corresponds to RX.
So based on that, either they have swapped this with newer devices (seems less likely), or the phone's receptacle actually has the B pins on the screen side, in which case my convention is flipped. I didn't want to use an oscilloscope to verify.
Has anyone got their debug cable to work with a Pixel 4? Having issues with mine at the moment, and sadly don't have a Pixel 2/3 to verify if my wiring is working.
Hi,
I have been trying this on my Redmi Note 11.
I have tried 3 different usb-serial adapters (ft232, cp2102,pl2303). Also changed cable and flipped connection.
Enabled these configs in kernel configuration:
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_SERIAL_PL2303=y
CONFIG_USB_SERIAL_FTDI_SIO=y
But fastboot for this device doesn't have an enable UART option. So can't do that.
Any idea what else to try? Or where to go from here.
I want to be able to debug a non booting kernel.
On my Poco M3:
fastboot oem uart disable
FAILED (remote: 'unknown command')
fastboot: error: Command failed
anyone knows how it can be done on Xiaomi?
I use google pixel 3 XL .
thank you
thestinger mentioned to me that unfortunately the PCB has a nasty tendency to have to dangle off the phone with all the weight of the cables added to it, and this will bend the PCB and cause it to break at its thinnest location: the plug going into the phone.
The E-Lab Bay guy sells female to female breakout boards and I managed to get a couple, which should allow me to connect the phone to the PCB with a USB-C to USB-C cable. Because USB-C to USB-C cables are included in the box with the Pixels this should hopefully work. I'm going to try to see if I can find a way to test this rig properly if I can figure out UART without needing to unlock my phone again and start over... if anyone has any idea on how to do that please let me know.
Hi,
I build my adapter for pixel 3, now minicom console can output phone's kernel log, but I can not input anything。
Anything I missed? thanks.
My adapter connection as below, and my USB2TTL signal is 1.8V:
USB2TTL GND <---> TypeC Adapter's A1.
USB2TTL RXD <---> TypeC Adapter's A8
USB2TTL TXD <---> TypeC Adapter's B8
Just wanted to let you know this method also works on the Pixel 5! The only thing I changed was inverting the A8 and B8 pins (A8 -- TX
and B8 -- RX
). I got the idea from https://blog.bacon.dev/2020/10/enabling-serial-port-or-console-uart-on.html. It also wasn't mentioned as far as I could find, but the baud rate is 115200.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.