Jump to content


Photo

Using rs232 on the Pulse

- - - - -

  • Please log in to reply
48 replies to this topic

#1
Tom G

Tom G

    Addict

  • Members
  • PipPipPipPipPip
  • 742 posts
  • Gender:Male
  • Location:Melbourne Australia
  • Devices:2X Blade U8220 V9 Vega X10
We have always known that the Pulse could support an rs232 port as it is part of the MSM7201A SoC platform. It was possible that the rs232 port on the MSM7201a was not connected to anything, but unlikely since manufacturors usually want ports like this for debugging. The port can be seen as /dev/ttyMSM2 in the OS.
There are many uses for an RS232 port, but I am most interested in it for debugging. The master console can be directed to the RS232 port using the console kernel parameter. This will hopefully make it easier to debug kernel problems.

Under the SIM card there is an 11 contact interface. Three of the contact are for the RS232 port.

Attached File  rs232_1.JPG   38.96KB   994 downloads

What you will need.
  • A 3V RS232 adapter. Most PC RS232 ports are 5V, do not hook that up directly to the phone. The are many options here, I used one of these, but there are many other choices. The FTDI USB solutions appear to be well supported, but a MAX232 based serial converter would also work and should be a bit cheaper.
  • Some wire. You want fairly small single core wire. I used 30awg because I have a spool of it, but a bit bigger would be fine.
  • Soldering iron.
  • Flux.
  • An RS232 console application. I'm using minicom on linux, but there are heaps of alternatives on all platforms. I think PuTTY does RS232, so if your on windows take a look at that.
What to do.
Pin-out
=======

1  2  3  4  5  6
  7  8  9  10 11

   4=TX
  10=RX
  11=GND

Connections
===========

Phone --- PC adapter
  GND --- GND
  RX  ---  TX
  TX  ---  RX
Attached File  rs232_2.JPG   60.71KB   967 downloads
Red = TX
Green = RX
Blue = GND

Cut some wires. The shorter the better. The longer the wires the greater the chance of interference.
Connect TX on the phone to RX on the RS232 adapter.
Connect RX on the phone to TX on the adapter.
Connect GND to GND. It will work without GND connected, but you will probably get more noise.

I recommend soldering, but you could try tape or hot glue if you don't want to solder on the board. Unfortunitely this isn't very good if you actually use your phone.
I needed to use a bit of flux to get the solder to stick on the board.

Attached File  rs232_3.JPG   57.04KB   972 downloadsAttached File  rs232_4.JPG   82.68KB   970 downloads
Attached File  rs232_5.JPG   101.16KB   966 downloads

All done. Now connect it to your PC.

Configuring the PC
First, figure out what your comm port is called and if needed install drivers. The FT232R doesn't need any drivers in linux (as long as right driver is in the kernel) and appears as /dev/ttyUSB0.
Now start your console software. You will need to configure the port.
The setting you want are 9600 8N1, no hardware or software flow control.

Testing
Connect with the console software
On the phone run
echo Hello > /dev/ttyMSM2
You should see 'Hello' appear in the console on the PC.

Next, on the phone run
cat /dev/ttyMSM2
Now enter 'Hello' in the console on the PC and press enter. You should see 'Hello' displayed in the phones shell.

If that all worked you now have a working RS232 port.

  • 0

#2
SpankyHam

SpankyHam

    Newbie

  • Members
  • Pip
  • 35 posts
  • Location:London, UK
  • Devices:LG Optimus 2X
Now that is dedication to the cause!

How difficult (if even possible) do you think it would be to create a board that would lay on top of the points to make a contact? Even though I don't use my Pulse as a phone, I couldn't trust myself not to pull the wires off, and constant re-soldering surely can't be good for the phone.

  • 0

#3
TGWS

TGWS

    Enthusiast

  • Members
  • PipPipPip
  • 254 posts
  • Devices:Pulse
Im very confused about this thread.

What does this accomplish by doing all that stuff you done in the pictures?
Not being rude or anything :lol:

Edited by TGWS, 17 September 2010 - 02:05 PM.

  • 0

#4
david_dawkins

david_dawkins

    Enthusiast

  • Members
  • PipPipPip
  • 282 posts
  • Gender:Male
  • Location:Reading, UK
  • Devices:Galaxy SII
  • Twitter:@DaveDawkins

Im very confused about this thread.

What does this accomplish by doing all that stuff you done in the pictures?
Not being rude or anything :lol:


He states why in the very first paragraph.

  • 0

#5
Tom G

Tom G

    Addict

  • Members
  • PipPipPipPipPip
  • 742 posts
  • Gender:Male
  • Location:Melbourne Australia
  • Devices:2X Blade U8220 V9 Vega X10

Now that is dedication to the cause!

How difficult (if even possible) do you think it would be to create a board that would lay on top of the points to make a contact? Even though I don't use my Pulse as a phone, I couldn't trust myself not to pull the wires off, and constant re-soldering surely can't be good for the phone.

Just hot glue the wires to the back of the phone so the glue gets pulled instead of the solder. Thats usually what I do modding other things.

The kernel cmdline in the official roms has console set to ttyMSM2,115200n8. That isn't working for me, I don't know if it because of the 3V adapter or if the phone/kernel simply doesn't support it. ttyMSM2,9600n8 is working fine.

Im very confused about this thread.

What does this accomplish by doing all that stuff you done in the pictures?
Not being rude or anything :lol:

Its useless to most people.
You can direct the linux console to the RS232 port. It is a low-level hardware interface, so it will always work. One of the problems with kernel development has been seeing what is happening. This should help. For adb to work a lot of other things need to be working.

You can also do all sort of other stuff with RS232, but most of it really isn't useful on a phone.

I think the console will always have root access, so this may be a way for people with busted usb ports to root their phone, but that will only work if the 115200n8 setting in the official roms will work.
On HTC phones it is also possible to use RS232 in fastboot to access things otherwise not accessible (radio firmware etc I think). I haven't got anything to work with fastboot on the pulse yet.

Edited by Tom G, 17 September 2010 - 02:33 PM.

  • 0

#6
R_A_V

R_A_V

    Newbie

  • Members
  • Pip
  • 39 posts
  • Devices:Pulse
Thanks for the information! I have exactly 3V USB->RS232 adapter (old siemens M55 datacable) and busted usb port! Will try to root my phone in this way.

Edited by R_A_V, 20 September 2010 - 11:20 AM.

  • 0

#7
Tom G

Tom G

    Addict

  • Members
  • PipPipPipPipPip
  • 742 posts
  • Gender:Male
  • Location:Melbourne Australia
  • Devices:2X Blade U8220 V9 Vega X10

Thanks for the information! I have exactly 3V USB->RS232 adapter (old siemens M55 datacable) and busted usb port! Will try to root my phone in this way.

I'm actually now fairly sure it won't work, i'll try it and let you know.

  • 0

#8
flibblesan

flibblesan

    Token Northern bloke

  • Assistant Admin Team
  • PipPipPipPipPipPip
  • 5,653 posts

Now that is dedication to the cause!

How difficult (if even possible) do you think it would be to create a board that would lay on top of the points to make a contact? Even though I don't use my Pulse as a phone, I couldn't trust myself not to pull the wires off, and constant re-soldering surely can't be good for the phone.


I was just thinking about that. A small board the size of a SIM card with spring loaded contacts that hit the right spots to make the RS232 connection. Flat ribbon cable coming off the board which you can then connect to the 3V adapter. That'll allow you to easily remove it from the phone when you don't need to debug. I'm pretty sure this is the same sort of thing the engineers use.

  • 0

#9
Tom G

Tom G

    Addict

  • Members
  • PipPipPipPipPip
  • 742 posts
  • Gender:Male
  • Location:Melbourne Australia
  • Devices:2X Blade U8220 V9 Vega X10

I'm actually now fairly sure it won't work, i'll try it and let you know.

Tested on a boot image that should be locked down and it works :lol:
$ adb devices
List of devices attached 
????????????	offline
Welcome to minicom 2.4

OPTIONS: I18n 
Compiled on Mar  2 2010, 11:06:07.
Port /dev/ttyUSB0

Press CTRL-A Z for help on special keys													 
																							
																							
# id
uid=0(root) gid=0(root)
#

Now the problem is that the huawei boot parameters run the port at 115200 which won't work for me. Hopefully that is just a problem with my converter.

From there, get a copy of flash_image (it looks like it isn't included in the official roms) and put that and a custom recovery image on sdcard. The use flash_image to flash the recovery.

  • 0

#10
Tom G

Tom G

    Addict

  • Members
  • PipPipPipPipPip
  • 742 posts
  • Gender:Male
  • Location:Melbourne Australia
  • Devices:2X Blade U8220 V9 Vega X10

I was just thinking about that. A small board the size of a SIM card with spring loaded contacts that hit the right spots to make the RS232 connection. Flat ribbon cable coming off the board which you can then connect to the 3V adapter. That'll allow you to easily remove it from the phone when you don't need to debug. I'm pretty sure this is the same sort of thing the engineers use.

Take a look at this.

  • 0

#11
flibblesan

flibblesan

    Token Northern bloke

  • Assistant Admin Team
  • PipPipPipPipPipPip
  • 5,653 posts

From there, get a copy of flash_image (it looks like it isn't included in the official roms) and put that and a custom recovery image on sdcard. The use flash_image to flash the recovery.

flash_image.zip :lol:

  • 0

#12
flibblesan

flibblesan

    Token Northern bloke

  • Assistant Admin Team
  • PipPipPipPipPipPip
  • 5,653 posts

Take a look at this.


Ah as I suspected. Would be a very useful little thing to make.

Edited by flibblesan, 20 September 2010 - 11:56 AM.

  • 0

#13
Tom G

Tom G

    Addict

  • Members
  • PipPipPipPipPip
  • 742 posts
  • Gender:Male
  • Location:Melbourne Australia
  • Devices:2X Blade U8220 V9 Vega X10

Now the problem is that the huawei boot parameters run the port at 115200 which won't work for me. Hopefully that is just a problem with my converter.

It looks like the port always runs at 9600? I have been trying it with the original huawei 115200 setting and it still runs at 9600 (which I guess is why it wouldn't work when I had the PC end set at 115200).

  • 0

#14
BigBearMDC

BigBearMDC

    MOD - Mode ;)

  • Moderator Team
  • PipPipPipPipPipPip
  • 1,933 posts
  • Gender:Male
  • Location:Carinthia, Austria
  • Interests:I'm interested in µC's, programming, physics and astrophysics :)
  • Devices:Samsung Galaxy SII
  • Twitter:@BigBearMDC
That are really good news :lol:
I thought of that earlier, but I just haven't got a clue where this port is. One thing that would be really handy is to connect those wires to the headphone jack. Put a little DIP switch in the phone (if that's even necessary), cut out an edge somewhere to access them and just solder the headset's wires to a RS232>USB converter. This way you could access it without pulling out the SIM card or removing the battery. I don't know though if it would be possible to do this without the DIP switch. I think it should be no problem, but then you'd still have to open up the Pulse and find a way to solder the wires to the headphone jack, which could be difficult as it might be a BGA mounted one meaning you can't access the pins. I opened up my Pulse a while ago but I cant remember how to jack was soldered onto the PCB.

Best regards,
BB

Edit: Oh and if you get a notification the console output would get messed up of course, but you could mute it anyway once its booted up :)

  • 0
Visit our git repos [2.6.32 porting project, FroYo vendor config]Got a question? No problem, write me an email :)

If you like what I'm doing, help me buying an Orange San Francisco Posted Image
Posted Image
Donors:
  • Niels Heeren, David Dawkins, Mark Leman, James Baker, Heinz Peter Hippenstiel, KenBW2, flibblesan, GraviticVortex, bear807, TDK29

look for the Posted Image


#15
BigBearMDC

BigBearMDC

    MOD - Mode ;)

  • Moderator Team
  • PipPipPipPipPipPip
  • 1,933 posts
  • Gender:Male
  • Location:Carinthia, Austria
  • Interests:I'm interested in µC's, programming, physics and astrophysics :)
  • Devices:Samsung Galaxy SII
  • Twitter:@BigBearMDC

It looks like the port always runs at 9600? I have been trying it with the original huawei 115200 setting and it still runs at 9600 (which I guess is why it wouldn't work when I had the PC end set at 115200).


I think the FT232 works with every baudrate. I already used it in one of my projects in school, and I could even run it with 1 MBaud, which shouldn't be possible assuming I sent data from a PIC with 9600 baud :lol: Less baud also worked if I remember that correct. Just for reference, I was using an FT232RL from FTDI which is a really good choice imo.

  • 0
Visit our git repos [2.6.32 porting project, FroYo vendor config]Got a question? No problem, write me an email :)

If you like what I'm doing, help me buying an Orange San Francisco Posted Image
Posted Image
Donors:
  • Niels Heeren, David Dawkins, Mark Leman, James Baker, Heinz Peter Hippenstiel, KenBW2, flibblesan, GraviticVortex, bear807, TDK29

look for the Posted Image


#16
flibblesan

flibblesan

    Token Northern bloke

  • Assistant Admin Team
  • PipPipPipPipPipPip
  • 5,653 posts

That are really good news :)
I thought of that earlier, but I just haven't got a clue where this port is.

:lol:
I always knew it was the diagnostic RS232 port :(

  • 0

#17
BigBearMDC

BigBearMDC

    MOD - Mode ;)

  • Moderator Team
  • PipPipPipPipPipPip
  • 1,933 posts
  • Gender:Male
  • Location:Carinthia, Austria
  • Interests:I'm interested in µC's, programming, physics and astrophysics :)
  • Devices:Samsung Galaxy SII
  • Twitter:@BigBearMDC

:lol:
I always knew it was the diagnostic RS232 port :)


So why didn't you tell me??
:(

  • 0
Visit our git repos [2.6.32 porting project, FroYo vendor config]Got a question? No problem, write me an email :)

If you like what I'm doing, help me buying an Orange San Francisco Posted Image
Posted Image
Donors:
  • Niels Heeren, David Dawkins, Mark Leman, James Baker, Heinz Peter Hippenstiel, KenBW2, flibblesan, GraviticVortex, bear807, TDK29

look for the Posted Image


#18
DanWilson

DanWilson

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,821 posts
  • Gender:Male
  • Location:Glasgow
  • Interests:Trololololololololol
  • Devices:HTC Desire Z // HP Touchpad
  • Twitter:@PARTAYDan

So why didn't you tell me??
:(

We were toying with you.
We all knew all along.
We all laughed at you.
We are now all sorry.
:lol:

I still don't get what this is for, but I'm sure it will help us in some way.
:)

  • 0
HTC Desire Z - Something CM9 ish - giffgaff
HP Touchpad - AOKP? I dunno (ICS) // webOS // Debian - 30MB Interwebz

I should still be a mod. #JustSayin.

#19
flibblesan

flibblesan

    Token Northern bloke

  • Assistant Admin Team
  • PipPipPipPipPipPip
  • 5,653 posts

So why didn't you tell me??
:lol:


I assumed it was obvious. Old Nokia phones had a similar set of contact pads also.

  • 0

#20
Tom G

Tom G

    Addict

  • Members
  • PipPipPipPipPip
  • 742 posts
  • Gender:Male
  • Location:Melbourne Australia
  • Devices:2X Blade U8220 V9 Vega X10

I think the FT232 works with every baudrate. I already used it in one of my projects in school, and I could even run it with 1 MBaud, which shouldn't be possible assuming I sent data from a PIC with 9600 baud :lol: Less baud also worked if I remember that correct. Just for reference, I was using an FT232RL from FTDI which is a really good choice imo.

Yeah, the FT232 is working fine, it is the phone that is stuck at 9600. When I started playing with it I was matching the FT232 baud rate to the setting on the kernel cmdline and only getting garbage unless I ran them at 9600. It looks like no matter what I set the kernel to it always runs at 9600, so the default setting of ttyMSM2,115200n8 is actually 9600n8.
The headphone thing is a good idea, but would need a bit more work. It should be possible to get the sim card in with my setup, but the battery is going to be difficult, and having the FT232 board hanging off it isn't good if you want to use it as a phone.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users