[Galaxy S II Q&A, Help & Troubleshooting] E:V:A:
So after having played enough with my I9100, I keep on running into, the term "debug" all over the place.

However, this term is used differently in different contexts. So things can get confusing, very quickly.

Let me first list the most common places where I have found this. Then let's try to find out what

they all do and if they're related. I don't know all the answers yet!

0. To turn on "USB debugging" (on the phone):

Settings --> Applications --> Development --> USB debugging

This is the most common question for a first time Android owner, and needless to say the simplest to answer.

It allows you to connect your device as a client via USB to a host, for use with Kies, or anything else.

I have this option always on, and can see no reason why to turn it off, unless you are planning to use

your phone in USB host-mode. (Connecting another USB memory/disk/mouse/keyboard etc to you phone.)

1. Some "properties":

[B]# getprop
[/B]...
[ro.debuggable]: [0]
[persist.service.adb.enable]: [1]
[ro.secdevenc]: [true]
[init.svc.debuggerd]: [running]
[init.svc.adbd]: [running]
...

This is simply pretty printed concatenated version of both (2) AND (3) below.

Q1: What exactly do these properties do?

[B]# cat /system/build.prop[/B]
...
persist.service.usb.setting=0
ro.secdevenc=true
...

These are the parameters used for building/compiling the Kernel. They also use the proper format for the get/setprops command argument.

[B]# cat /default.prop[/B]
...
ro.secure=1
ro.debuggable=0
persist.service.adb.enable=0
...

This is your customized extra properties that can also be set somewhere else...but where?

Q2: Where else and how can we set these?

[Editing the file is not possible for a non-rooted phone.]

[B]# cat /proc/cmdline[/B]
loglevel=4
console=ram
[COLOR=Red]sec_debug.enable=0
sec_debug.enable_user=0[/COLOR]
c1_watchdog.sec_pet=5
sec_log=0x100000@0x4d900000
s3cfb.bootloaderfb=0x5ec00000
ld9040.get_lcdtype=0x0
consoleblank=0
lpj=3981312
vmalloc=144m

Now this is a rather cryptic line. However, the two "sec_" prefixed lines, refers to

"Samsung Electronic Corporation" and not to "secure", and are probably used for factory testing. These

are properties, but it is possible that they are used to set/read by the read only properties:

ro.debuggable [0]

ro.factorytest [0]

Q3. What exactly do variables do and say?

[And where can they be set?]

2. ServiceMode Debug options

Then we have some "debug" settings in the ServiceMode application that can be started by dialing:

*#197328640#

Then we are presented with a menu with the following options:

MAIN MENU --> COMMON --> (a) DEBUG INFO
(b) DIAG CONF
MAIN MENU --> (c) DEBUG SCREEN

a) On the "DIAG CONFIG" menu:

[1] LOG VIA USB
[*]
[2] LOG VIA UART
[3] LOG VIA IPC
[4] SPEED 115200
[5] SPEED 921600
[*]
[6] [COLOR=Red]DBG MSG ON[/COLOR] (toggle)
[7] RAMDUMP OFF (toggle)
[8] DUMP ALL TRACE

This one is about obtaining diagnostic logs from the hardware.

You can generally play with this, as it will not affect the ordinary

behavior of your

phone. Worst case is that it may fill up your phone with huge log files, so keep it off.

The interesting ones are [1-3] and [6].

Q4: Where exactly is the log located and how to read it?

A4: Probably they just go to /proc/kmsg which is also used by logcat and dmesg, but with added tags and verbosity.

Q5: What debug messages are added there, and where do they go?

b) On the "DEBUG INFO" menu:

[1] MM REJECT CAUSE
[2] LOG DUMP
[3] PCM LOGGING (OFF)
[4] I2S LOGGING (OFF)

This one is probably also about the phone/modem. What is actually logged here I don't know.

Q6: What is actually logged here? (And where does it go?)

c) On the "DEBUG SCREEN" menu:

[1] BASIC INFORMATION
[2] MM INFORMATION
[3] RR INFORMATION
[4] NEIGHBOR CELL
[5] GPRS INFORMATION
[6] SIM INFORMATION
[7] HANDOVER
[8] PHONE CONTROL
[9] ANTENNA/ADC

This screen is all about hardware debugging and has nothing

to do with connection software, so don't mess with this one!

3. PhoneUtil UART / USB

UART
([B]o[/B]) MODEM
( ) PDA
USB
( ) MODEM
([B]o[/B]) PDA

If USB is set to MODEM, you will NOT be able to communicate with, or connect your

phone to your PC via USB, since your PC will no longer recognize your device.

Thus it requires special OEM drivers probably only available to Samsung

technicians. AFAIK. (I'd love to have them!)

However, UART is a different story, it can be used to get a serial terminal shell

directly from a hardware connection, but that is for another thread...

-------------------------------------------------------------------------------

Q7:

a) Where are the local UART ports/devices that are used for this?

b) In this case, does MODEM/PDA specifically refer to BP/AP or something else?

-------------------------------------------------------------------------------