> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用 Fastboot 刷写软件

Fastboot 允许您刷写软件镜像（例如引导加载程序），并有助于系统恢复。

Linux 和 Windows 主机均支持 Fastboot。要进入 Fastboot 模式，您可以使用 Fastboot 热键。

> [!NOTE]
>
> 请使用 36.0.0 或更早版本的 fastboot 主机工具。

## **使用热键进入 Fastboot**

设备通电后，拨动 Fastboot DIP 开关。

> [!NOTE]
>
> 具体的开关/按键组合因开发板而异。请参阅您的开发套件硬件文档，确定具体的 DIP 开关。

下图显示了设备进入 Fastboot 模式时的 Fastboot 日志。

![Fastboot 检测](https://mintcdn.com/qualcomm-prod/eYaEBFH0xlFq53OY/System/Boot/media/k2c-qli-boot/fastboot-dectection.PNG?fit=max\&auto=format\&n=eYaEBFH0xlFq53OY\&q=85\&s=a0476acf1ba308d3ecb2aee19c405837)

## **Fastboot 命令**

当系统检测到 Fastboot 模式时，您可以运行相应的 Fastboot 命令。

**表：Fastboot 命令**

| **命令** | **用法** | **示例或用例** |
| - | - | - |
| `fastboot reboot` | 允许您重新启动设备。 | 示例命令： `fastboot reboot` 在以下情况后可能需要重新启动系统： <ul><li>刷写软件镜像</li><li>完成软件更新</li></ul> |
| `fastboot devices` | 如果识别并连接到设备，Fastboot 会显示设备信息。 | 示例命令： `fastboot devices` |
| `fastboot getvar <variable>` | 从各个分区检索数据。 以下是支持的 `getvar` 命令。 <ul><li>`fastboot getvar partition-size:system`</li><li>`fastboot getvar partition-size:xbl_a`</li><li>`fastboot getvar kernel`</li><li>`fastboot getvar max-download-size`</li></ul> | Fastboot 支持多个变量。可以通过此命令检索这些变量的数据。 示例命令： `fastboot getvar version` |
| `fastboot flash <partition name> <full path to the SW image>` | 刷写软件镜像。 | 要刷写 `xbl_config.elf` 镜像，请运行： `fastboot flash xbl_config_a xbl_config.elf` 其中： <ul><li>`xbl_config_a` 表示分区标签</li><li>`xbl_config.elf` 是要刷写的软件镜像</li></ul> |
| `fastboot erase` | 擦除分区。 | 示例命令： `fastboot erase xbl_config_a` 擦除 `xbl_config_a` 分区。 |
| `fastboot continue` | 继续启动。 | 示例命令： `fastboot continue` 启动 OS。 |

## **使用 Fastboot 进行恢复**

当 systemd-boot 镜像和 ESP 损坏时，Fastboot 可作为恢复解决方案。

systemd-boot 镜像从 EFI 系统分区（ESP）启动。在这种情况下，Fastboot 会自动作为恢复选项启动，允许您重新刷写 ESP。
