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

# 设置设备

> 刷写 Qualcomm Linux 后,连接串行控制台、验证软件版本,然后在 IQ-9075 EVK 上选择 USB (ADB)、Wi-Fi 或以太网作为主机到设备的持续连接方式。

在[刷写 Qualcomm Linux](./update-software/overview) 之后,使用本页面启动设备。首先通过调试串行控制台登录并验证软件版本。之后,根据你的环境选择以下连接方式中的**一种**:

| 选项            | 适用场景                     |
| ------------- | ------------------------ |
| **USB (ADB)** | 没有可用网络;主机通过 USB 线缆直接连接设备 |
| **Wi-Fi**     | 无线访问;通过网络 SSH 登录设备       |
| **以太网**       | 有线网络访问;通过网络 SSH 登录设备     |

<Note>
  如果你**尚未**刷写设备,请先从[**更新软件**](./update-software/overview)开始。
</Note>

## 设置调试 UART

调试 UART 为你提供进入设备的串行控制台,是刷写后登录和检查设备的主要方式。

1. 将 micro-USB 线缆的一端连接到 IQ-9075 EVK 上的 micro-USB 端口。
2. 将另一端连接到主机电脑。

<img src="https://mintcdn.com/qualcomm-staging/TEuuywLWbysJVmUv/Linux/images/device-setup/iq9075-evk-microUSBport.png?fit=max&auto=format&n=TEuuywLWbysJVmUv&q=85&s=194eaf7a09fafd57389bd9425b69fc2e" alt="Micro-USB 端口位置" width="926" height="709" data-path="Linux/images/device-setup/iq9075-evk-microUSBport.png" />

3. 根据主机操作系统打开串行控制台:

<Tabs>
  <Tab title="Ubuntu">
    安装 `screen`:

    ```shell theme={null}
    sudo apt update
    sudo apt install screen
    ```

    列出串行设备:

    ```shell theme={null}
    ls /dev/ttyUSB*
    ```

    **示例输出:**

    ```shell theme={null}
    /dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2  /dev/ttyUSB3
    ```

    IQ-9075 EVK 的板载适配器会暴露四个串行设备;**主控制台是第二个**(`/dev/ttyUSB1`)。以 115200 波特率打开它:

    ```shell theme={null}
    sudo screen /dev/ttyUSB1 115200
    ```

    <Note>
      在打开 UART 控制台会话之前,请确认没有其他进程正在使用该串口。多个应用程序访问同一 UART 设备可能导致挂起或控制台输出不一致。<br />

      要识别当前正在使用串口的进程,请运行<br />

      * `sudo lsof /dev/ttyUSB1`

      如果发现任何残留的 `screen` 或 `minicom` 会话,请使用以下命令终止它们

      * `sudo killall screen`
      * `sudo killall minicom`
    </Note>
  </Tab>

  <Tab title="Windows">
    1. 下载 [**PuTTY**](https://putty.software/) 并完成安装。
    2. 打开 PuTTY 并选择 **Serial**。
    3. 将 **Serial line** 设置为在**设备管理器**中检测到的 COM 端口,速度设置为 **115200**。

    <Note>
      FTDI 适配器会暴露多个 COM 端口。Converter B(**第二个**功能端口)承载 Main Domain 控制台。右键单击每个 COM 端口 → **属性** → 查看 **位置** 字段以进行识别。
    </Note>

    如果未检测到 UART 端口,请安装 FTDI 驱动:

    * x86 和 Arm:[FTDI VCP 驱动](https://ftdichip.com/drivers/vcp-drivers/)

          <img src="https://mintcdn.com/qualcomm-staging/TEuuywLWbysJVmUv/Linux/images/device-setup/Putty_serialport_setup.png?fit=max&auto=format&n=TEuuywLWbysJVmUv&q=85&s=1f2f77bdc7105c610a8092773e302910" alt="PuTTY 串口设置" width="445" height="425" data-path="Linux/images/device-setup/Putty_serialport_setup.png" />
  </Tab>

  <Tab title="macOS">
    列出串行设备:

    ```shell theme={null}
    ls /dev/cu.*
    ```

    连接 micro-USB 线缆后,板载 FT4232H 四通道 UART 控制器会提供四个串行接口(T0-T3)。T1 接口以 **/dev/cu.usbserial-device\_unique\_serial\_number-T1** 形式暴露,用作**主串行调试控制台**。其余接口(T0、T2 和 T3)保留用于其他通信和调试用途。找到你的设备节点(T1)并使用 screen 命令以 115200 波特率打开它:

    ```shell theme={null}
    screen /dev/cu.usbserial-NNPMP271002T1 115200
    ```
  </Tab>
</Tabs>

4. 按 **Enter** 调出登录提示,然后登录:
   * **用户名:**`root`
   * **密码:**`oelinux123`

## 验证软件版本

确认设备正在运行 Qualcomm Linux:

```shell theme={null}
cat /etc/os-release
```

**预期输出:**

```text theme={null}
ID=qcom-distro-sota
NAME="Qualcomm Linux Reference Distro(OTA-enabled)"
VERSION="2.0"
PRETTY_NAME="Qualcomm Linux Reference Distro (OTA-enabled) 2.0"
```

检查内核版本:

```shell theme={null}
uname -a
```

**预期输出:**

```text theme={null}
Linux iq-9075-evk 6.18.30-... #1 SMP PREEMPT ... aarch64 GNU/Linux
```

<Note>
  如果版本不匹配,或者根本无法进入登录提示,说明镜像缺失或已过时。请返回[**更新软件**](./update-software/overview)并刷写最新的 Qualcomm Linux。
</Note>

## 连接设备

选择以下选项之一。三种方式都需要通过 UART 控制台执行初始设置命令(参见[设置调试 UART](#set-up-the-debug-uart))。首次设置完成后,USB (ADB) 可为你提供直接的 USB shell;Wi-Fi 和以太网则允许你通过 SSH 连接。

<Tabs>
  <Tab title="USB (ADB)">
    ADB(Android Debug Bridge)为你提供进入设备的 USB shell。由于 `adbd` 默认处于禁用状态,你需要先通过 UART 启用一次,ADB 才能工作。

    **1. 在 Ubuntu 主机上安装 ADB:**

    ```shell theme={null}
    sudo apt install android-tools-adb android-tools-fastboot
    ```

    验证:

    ```shell theme={null}
    adb --version
    ```

    <Note>
      对于 Windows 和 Mac 主机,请从 [**Android SDK platform tools**](https://developer.android.com/tools/releases/platform-tools#downloads) 安装 ADB
    </Note>

    **2. 在设备上启用 adbd**(一次性操作,在 UART 控制台执行):

    ```shell theme={null}
    touch /etc/usb-debugging-enabled
    systemctl enable --now android-tools-adbd
    ```

    **3. 连接并打开 shell:**

    使用 USB Type-C 线缆将主机连接到设备。

    <img src="https://mintcdn.com/qualcomm-staging/TEuuywLWbysJVmUv/Linux/images/device-setup/iq9-evk-ports.png?fit=max&auto=format&n=TEuuywLWbysJVmUv&q=85&s=cbfb628df78fdcb4494b4db23e99524b" alt="USB Type-C 端口位置" width="926" height="656" data-path="Linux/images/device-setup/iq9-evk-ports.png" />

    ```shell theme={null}
    adb devices
    adb shell
    ```

    **示例输出:**

    ```text theme={null}
    List of devices attached
    68f592a device
    ```
  </Tab>

  <Tab title="Wi-Fi">
    **1. 连接到 Wi-Fi 网络**(在 UART 控制台执行):

    ```shell theme={null}
    nmcli dev wifi list
    nmcli dev wifi connect <WiFi-SSID> password <WiFi-password>
    ```

    **示例** — 网络 `QualcommWiFi`,密码 `1234567890`:

    ```shell theme={null}
    nmcli dev wifi connect QualcommWiFi password 1234567890
    ```

    **示例输出:**

    ```text theme={null}
    Device 'wlp1s0' successfully activated with 'd7b990bd-3b77-4b13-b239-b706553abaf8'.
    ```

    **2. 获取设备 IP 地址:**

    ```shell theme={null}
    ip addr show wlp1s0
    ```

    **3. 从主机 SSH 连接**(必须在同一网络中):

    ```shell theme={null}
    ssh root@<ip-address>
    ```

    出现提示时输入密码 `oelinux123`。
  </Tab>

  <Tab title="以太网">
    使用以太网线缆将 EVK 上的 RJ45 端口连接到网络路由器。套件中不包含以太网线缆。

    **1. 获取设备 IP 地址**(在 UART 控制台执行):

    ```shell theme={null}
    ip addr show end0
    ```

    输出中 `inet` 的值即为设备 IP 地址。

    **2. 从主机 SSH 连接**(必须在同一网络中):

    ```shell theme={null}
    ssh root@<ip-address>
    ```

    **示例:**

    ```shell theme={null}
    ssh root@192.168.0.222
    ```

    出现提示时输入密码 `oelinux123`。
  </Tab>
</Tabs>

## 连接显示器

使用**有源** Mini DisplayPort 转 DisplayPort 线缆(盒内附带),或**有源** Mini DisplayPort 转 HDMI 适配器(不附带),将显示器连接到 EVK 上的 **DisplayPort0 (JEDP0)** 或 **JEDP1**。

<Note>
  显示输出仅通过 DisplayPort 连接器工作。USB Type-C 端口不提供显示输出。
</Note>

<img src="https://mintcdn.com/qualcomm-staging/TEuuywLWbysJVmUv/Linux/images/device-setup/Miniport_to_displayport_cable.png?fit=max&auto=format&n=TEuuywLWbysJVmUv&q=85&s=cdec17c3c844b9f924cbd776da7a4883" alt="Mini-DisplayPort 转 DisplayPort 线缆" width="849" height="926" data-path="Linux/images/device-setup/Miniport_to_displayport_cable.png" />

给设备上电并确认显示器显示预期的启动输出。

## 连接 Bluetooth 外设

使用 `bluetoothctl` 配对并连接 Bluetooth 键盘或鼠标。

1. 打开 Bluetooth 管理器:

   ```shell theme={null}
   bluetoothctl
   ```

2. 开启电源并开始扫描:

   ```shell theme={null}
   power on
   scan on
   ```

3. 等待你的设备出现,并记下其 MAC 地址:

   ```text theme={null}
   [NEW] Device F8:7D:76:9D:9B:6B MyKeyboard
   ```

4. 配对、信任并连接:

   ```shell theme={null}
   pair F8:7D:76:9D:9B:6B
   trust F8:7D:76:9D:9B:6B
   connect F8:7D:76:9D:9B:6B
   ```

5. 停止扫描并退出:

   ```shell theme={null}
   scan off
   exit
   ```

设备在以后启动时会自动重新连接。有关 Wi-Fi 和 Bluetooth 的完整详情,参见 [**Wi-Fi 和 Bluetooth**](./peripherals-interfaces/WiFi-BT)。

## SBC(单板计算机)模式

要将 EVK 用作带键盘、鼠标和显示器的独立计算机:

<img src="https://mintcdn.com/qualcomm-staging/TEuuywLWbysJVmUv/Linux/images/device-setup/iq9075_evk_sbc.png?fit=max&auto=format&n=TEuuywLWbysJVmUv&q=85&s=cadfe360315ee25df25b127ae75630a6" alt="SBC 连接示例" width="714" height="536" data-path="Linux/images/device-setup/iq9075_evk_sbc.png" />

* \*\*电源:\*\*连接 12 V 适配器。
* \*\*串行控制台:\*\*micro-USB 连接到主机以获取 UART 日志(设置完成后可选)。
* \*\*USB 集线器:\*\*将带供电的 USB 集线器连接到 USB Type-C 端口以接入多个外设。
* \*\*键盘和鼠标:\*\*插入 USB 集线器。
* \*\*USB 摄像头:\*\*连接到 USB 集线器(必须符合 UVC 标准)。
* \*\*MIPI 摄像头:\*\*连接到开发板上的 MIPI CSI 连接器。
* \*\*显示器:\*\*Mini DisplayPort 转 DisplayPort 线缆,或有源 Mini DisplayPort 转 HDMI 适配器。

## 后续步骤

* [探索外设和接口](./peripherals-interfaces/peripheral_interface_overview)
