mirror of
https://github.com/apache/nuttx.git
synced 2026-10-12 16:50:21 +00:00
Some checks are pending
Build Documentation / build-html (push) Waiting to run
MemBrowse Memory Report / changes-filter (push) Waiting to run
MemBrowse Memory Report / load-targets (push) Waiting to run
MemBrowse Memory Report / identical (push) Blocked by required conditions
MemBrowse Memory Report / analyze (push) Blocked by required conditions
Add Transports section describing USB, TCP, and Serial backends with host-side command syntax. Update Prepare section to reference per-transport Kconfig options. Signed-off-by: fangpeina <fangpeina@xiaomi.com>
47 lines
3.3 KiB
ReStructuredText
47 lines
3.3 KiB
ReStructuredText
======================
|
|
``fastboot`` fastbootd
|
|
======================
|
|
Prepare
|
|
==========================
|
|
|
|
- Check fastboot tool(Host): :code:`fastboot --version`
|
|
- Download fastboot tool and install(Host): `platform-tools <https://developer.android.com/tools/releases/platform-tools>`__
|
|
- Enable the fastbootd application(Device): :code:`CONFIG_SYSTEM_FASTBOOTD=y`
|
|
- Enable at least one transport: USB (:code:`CONFIG_SYSTEM_FASTBOOTD_USB=y`), TCP (:code:`CONFIG_SYSTEM_FASTBOOTD_TCP=y`), or Serial (:code:`CONFIG_SYSTEM_FASTBOOTD_SERIAL=y`)
|
|
- Start fastbootd(Device): :code:`fastbootd &`
|
|
|
|
Transports
|
|
==========================
|
|
|
|
The fastboot daemon supports multiple transport backends concurrently. Each transport can be individually enabled via Kconfig.
|
|
|
|
- **USB**: Native USB fastboot protocol. Requires :code:`CONFIG_USBFASTBOOT=y`. Host: :code:`fastboot -s <SN> <command>` or just :code:`fastboot <command>`
|
|
- **TCP**: Fastboot TCP v1 protocol on port 5554. Requires :code:`CONFIG_NET_TCP=y`. Host: :code:`fastboot -s tcp:<device-ip>[:port] <command>`
|
|
- **Serial**: UART transport using TCP v1 wire framing. Use ``socat`` on the host to bridge the serial port to a TCP socket. Host: :code:`fastboot -s tcp:<host>:<socat-port> <command>`
|
|
|
|
Commands
|
|
==========================
|
|
- :code:`fastboot reboot [FLAG]`: Reboot the device, more details for :code:`[FLAG]`: `g_resetflag <https://github.com/apache/nuttx-apps/blob/master/nshlib/nsh_syscmds.c#L114>`__ and `boardioc_softreset_subreason_e <https://github.com/apache/nuttx/blob/master/include/sys/boardctl.h#L458>`__
|
|
- :code:`fastboot flash <PARTITION> <FILENAME>`: Flash partition :code:`<PARTITION>` using the given :code:`<FILENAME>`
|
|
- :code:`fastboot erase <PARTITION>`: Erase given partition
|
|
- Get Variables
|
|
- :code:`fastboot getvar product`: Get product name
|
|
- :code:`fastboot getvar kernel`: Get kernel name
|
|
- :code:`fastboot getvar version`: Get OS version string
|
|
- :code:`fastboot getvar slot-count`: Get slot count
|
|
- :code:`fastboot getvar max-download-size`: Get max download size
|
|
- OEM
|
|
- :code:`fastboot oem filedump <PARTITION> [OFFSET] [LENGTH]`: Get :code:`<LENGTH>` (full by default) bytes of :code:`<PARTITION>` from :code:`<OFFSET>` (zero by default)
|
|
- :code:`fastboot oem memdump <ADDRESS> <LENGTH>`: Dump :code:`<LENGTH>` bytes memory from address :code:`<ADDRESS>`
|
|
- :code:`fastboot oem shell <COMMAND>`: Execute custom commands. e.g. "oem shell ps", "oem shell ls /dev/"
|
|
- :code:`fastboot get_staged <OUT_FILE>`: Writes data staged by the last command to file :code:`<OUT_FILE>`. e.g. "oem filedump" and "oem memdump"
|
|
|
|
Examples
|
|
==========================
|
|
- Exit fastboot mode: :code:`fastboot reboot`
|
|
- Flash app.bin to partition /dev/app: :code:`fastboot flash app ./app.bin`
|
|
- Erase partition /dev/userdata: :code:`fastboot erase userdata`
|
|
- Dump partition /dev/app: :code:`fastboot oem filedump /dev/app` and then :code:`fastboot get_staged ./dump_app.bin`
|
|
- Dump memory from 0x44000000 to 0x440b6c00: :code:`fastboot oem memdump 0x44000000 0xb6c00` and then :code:`fastboot get_staged ./mem_44000000_440b6c00.bin`
|
|
- Create RAM disk "/dev/ram10" of size 320KB: :code:`fastboot oem shell "mkrd -m 10 -s 512 640"`
|
|
- Serial transport via socat: :code:`sudo socat -t 0 PTY,link=/dev/ttyFB,raw,echo=0 TCP-LISTEN:5556,reuseaddr,fork,nodelay &` then :code:`fastboot -s tcp:127.0.0.1:5556 getvar version`
|