Sony Debug Assist board

From eLinux.org
Revision as of 16:13, 6 November 2014 by Tim Bird (talk | contribs)
Jump to: navigation, search

Here is information about the Sony Debug Assist board.

Description

Xperia Z1 phone with Sony Debug Assist board

This board is used internally at Sony Mobile for remotely managing phones and phone development boards. Internally, it also goes by the name "CDB assist".

This board connects to the host using 2 USB cables and the the device under control via:

  1. a USB cable
  2. multiple jumper wires
  3. power connectors

The board allows for:

  • control of power to the device
    • This includes control of voltage level and current delivered to device
  • serial debug uart (access to kernel serial console)
  • control of button presses to 3 different buttons
    • e.g. for a phone, this could control the power, volume up, and volume down buttons
  • control of USB connection between host and phone
    • vbus power on/off (to simulate connecting and disconnecting the USB connection from device to host)

Although primarily designed for use with Sony Mobile phones, this debug board can be used with any device and allow control of power, buttons (like reset and boot mode buttons) and usb.

copied from Androiki site

Sony Debug Assist v2.1 has the following features:

  • Control port exposed as a virtual serial port ACM interface, bitrate settings are ignored on this interface
  • Programmable VBat output from 0 to ~15V, 0-2500mA (max 10W) (with readout), powered from the Control USB port
  • A secondary USB "Through" port where the VBus voltage can be disabled from the CDB Control port (to simulate USB cable detach)
  • Three CMOS switches meant to simulate key presses (for reflash, power-on etc)
  • Level shifted UART that will adapt to an external voltage reference provided by target (0.9V - ~4.5V). Bitrate range 50bps to 2Mbps, exposed as a second virtual serial port ACM interface
    • UART voltage reference can be monitored from control port

Here is a picture of Sony Debug Assist version 2.0 and version 2.1 CDBAssist-v2-v21.jpg

Connections

The debug assist board is connected to the host using 2 USB cables. One USB cable presents to the host 2 interfaces:

  • a control interface for viewing the status and adjusting the settings of the debug assist board
  • a USB-serial interface for the phone's debug uart

These interfaces show up on the Linux host as /dev/ttyACM0 and /dev/ttyACM1 respectively

The second USB cable presents to the host the USB connection from the phone's USB port.

Here is ASCII art diagram for a normal debug setup:

 device to test                     Sony debug board                    Host computer
 +------------+                                                  +-----------------------------------------+
 |     power+ |----+           +-------------------------+       | /dev/ttyACM0  (control interface)       |
 |     power- |----+-----------|power +/- ------+-> usb0 |-------|    display and control power, buttons   |
 |            |                |                |        |       |    and vusb                             |
 |    button1 |----------------|button A wire --+        |       | /dev/ttyACM1  (serial port for device)  |
 |    button2 |----------------|button B wire --+        |       |    usually has kernel serial console    |
 |    button3 |----------------|button C wire --+        |       |                                         |
 |     ground |----------------|ground          |        |       |                                         |
 |    uart TX |----------------|uart TX wire  --+        |       |                                         |
 |    uart RX |----------------|uart RX wire  --+        |       |                                         |
 |            |                |        +-vusb--+        |       |                                         |
 |            |                |        |                |       |                                         |
 |    usb port|----------------|usb up -+---------- usb1 |-------| /dev/??? - (usb connection with device) |
 |            |                +-------------------------+       |                                         |
 +------------+                                                  |                                         |
                                                                 +-----------------------------------------

Using the Sony Debug Assist board

To see the status and control screen for the debug assist board, connect a USB cable from the "control" connector on the board to your Linux host machine, and on the host machine, access /dev/ttyACM0.

ex: minicom -o -D /dev/ttyACM0

The interface should look like this:

 WJ CDB Assist HW v2.1 / SW r52
 
 Voltage Setpoint/Actual           Current Setpoint/Actual
04000mV/00000mV  2500mA/0000mA
04000mV/00000mV  2500mA/0000mA
 
 [P/p] VBAT:off  [u] Set VBAT voltage  [i] Set VBAT current
 [A/a] Btn1:ON   [B/b] Btn2:off  [C/c] Btn3:off
 [V/v] VBus:ON   UART Vref=0000mV

This shows the voltage and current for the VBAT (power) outputs from the board, as well as the status of the lines that can be controlled from the board.

You can manually control the settings by entering the letter for the a particular function. Most line-control settings have dual-letter combination with upper-case to turn the line on and lower-case to turn the line off.

For example, to turn the power on to the phone, type 'P' (capital-P). This corresponds to the VBAT power output lines from the debug board.

To turn the power off, type 'p' (lower-case-p).

On some terminals, the voltage and current display are shown in a double-tall font. But on other terminals, the voltage and current display are shown as two duplicate lines (shown in this example).

Specific actions for Sony phones

Here are some descriptions of how to use the debug board to perform specific operations on Sony phones:

Sony Xperia Z1

For the Z1 phone:

  • Btn1 (A) is the power button
  • Btn2 (B) is the volume up button
  • Btn3 (C) is the volume down button

The VBAT voltage for the phone should be set to 04000mV and the VBAT current should be set to 2500 mA.

The phone can be booted directly to the installed kernel, or placed in one of two different bootloader modes, depending on the buttons held when the power button is pushed.

To boot to the installed kernel, do the following:

  • apply power (turn on VBAT: press 'P')
  • "press" the power button (turn on Btn1: press 'A', then press 'a')
    • only "press" the button momentarily ('a' releases the button)

To reset (soft power down) the phone:

  • make sure phone has VBAT power
  • hold power and volume up for 3 seconds (press 'AB', wait for phone to vibrate 3 times, then press 'ab')

To turn all power off:

  • turn VBAT off (press 'p')
  • turn VUSB off (press 'v')

To reboot into fastboot mode:

  • make sure phone has VBAT power (press 'P')
  • make sure phone starts with VBus off (press 'v')
  • hold volume up (press 'B')
  • apply VBus (press 'V')
    • wait for fastboot mode to initialize
  • release volum up (press 'b')
  • (summary: P v B V b )

Messages

The serial port messages for an Xperia Z phone cold-booting into fastboot mode should look something like the following:

[160] TA config read fro BOOT (1270-3115 S1_Boot_MSM8974_LA1.0_67)
[180] GPIO HW_ID[3:0]: [0010]
[190] soc_ver: 0x20001, pmic_ver: 3.1
[190] die_id: 0x2c0d56, oem_product_id: 0x4, otp_lock: 0x155
PBA ID: 1271-5063 (2)
Startup flags: [USB INSERTED]Warmboot reason: [COLDBOOT][200] TriLED: probed
[WARNING IN FAC 0x7 CODE 0x6 @ S1/boot/src/s1boot_lib_api.c:762]:
  Device key handling failed!
[WARNING IN FAC 0x8 CODE 0xA @ S1/boot/src/s1boot_lib_api.c:239]:
  MiscTA data not accepted by security manager!
Rooting status is: Done[ERROR @ S1/boot/src/s1boot_config_parser.c:578]:
  MiscTA unit 2473 could not be read!
[260] USB ID: 1787
[270] OTG State is invalid
[550] charertype: 0
[550] VBUS is valid
Service mode detected: [FASTBOOT][550] S1 decisions complete, image to boot is 4.
[680] USB init ept @ 0x7c85e000
[700] fastboot_init()
[1070] fastboot: processing commands