4 The fastboot protocol is a mechanism for communicating with bootloaders
5 over USB. It is designed to be very straightforward to implement, to
6 allow it to be used across a wide range of devices and from hosts running
7 Linux, Windows, or OSX.
13 * Two bulk endpoints (in, out) are required
14 * Max packet size must be 64 bytes for full-speed and 512 bytes for
16 * The protocol is entirely host-driven and synchronous (unlike the
17 multi-channel, bi-directional, asynchronous ADB protocol)
23 1. Host sends a command, which is an ascii string in a single
24 packet no greater than 64 bytes.
26 2. Client response with a single packet no greater than 64 bytes.
27 The first four bytes of the response are "OKAY", "FAIL", "DATA",
28 or "INFO". Additional bytes may contain an (ascii) informative
31 a. INFO -> the remaining 60 bytes are an informative message
32 (providing progress or diagnostic messages). They should
33 be displayed and then step #2 repeats
35 b. FAIL -> the requested command failed. The remaining 60 bytes
36 of the response (if present) provide a textual failure message
37 to present to the user. Stop.
39 c. OKAY -> the requested command completed successfully. Go to #5
41 d. DATA -> the requested command is ready for the data phase.
42 A DATA response packet will be 12 bytes long, in the form of
43 DATA00000000 where the 8 digit hexidecimal number represents
44 the total data size to transfer.
46 3. Data phase. Depending on the command, the host or client will
47 send the indicated amount of data. Short packets are always
48 acceptable and zero-length packets are ignored. This phase continues
49 until the client has sent or received the number of bytes indicated
50 in the "DATA" response above.
52 4. Client responds with a single packet no greater than 64 bytes.
53 The first four bytes of the response are "OKAY", "FAIL", or "INFO".
56 a. INFO -> display the remaining 60 bytes and return to #4
58 b. FAIL -> display the remaining 60 bytes (if present) as a failure
59 reason and consider the command failed. Stop.
61 c. OKAY -> success. Go to #5
69 Host: "getvar:version" request version variable
71 Client: "OKAY0.4" return version "0.4"
73 Host: "getvar:nonexistant" request some undefined variable
75 Client: "OKAY" return value ""
77 Host: "download:00001234" request to send 0x1234 bytes of data
79 Client: "DATA00001234" ready to accept data
81 Host: < 0x1234 bytes > send data
83 Client: "OKAY" success
85 Host: "flash:bootloader" request to flash the data to the bootloader
87 Client: "INFOerasing flash" indicate status / progress
89 "OKAY" indicate success
91 Host: "powerdown" send a command
93 Client: "FAILunknown command" indicate failure
99 * Command parameters are indicated by printf-style escape sequences.
101 * Commands are ascii strings and sent without the quotes (which are
102 for illustration only here) and without a trailing 0 byte.
104 * Commands that begin with a lowercase letter are reserved for this
105 specification. OEM-specific commands should not begin with a
106 lowercase letter, to prevent incompatibilities with future specs.
108 "getvar:%s" Read a config/version variable from the bootloader.
109 The variable contents will be returned after the
112 "download:%08x" Write data to memory which will be later used
113 by "boot", "ramdisk", "flash", etc. The client
114 will reply with "DATA%08x" if it has enough
115 space in RAM or "FAIL" if not. The size of
116 the download is remembered.
118 "verify:%08x" Send a digital signature to verify the downloaded
119 data. Required if the bootloader is "secure"
120 otherwise "flash" and "boot" will be ignored.
122 "flash:%s" Write the previously downloaded image to the
123 named partition (if possible).
125 "erase:%s" Erase the indicated partition (clear to 0xFFs)
127 "boot" The previously downloaded data is a boot.img
128 and should be booted according to the normal
129 procedure for a boot.img
131 "continue" Continue booting as normal (if possible)
133 "reboot" Reboot the device.
135 "reboot-bootloader" Reboot back into the bootloader.
136 Useful for upgrade processes that require upgrading
137 the bootloader and then upgrading other partitions
138 using the new bootloader.
140 "powerdown" Power off the device.
147 The "getvar:%s" command is used to read client variables which
148 represent various information about the device and the software
151 The various currently defined names are:
153 version Version of FastBoot protocol supported.
154 It should be "0.3" for this document.
156 version-bootloader Version string for the Bootloader.
158 version-baseband Version string of the Baseband Software
160 product Name of the product
162 serialno Product serial number
164 secure If the value is "yes", this is a secure
165 bootloader requiring a signature before
166 it will install or boot images.
168 Names starting with a lowercase character are reserved by this
169 specification. OEM-specific names should not start with lowercase