• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Howto: Android G1 Serial cable

Search This thread

hoepfel

Member
Jul 3, 2009
10
0
I guess it's got something to do with the Kernel being for Android 1.0 and your OS likely being Cupcake... One probably could compile a current kernel instead, but I couldn't be bothered so far. And yes, I do get the same behavior.
 

virdi

Member
Jan 7, 2009
34
0
Tampa
Android-Arduino interfacing

I did get Arduino to G1 working. There are instructions in this thread, what else do you need to know?

I read your instructions (The "it" in "Okay, I got it working" made me miss it). Thanks for sharing! I have couple of questions as I have never compiled Android from source. All of this may not make complete sense as I am still trying to understand...

1. Are we recompiling just the kernel or something else too? If yes, does it mean this can't be done on custom ROMs? (Cyanogen, JACHero, JF).

2. Once we recompile the kernel or fastboot, how can we transfer/flash the binaries to the phone?

3. Is it possible to know exactly what OPTIONS were changed/added in the attached config file (which I suppose is used by the compiler to specify options while compiling the new kernel). I guess we can request custom ROM hackers to include those changes in their respective ROM kernels.

Thanks in advance!
 

hoepfel

Member
Jul 3, 2009
10
0
1. Are we recompiling just the kernel or something else too? If yes, does it mean this can't be done on custom ROMs? (Cyanogen, JACHero, JF).
-- Well, I compiled a complete Android 1.0 source because it seemed easier, but I'm only using the kernel. The kernel, even though it's old by now, still works with JF v1.51, so I'm assuming other builds should be fine as well. But note that some features (wifi, sdcard, netfilter...) may not work because we're using macpods kernel config file.

2. Once we recompile the kernel or fastboot, how can we transfer/flash the binaries to the phone?
-- I do fastboot via ./fastboot boot [androidsource]/kernel/arch/arm/boot/zImage jfboot.img-ramdisk.gz , but am not sure if it's even required to give JFs ramdisk image as parameter (it's optional). This boots the phone once with the different kernel and doesn't flash anything. To make changes permanent, you would need to look things up.

3. Is it possible to know exactly what OPTIONS were changed/added in the attached config file (which I suppose is used by the compiler to specify options while compiling the new kernel). I guess we can request custom ROM hackers to include those changes in their respective ROM kernels.
-- Very true. There should be the used kernel config in /proc/config.gz (or similar, this is what I remember from the top of my head) on your custom ROM. And you can diff that against other configs. But I guess the smartest thing to do would be diff'ing macpods kernel config against a stock 1.0 kernel config to collect the necessary flags, then add those to a current kernel's config file.

I'm in a little rush right now and can't look up the details, but keep the questions coming, I'm really glad to help!
 

spiritplumber

Senior Member
Jul 31, 2009
56
0
I tried to get the source, and while it does compile, it provides me with a premade kernel and there's no /kernel/ after checking out with git/repo. I've been fiddling with it all day now.


As an aside: While the g1 talks 2.8 volts, it CAN talk just fine to a 3.3 volt serial adapter (or directly to a micro, like the Parallax Propeller) if you remember to use two 1kOhm resistors between them (really only needed on the G1's rx side, but I put it on both usually). DO NOT TRY THIS WITH A 5 VOLT MICROCONTROLLER (such as a Picaxe or Basic Stamp) BECAUSE IT WILL NOT BE READ CORRECTLY ON TX, AND MAY BREAK THE G1 ON RX.
 

hoepfel

Member
Jul 3, 2009
10
0
did you try cd'ing into the source's kernel directory and then make'ing the kernel? you really should get a new image afterwards. i guess you could always use my kernel image...

macpod's written a bit about the 2.8v vs 3.3v issue and IIRC that resistors aren't really necessary. I was too lazy as well and it did interface with my Arduino board just fine, but I haven't used it for too long either.
 

spiritplumber

Senior Member
Jul 31, 2009
56
0
Not good for the UART chip inside the g1 in the long run although it's only an issue if it so happens that the serial wire is long / there are noise issues. Just a thought (we killed a couple Prop chips feeding them 5v).
I tried making the kernel and I'm jumping from error to error: it may have to do with the fact that I'm in OS X. Thanks though :)
 

spiritplumber

Senior Member
Jul 31, 2009
56
0
Probably not in that the serial port driver must be loaded from a kernel, so if the gphone doesn't even get that far the wires just sit there. :(
 

spiritplumber

Senior Member
Jul 31, 2009
56
0
I got the cupcake version to compile, here it is for what's worth :)

(its a zImage, i name it different because I hate accidental overwriting).

Please let me know if it works for you! seems to work for me so far. Baud is 9600.
 

Attachments

  • serialport.zip
    1.5 MB · Views: 60
  • serialportconfig.zip
    35.8 KB · Views: 35
Last edited:

ldf913

Senior Member
Feb 20, 2009
59
0
www.soundclick.com
Hmm

sounds so cool what you guys r doing... wish i knew what you guys were talking bout, and what could be accomplished by that, anyways keep up the good work maybe one day it can be broken down in noobish and i could help :D
 

spiritplumber

Senior Member
Jul 31, 2009
56
0
This is about getting out of the HTC a serial port (you know that 9 pin connector on your PC). While a lot of people aren't familiar with the interface anymore or see it as obsolete, it's still widely used for a number of purposes including debugging, machine control and so on. For example, a serial port and a simple $5 microcontroller would allow the Android to control servos or stepper motors. Or a sonar in my case.
 

hoepfel

Member
Jul 3, 2009
10
0
Awesome work, spiritplumber! I'll make sure I'll try your kernel instead next time I find time to play with it.
 

rljohnsn

Member
Aug 5, 2008
5
0
Pleasanton
This is about getting out of the HTC a serial port (you know that 9 pin connector on your PC). While a lot of people aren't familiar with the interface anymore or see it as obsolete, it's still widely used for a number of purposes including debugging, machine control and so on. For example, a serial port and a simple $5 microcontroller would allow the Android to control servos or stepper motors. Or a sonar in my case.

or maybe a cisco console :p
 

spiritplumber

Senior Member
Jul 31, 2009
56
0
Please LMK if my recompile works for you :) use fastboot to load it, i would't put it in permanently yet.

With stock firmware, a serial cable will display debug info and offer a debug> shell at 115200,n,8,1 baud on startup. I don't know if that helps bricked phones: all I can get it to do is reboot (by typing reboot...). It MIGHT though. At least it might tell you if the phone is totally dead or not.
 
Last edited: