Difference between revisions of "Fastboot"

From Rockchip open source Document
Jump to: navigation, search
Line 79: Line 79:
  
 
(The firmware package was generated from  android source code which is “make updatepackage”)
 
(The firmware package was generated from  android source code which is “make updatepackage”)
 +
  
 
== Reboot ==
 
== Reboot ==
  
 To recovery
+
 To recovery:
 
<pre>fastboot oem recovery </pre>
 
<pre>fastboot oem recovery </pre>
  
&nbsp;To recovery and restore
+
&nbsp;To recovery and restore:
 
<pre>fastboot oem recovery:wipe_data</pre>
 
<pre>fastboot oem recovery:wipe_data</pre>
  
To Reboot
+
To Reboot:
 
<pre>fastboot reboot</pre>
 
<pre>fastboot reboot</pre>
  
Line 94: Line 95:
 
<pre>fastboot reboot-bootloader</pre>
 
<pre>fastboot reboot-bootloader</pre>
  
To continue
+
To continue:
 
<pre>fastboot continue </pre>
 
<pre>fastboot continue </pre>
  
 
=== Lock and Unlock the Device ===
 
=== Lock and Unlock the Device ===
  
To unlock
+
To unlock:
 
<pre>fastboot oem unlock</pre>
 
<pre>fastboot oem unlock</pre>
  
To &nbsp;confirm unlock(input &nbsp;it in 5 minutes after inputing fastboot oem unlock command)
+
To &nbsp;confirm unlock(input &nbsp;it in 5 minutes after inputing fastboot oem unlock command):
 
<pre>fastboot oem unlock_accep</pre>
 
<pre>fastboot oem unlock_accep</pre>
  
To lock the device
+
To lock the device:
 
<pre>fastboot oem lock
 
<pre>fastboot oem lock
 
</pre>
 
</pre>
  
 +
&nbsp;
  
 
=== Special Command ===
 
=== Special Command ===
  
To boot from specifc firmware
+
To boot from specifc firmware:
 
<pre>fastboot boot <kernel> [ <ramdisk> ]</pre>
 
<pre>fastboot boot <kernel> [ <ramdisk> ]</pre>
  
临时从指定固件启动
+
临时从指定固件启动 (kernel目前支持Image/zImage,需要将dtb存于kernel末尾,或者resource分区中) To get log info
(kernel目前支持Image/zImage,需要将dtb存于kernel末尾,或者resource分区中)
 
To get log info
 
 
<pre>fastboot oem log </pre>
 
<pre>fastboot oem log </pre>
 +
 
To execute u-Boot command:
 
To execute u-Boot command:
 
<pre>fastboot oem ucmd <UBOOT cmds></pre>
 
<pre>fastboot oem ucmd <UBOOT cmds></pre>

Revision as of 07:30, 9 March 2017

Introduction

Fastboot is a protocol that can be used to re-flash partitions on your device (update the flash file system in your devices). It is this small tool that comes with the Android SDK (Software Developer Kit), which is an alternative to the Recovery Mode for doing installations and updates. It first comes with Android. Google have submit the fastboot code to mainline U-boot. So we can use this protocol to flash partition on your device. There are three way to enter fastboot mode





Fastboot command

Rockchip use 0x2207 as its USB vendor ID. This VID is not in Google's original fastboot code. So every fastboot command have to use "-i" parameter to specify vid to fastboot.
To list all the Rockchip devices attached to your USB port in fastboot mode.

<code>$ sudo fastboot -i 0x2207 devices
0123456789AB fastboot</code>

To flash loader

<code>$ sudo fastboot -i 0x2207 flash loader "path to your loader"</code>

To flash android boot image

<code>$ sudo fastboot -i 0x2207 flash boot_a "path to your boot image"
0123456789AB fastboot</code>

To flash android system image

<code>$ sudo fastboot -i 0x2207 flash system_a "path to your system image"
0123456789AB fastboot</code>

To get version:

fastboot getvar version

To get version:

fastboot getvar version-bootloader

To get unlocked:

fastboot getvar unlocked 

To get locked:

fastboot getvar secure

To get product information:

fastboot getvar product

To get serialno:

fastboot getvar serialno

To get partition type:

fastboot getvar partition-type:<partition_name>

To get partition size:

fastboot getvar partition-size:<partition_name>

To get partition offset:

fastboot getvar partition-offset:<partition_name>


Download the Image

To flash image:

fastboot flash <partition_name> <filename>

 (For example:fastboot flash system system.img)

When download the parameter or loader,you need assign the partition name as "parameter" or "loader"

To update firmware:

fastboot update <filename> 

(The firmware package was generated from  android source code which is “make updatepackage”)


Reboot

 To recovery:

fastboot oem recovery 

 To recovery and restore:

fastboot oem recovery:wipe_data

To Reboot:

fastboot reboot

To reboot and enter rockusb loader mode

fastboot reboot-bootloader

To continue:

fastboot continue 

Lock and Unlock the Device

To unlock:

fastboot oem unlock

To  confirm unlock(input  it in 5 minutes after inputing fastboot oem unlock command):

fastboot oem unlock_accep

To lock the device:

fastboot oem lock

 

Special Command

To boot from specifc firmware:

fastboot boot <kernel> [ <ramdisk> ]

临时从指定固件启动 (kernel目前支持Image/zImage,需要将dtb存于kernel末尾,或者resource分区中) To get log info

fastboot oem log 

To execute u-Boot command:

fastboot oem ucmd <UBOOT cmds>

Fastboot Unlock

fastboot锁住状态下,不允许烧写及执行oem命令,初始状态为锁住。

解锁流程大致如下:

1、执行fastboot oem unlock

2、5秒内继续执行fastboot oem unlock_accept

3、机器会重启进入recovery恢复出厂设置

4、再次进入fastboot,则fastboot getvar unlocked应该返回"yes"(设备已解锁)

 

如果设备进入fastboot状态后,fastboot命令提示未发现设备,则需要在命令中加入-i参数指定设备vid,例如fastboot -i 0x2207 getvar unlocked