fastboot fastbootd
Prepare
Check fastboot tool(Host):
fastboot --versionDownload fastboot tool and install(Host): platform-tools
Enable the fastbootd application(Device):
CONFIG_SYSTEM_FASTBOOTD=yEnable at least one transport: USB (
CONFIG_SYSTEM_FASTBOOTD_USB=y), TCP (CONFIG_SYSTEM_FASTBOOTD_TCP=y), or Serial (CONFIG_SYSTEM_FASTBOOTD_SERIAL=y)Start fastbootd(Device):
fastbootd &
Transports
The fastboot daemon supports multiple transport backends concurrently. Each transport can be individually enabled via Kconfig.
USB: Native USB fastboot protocol. Requires
CONFIG_USBFASTBOOT=y. Host:fastboot -s <SN> <command>or justfastboot <command>TCP: Fastboot TCP v1 protocol on port 5554. Requires
CONFIG_NET_TCP=y. Host:fastboot -s tcp:<device-ip>[:port] <command>Serial: UART transport using TCP v1 wire framing. Use
socaton the host to bridge the serial port to a TCP socket. Host:fastboot -s tcp:<host>:<socat-port> <command>
Commands
fastboot reboot [FLAG]: Reboot the device, more details for[FLAG]: g_resetflag and boardioc_softreset_subreason_efastboot flash <PARTITION> <FILENAME>: Flash partition<PARTITION>using the given<FILENAME>fastboot erase <PARTITION>: Erase given partition- Get Variables
fastboot getvar product: Get product namefastboot getvar kernel: Get kernel namefastboot getvar version: Get OS version stringfastboot getvar slot-count: Get slot countfastboot getvar max-download-size: Get max download size
- OEM
fastboot oem filedump <PARTITION> [OFFSET] [LENGTH]: Get<LENGTH>(full by default) bytes of<PARTITION>from<OFFSET>(zero by default)fastboot oem memdump <ADDRESS> <LENGTH>: Dump<LENGTH>bytes memory from address<ADDRESS>fastboot oem shell <COMMAND>: Execute custom commands. e.g. “oem shell ps”, “oem shell ls /dev/”
fastboot get_staged <OUT_FILE>: Writes data staged by the last command to file<OUT_FILE>. e.g. “oem filedump” and “oem memdump”
Examples
Exit fastboot mode:
fastboot rebootFlash app.bin to partition /dev/app:
fastboot flash app ./app.binErase partition /dev/userdata:
fastboot erase userdataDump partition /dev/app:
fastboot oem filedump /dev/appand thenfastboot get_staged ./dump_app.binDump memory from 0x44000000 to 0x440b6c00:
fastboot oem memdump 0x44000000 0xb6c00and thenfastboot get_staged ./mem_44000000_440b6c00.binCreate RAM disk “/dev/ram10” of size 320KB:
fastboot oem shell "mkrd -m 10 -s 512 640"Serial transport via socat:
sudo socat -t 0 PTY,link=/dev/ttyFB,raw,echo=0 TCP-LISTEN:5556,reuseaddr,fork,nodelay &thenfastboot -s tcp:127.0.0.1:5556 getvar version