Howto: Android G1 Serial cable

Search This thread

macpod

Member
Oct 23, 2008
17
0
Columbia, MD
macpod.net
I can tell you the G1's pins output 2.8v. I think I would stick close to that. The only reason I used the 3.3v cable is because I have seen pictures of a cable an actual android dev has allegedly used 3.3v levels.


Did you find the instructions confusing since I claimed CMOS-TTL? I actually switched it to just say 2.8v levels now to be safe. I guess saying TTL was a bad word choice since it can go up to 5v although I do specify you need a 2.8 or 3.3v serial to usb adapter in the required materials section.
 
Last edited:

damnoregonian

Senior Member
Jun 28, 2007
110
13
Seattle
ya it was the TTL that made me second guess.
I have several TTL level uarts that will smoke CMOS level inputs. I wasn't about to try one of them unless you had said you did with no problems.
2.8 is odd, but i imagine it's still some form of low voltage MOS and can handle 3.3v without problems.
 

axou

New member
Mar 26, 2009
2
0
Working on it ;) You need to disable H2W and PIQ AFIK.
Thanks for the great tutorial !
I've compiled a kernel with CONFIG_TROUT_H2W, CONFIG_MSM_FIQ_SUPPORT and CONFIG_MSM_SERIAL_DEBUGGER unset
I understand that the UART port appears as /dev/ttyMSM2, however I can't measure anything on the TX pin when sending data from the Dream, i.e :
echo "Hello" > /dev/ttyMSM2

Have you succeeded in transmitting data in any direction ?
 
Last edited:

macpod

Member
Oct 23, 2008
17
0
Columbia, MD
macpod.net
What are you using to measure? A multimeter isn't going to work.. you would need a scope.. or serial device of compatible voltage levels able to run at the g1's baud rate.

I didn't have a build env setup on my computer and I only got everything setup/compiled last night because of the cupcake merge into master (I might post instructions on how to build everything before the march 18th merge if there is interest).. so I haven't had a chance to disable the debug console/etc and test yet. I plan to work on that tonight and tommorow.

Some interesting things I have found sofar and questions if you guys happen to be researching this stuff:
-Booted normally you get a "debug>" prompt. ps works.. but I haven't researched what other commands are possible. What have you guys found?

-With the phone powered off, if you plug the serial cable in and read it, it tells you the charging mode and some other characteristics/etc.

-The engineering spl has a serial console you can send commands to. I haven't research what commands are possible yet.. again, what have you folks found?

edit: I bet if you attached a piezoelectric speaker between the tx and gnd pins.. then piped /dev/urandom to /dev/ttyMSM2, you could test that way too.. but that's unconfirmed.
 
Last edited:

axou

New member
Mar 26, 2009
2
0
Thanks for your answer, I was measuring with a scope.
I'll try again with a default msm_defconfig'd kernel and see if I get a console.

Looking forward to hearing of your tests !
 

viperbjk

Inactive Recognized Developer
Nov 21, 2007
401
54
Munich
-The engineering spl has a serial console you can send commands to. I haven't research what commands are possible yet.. again, what have you folks found?
Not only the engineering spl has that. You can use either usb or serial to talk to the interface. What is more interesting : Serial lets you talk to the radio directly (oemsbl) and outputs debug info. Access to all commands is only given using engineering spl and security unlocked device. The commands however are already in the wiki.

edit: I bet if you attached a piezoelectric speaker between the tx and gnd pins.. then piped /dev/urandom to /dev/ttyMSM2, you could test that way too.. but that's unconfirmed.
Totally confirmed. Sounds just like a good old modem :)

Cya,

Viper BJK
 

macpod

Member
Oct 23, 2008
17
0
Columbia, MD
macpod.net
Ok, taxes put me on hold.. but I'm back and have it working. Here is the config file I used to compile the kernel.

Speed is set to 9600 8N1, the G1 serial device is /dev/ttyMSM2. If you were curious, /dev/ttyMSM0 is bluetooth related.

I'll post up instructions later on how to compile and install it as well as a boot.img for convenience if folks are interested.
 

Attachments

  • serial9600baudconfig.zip
    8 KB · Views: 153
Last edited:

gourneau

New member
Dec 25, 2006
1
0
Ok, taxes put me on hold.. but I'm back and have it working. Here is the config file I used to compile the kernel.

Speed is set to 9600 8N1, the G1 serial device is /dev/ttyMSM2. If you were curious, /dev/ttyMSM0 is bluetooth related.

I'll post up instructions later on how to compile and install it as well as a boot.img for convenience if folks are interested.

Great, thanks a lot for all your contributions! I am looking forward to your instructions.
 

hoepfel

Member
Jul 3, 2009
10
0
I would love to get a boot.img as well, I'm not very skilled with all that and only want the serial console to interface the G1 with my Arduino.
 

hoepfel

Member
Jul 3, 2009
10
0
Okay, I got it working! Instructions are for Ubuntu only, sorry. I believe you need a rooted phone with engineering (or hardspl or comparable fastboot-enabled) bootloader and macpods serial to usb cable (or something comparable).

1) Compile Android source with Dream-specifics as described by this. You probably only need prebuilt and kernel, but I'm not very familiar with git and just got everything.
2) cd into the kernel directory, copy macpods serial9600config from above as .config there
3) "make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- oldconfig" I don't remember if this asks for anything at all, if it does, go with the suggested answers
4) "make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-" - You now have a kernel image for Android 1.0 (I think), but for me it works with JFv1.51 as well
5) You can now compile fastboot in $ANDROIDSOURCE/system/core/fastboot or grab the precompiled binary from http://android-dls.com/files/linux/fastboot
6) Hook up your phone, power off, start with camera+power. Press back when the skating androids appear to switch to fastboot mode.
6) Do ./fastboot boot $ANDROIDSOURCE/kernel/arch/arm/boot/zImage and wait. This takes a moment, then it should start.

You know should have /dev/ttyMSM2 which you can echo into (echo "hello world" > /dev/ttyMSM2) or listen to (cat /dev/ttyMSM2). For instance, I'm building an Android app that passes GPS coordinates over the console to an ArduPilot board and will provide telemetry to a ground station. Testing it with "Serial port terminal" from the Ubuntu repository works as well (remember to choose 9600 bauds and the right port).

Thanks to to macpod for his excellent work and help with building the cable, Google for providing such a kick-ass (somewhat) open phone and all the kernel hackers and rooters for their work.

I just wrote this from the top of my head, just post if you have trouble getting this to work.

edit: I attached my kernel image, which should allow you to skip steps 1 - 4 if you're so inclined.
 

Attachments

  • zImage.zip
    1.3 MB · Views: 92
Last edited:

rigamrts

Senior Member
Apr 12, 2009
331
3
do you guys think this will help all the bricked devices? just a question i don't have a bricked device to test but would be nice if did
 

hoepfel

Member
Jul 3, 2009
10
0
Well, I don't know nothing about bricked devices, but if you can still get them into fastboot mode, you can flash every partition on the phone, so you should be able to resurrect it.
The cable normally allows you access to a debug console (you see kernel outputs while booting, then get a console). I don't know what that is for (maybe USB debugging for developing apps, dunno. I read somewhere that you can directly access the GSM chip, issue AT commands and the like). You'd need to look into that. And with a custom kernel you get a regular serial console trough that extended USB port on your phone, just like telnet'ing into your phone or whatever. Normal unix stuff. And this console can be accessed from Android apps as well.