[B]DBL[/B]
[B]OSBL[/B]
appsboot/eMMCboot
oemsbl.mbn
oemsbl[B]hd[/B].mbn
OSBL RAM address
GT-S8600 0x40000000
GT-I8150 0x04000000
GT-I9001 0x40000000
SGH-I847 0x04000000
Next on any command (No-op, version request, magic, ... I also trying AT commands...) it is responding:01 00 00 00 30 00 00 00 02 00 00 00 01 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
It is looks like for me that first 4 bytes is some command id, next 4 bytes is total pack length (first pack 48 bytes = 0x30, second pack 16 bytes = 0x10), rest is some command data. But I could not find such protocol description in available Qualcomm documents.
It does not looks like HDLC for me, it has no CRC of Flags at beginning/end.Over all protocol is HDLC, that 'carries' the qdloader commands, i dont have my reference data to hand plus am very rusty on the whole subject so may be wrong.
I would assume your return packet is no-op or cmd rejected.
Qcom chips can get stuck half between the pure qdloader (Total fail to PBL) and oem boot loader , this could be one of these cases, can you give more info on the dbl code you saw.
Well, QC devices are mainly using QMI or Sahara, so probably one of those, unless its waiting for a file, in which case it could be a simple serial transfer prot, like Kermit. What are you using to connect with, and how? Can you also post the output of "lsof | grep ttyUSB" and "getprop | grep ril"?Hi, we have some strage situation with the phone.
we have MSM8974 based phone which is in HS_USB QDLOAD mode (05c6:9008)
but it is responding strange to any command sent to it. Maybe someone could indentify this protocol, and point me to proper description document name?
On connect to /dev/ttyUSB0 (which is correspond to this device) we have following pack:
We connect standard usb cable to usb port. From PC side (Ubuntu) we use python do talk with serial port /dev/ttyUSB0 , which correspond to 05c6:9008 device.Well, QC devices are mainly using QMI or Sahara, so probably one of those, unless its waiting for a file, in which case it could be a simple serial transfer prot, like Kermit. What are you using to connect with, and how? Can you also post the output of "lsof | grep ttyUSB" and "getprop | grep ril"?
9008 Qualcomm HS-USB QDLoader 9008 Drivers
900e Qualcomm HS-USB Diagnostics 900E Drivers
I respond with (according to DBLTool)01 00 00 00 30 00 00 00 02 00 00 00 01 00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
And the I receive different packet02 00 00 00 30 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Which according to DBLTool is some memory request packet, where 0xd is some file ID, 0x00 - offset, 0x50 - length
user@pc:~$ lsusb
Bus 001 Device 006: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 045e:0039 Microsoft Corp. IntelliMouse Optical
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
user@pc:~$ lsof | grep ttyUSB0
user@pc:~$ lsof | grep ttyUSB
user@pc:~$ getprop | grep ril
user@pc:~$
user@pc~$ sudo lsof | grep ttyUSB0
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
user@pc:~$ sudo lsof | grep ttyUSB
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
user@pc:~$ sudo getprop | grep ril
user@pc:~$
Packet processing
The protocol minimizes packet processing by relying on the physical transport
layer to provide reliable transfer of data. No framing, HDLC (High-level Data
Link Control) encoding, or CRC (Cyclic Redundancy Check) is applied to the
packets at the protocol level. Each command packet type has a well-defined
structure which minimally contains a command ID and packet length. Using this
information, the length of each command packet can be validated by comparing the
length of the command packet received to either of two values:
1. The expected packet length for the given command ID
2. The length field contained in the packet itself
Sahara can easily be extended to support command packet validation by adding a
CRC field to the end of each packet. Data packets can also be validated for data
integrity using various authentication methods; however, this is beyond the
scope of the protocol.
Synchronous communication
The protocol assumes that all communication between the host and the target is
completely synchronous. Each command packet sent from the target to the host is
acknowledged with a command or data packet sent from the host back to the
target. Similarly, each command packet sent from the host to the target is
acknowledged with a command or data packet.
Although the link between the host and the target is expected to be reliable, if
an error occurs during the transmission of a command packet from the host to the
target, and as a result the target receives an erroneous packet, then the target
will send the host an error response and exit gracefully.
Timer mechanisms can be implemented on both the host and the target to support
the retransmission of packets in case of transmission failures. However, the
implementation of such mechanisms is outside the scope of the protocol – it
specifies only what happens when unexpected or erroneous packets are received on
the target side.
Extensibility The protocol defines a fixed set of command structures and packet
flows. However, it can easily be extended to support additional command
structures and state transitions (as described later in this document).
The 3 Sahara protocol defines two types of packets:
1. Command packets
2. Data packets
[SIZE=2] Command Packet:
+------------------+-----------------+------------+------------------+
| COMMAND LENGTH | PACKET LENGTH | OPTIONAL | OPTIONAL |
+------------------+-----------------+------------+------------------+
Data Packet:
+--------------------------------------------------------------------+
| RAW DATA (arbitrary number of bytes) |
+--------------------------------------------------------------------+
[/SIZE]
[SIZE=2]
-----------------------------------------------------------
ID Command Description
-----------------------------------------------------------
0x00 - Invalid
0x01 Hello Initialize connection and protocol
0x02 Hello Response Acknowledge connection/protocol, mode of operation
0x03 Read Data Read specified number of bytes from host
0x04 End of Image Transfer image transfer end / target transfer failure
0x05 Done Acknowledgement: image transfer is complete
0x06 Done Response Target is exiting protocol
0x07 Reset Instruct target to perform a reset
0x08 Reset Response Indicate to host that target is about to reset
0x09 Memory Debug Indicate to host: target debug mode & ready to transfer memory content
0x0A Memory Read Read number of bytes, starting from a specified address
0x0B Command Ready Indicate to host: target ready to receive client commands
0x0C Command Switch Mode [1]
0x0D Command Execute Indicate to host: to execute a given client command
0x0E Command Execute Response Indicate to host: target command execution status
0x0F Command Execute Data Indicate to target that host is ready to receive (more) data
all - Invalid
-----------------------------------------------------------
0x0-0x8 Protocol Version [B]1.0[/B] and above
0x9-0xA Protocol Version [B]2.0[/B] and above
0xB-0xF Protocol Version [B]2.1[/B] and above
-----------------------------------------------------------
[1] Indicate to target to switch modes:
- Image Transfer Pending mode
- Image Transfer Complete mode
- Memory Debug mode
- Command mode
[/SIZE]
Nice spotting eva.@VBlack : That is the Sahara protocol. From: 80-N1008-1
(Special thanks to http://asciiflow.com/ )Code:[SIZE=2] Command Packet: +------------------+-----------------+------------+------------------+ | COMMAND LENGTH | PACKET LENGTH | OPTIONAL | OPTIONAL | +------------------+-----------------+------------+------------------+ Data Packet: +--------------------------------------------------------------------+ | RAW DATA (arbitrary number of bytes) | +--------------------------------------------------------------------+ [/SIZE]
The Sahara Commands:
Code:[SIZE=2] ----------------------------------------------------------- ID Command Description ----------------------------------------------------------- 0x00 - Invalid 0x01 Hello Initialize connection and protocol 0x02 Hello Response Acknowledge connection/protocol, mode of operation 0x03 Read Data Read specified number of bytes from host 0x04 End of Image Transfer image transfer end / target transfer failure 0x05 Done Acknowledgement: image transfer is complete 0x06 Done Response Target is exiting protocol 0x07 Reset Instruct target to perform a reset 0x08 Reset Response Indicate to host that target is about to reset 0x09 Memory Debug Indicate to host: target debug mode & ready to transfer memory content 0x0A Memory Read Read number of bytes, starting from a specified address 0x0B Command Ready Indicate to host: target ready to receive client commands 0x0C Command Switch Mode [1] 0x0D Command Execute Indicate to host: to execute a given client command 0x0E Command Execute Response Indicate to host: target command execution status 0x0F Command Execute Data Indicate to target that host is ready to receive (more) data all - Invalid ----------------------------------------------------------- 0x0-0x8 Protocol Version [B]1.0[/B] and above 0x9-0xA Protocol Version [B]2.0[/B] and above 0xB-0xF Protocol Version [B]2.1[/B] and above ----------------------------------------------------------- [1] Indicate to target to switch modes: - Image Transfer Pending mode - Image Transfer Complete mode - Memory Debug mode - Command mode [/SIZE]
Thank you very much!
UPDATE:
What About Windows
You already have QPST and QXDM, us poor linux users dont. I am sure cygwin can help you there, some code changes may be required.
Enough Already, Gimme
https://github.com/jcsullins/qdloader
How Do I use it?
First you need to get the hex file for your device, if it's a msm8660 then your need mrpg8660.hex, they are found elsewhere, links will be posted later but for now use the search
then you need to run hex2bin on the hex file to have mrpgXXXX.bin which you rename hex.bin
then you need your emmc payload, this normally would be xxxx_msimage.mbn which you rename hex2.bin
then perl qdload.pl while you device is plugged in, there will be some debug output showing first and second stage uploads.
0x7e 0x0a 0x63 0x74 0x7e