# 使用 GitHub 工作流进行编译

按照详细说明同步 Qualcomm Yocto 和 QIR SDK 层，并编译机器人镜像以及 QIR SDK artifact。

Warning

不建议重新编译 QIR SDK，因为编译过程对于非专业人士来说比较复杂。仅当您了解流程并有以下需求时，才编译 QIR SDK：

- 为没有预编译镜像的设备编译镜像，例如 Qualcomm^®^ IQ-8 Beta 评估套件。更多详细信息，参见 [支持的平台](https://docs.qualcomm.com/doc/80-70022-265Y/topic/introduction.html#section-amr-ck3-5bc)。
- 向 QIR SDK 添加新功能。
- 更改目标镜像的内容。
- 修复 QIR SDK 中的错误。
- 优化 QIR SDK 的性能。
- 更改某些组件的版本。

1. [设置主机以进行编译](https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-host-machine-setup)
2. [同步最新的 Yocto 项目](https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-sync-yocto-project)
3. [同步 Qualcomm Linux 固件（可选）](https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-sync-qualcomm-linux-firmware)
4. [搭建编译环境](https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-set-up-build-environment)
5. [编译机器人镜像和 QIR SDK artifact](https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-build-robotics-image-and-qirp-sdk-artifacts)

## 设置主机以进行编译

准备好主机进行编译和安装操作，确保其符合 [主机要求](https://docs.qualcomm.com/doc/80-70022-265Y/topic/qirp_sdk_build.html#section-host-machine-requirements) 的要求。

1. 安装所需的软件包。

sudo apt update
        sudo apt install repo gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool locales tar python-is-python3 file libxml-opml-simplegen-perl vim whiptail g++ libgtest-dev
        Copy to clipboard
2. 搭建本地环境。

sudo locale-gen en_US.UTF-8
        sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
        export LC_ALL=en_US.UTF-8
        export LANG=en_US.UTF-8
        Copy to clipboard
3. 更新 git 配置。

# Check if your identity is configured in .gitconfig
        git config --get user.email
        git config --get user.name
        
        # Run the following commands if you do not have your account identity set in .gitconfig
        git config --global user.email <Your email ID>
        git config --global user.name <"Your Name">
        
        # Add the following UI color option for output of console (optional)
        git config --global color.ui auto
        
        # Add the following git configurations to fetch large size repositories and to avoid unreliable connections
        git config --global http.postBuffer 1048576000
        git config --global http.maxRequestBuffer 1048576000
        git config --global http.lowSpeedLimit 0
        git config --global http.lowSpeedTime 999999
        Copy to clipboard
4. 将 `/bin/sh` 符号链接更改为默认指向 `/bin/bash`。

sudo ln -sf /bin/bash /bin/sh
        Copy to clipboard
5. 按照 [install-the-repo-utility](https://github.com/qualcomm-linux/qcom-manifest/blob/qcom-linux-scarthgap/README.md#install-the-repo-utility) 中的步骤安装 repo 工具。

## 同步 Qualcomm Yocto 和 QIR SDK 层

使用 `robotics-release-manifest`（值为 `-m`）下载 Qualcomm Yocto 和 QIR SDK 层。

Note

要获取 `robotics-release-manifest`，请参阅 [Qualcomm^®^ Intelligent Robotics Product SDK (QIR SDK) 2.0 Release Notes](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-260)。

cd <workspace>
    repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-scarthgap -m qcom-6.6.97-QLI.1.6-Ver.1.2.1_robotics-sdk-1.2.xml
    repo sync -c -j8
    Copy to clipboard

同步完成后，运行 `tree -L 2 <workspace>`。您可以看到以下输出：

> 
> 
> (shell) tree -L 2
> 
> 
> .
> 
> 
> ├── layers
> 
> 
> │   ├── meta-openembedded
> 
> 
> │   ├── meta-qcom
> 
> 
> │   ├── meta-qcom-distro
> 
> 
> │   ├── meta-qcom-hwe
> 
> 
> │   ├── meta-qcom-qim-product-sdk
> 
> 
> │   ├── meta-qcom-robotics
> 
> 
> │   ├── meta-qcom-robotics-distro
> 
> 
> │   ├── meta-qcom-robotics-sdk
> 
> 
> │   ├── meta-ros
> 
> 
> │   ├── meta-security
> 
> 
> │   ├── meta-selinux
> 
> 
> │   ├── meta-tensorflow
> 
> 
> │   ├── meta-updater
> 
> 
> │   ├── meta-virtualization
> 
> 
> │   └── poky
> 
> 
> ├── qirp-build
> 
> 
> ├── setup-environment -&gt; layers/meta-qcom-distro/set\_bb\_env.sh
> 
> 
> └── setup-robotics-environment -&gt; layers/meta-qcom-robotics-distro/set\_bb\_env.sh
> 
> 
> 16 directories, 3 files

## 同步 Qualcomm® Linux 固件（可选）

<details class="sd-sphinx-override sd-dropdown sd-card sd-mb-3">
<summary class="sd-summary-title sd-card-header">
显示内容<div class="sd-summary-down docutils">
<span class="svg-1 sd-octicon sd-octicon-chevron-down"><svg version="1.1" width="1.5em" height="1.5em" class="sd-octicon sd-octicon-chevron-down" viewbox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M5.22 8.72a.75.75 0 000 1.06l6.25 6.25a.75.75 0 001.06 0l6.25-6.25a.75.75 0 00-1.06-1.06L12 14.44 6.28 8.72a.75.75 0 00-1.06 0z"></path></svg></span></div>
<div class="sd-summary-up docutils">
<span class="svg-2 sd-octicon sd-octicon-chevron-up"><svg version="1.1" width="1.5em" height="1.5em" class="sd-octicon sd-octicon-chevron-up" viewbox="0 0 24 24" aria-hidden="true"><path fill-rule="evenodd" d="M18.78 15.28a.75.75 0 000-1.06l-6.25-6.25a.75.75 0 00-1.06 0l-6.25 6.25a.75.75 0 101.06 1.06L12 9.56l5.72 5.72a.75.75 0 001.06 0z"></path></svg></span></div>
</summary><div class="sd-summary-content sd-card-body docutils">
<div class="admonition warning">
<p class="admonition-title">Warning</p><ul class="simple">
<li><p class="sd-card-text">此信息仅供授权用户使用。如果您未获得授权，请跳过此部分。</p></li>
<li><p class="sd-card-text">此信息为可选，不会影响您编译 QIR SDK。</p></li>
<li><p class="sd-card-text">其中包含 Qualcomm 专有固件，例如 <code class="docutils literal notranslate"><span class="pre">AOP</span></code> 固件、<code class="docutils literal notranslate"><span class="pre">BOOT</span></code> 固件和 <code class="docutils literal notranslate"><span class="pre">DSP</span></code> 固件。</p></li>
<li><p class="sd-card-text">此信息包含 Qualcomm 专有示例应用程序，例如 <code class="docutils literal notranslate"><span class="pre">Follow</span> <span class="pre">Me</span></code>。</p></li>
</ul>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p class="sd-card-text">有关访问级别的信息，包括 <code class="docutils literal notranslate"><span class="pre">public</span></code>、 和 <code class="docutils literal notranslate"><span class="pre">authorized</span></code>，请参阅<a href="https://www.qualcomm.com/support/working-with-qualcomm" rel="noopener noreferrer" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://www.qualcomm.com/support/working-with-qualcomm')">与 Qualcomm 合作</a>。</p>
</div><ol class="arabic">
<li><p class="sd-card-text">按照 <a href="https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#id2"><span class="problematic" id="id3">:guilabel:`Install QSC CLI`​ 和 ​:guilabel:`Set up the Ubuntu host computer`​​ 下 `Qualcomm Linux 编译指南 &lt;https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/build_addn_info.html#install-qsc-cli&gt;`_</span></a>中的说明获取授权并配置环境。</p></li>
<li><p class="sd-card-text">按照 <a href="https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/build_addn_info.html#sync-firmware" rel="noopener noreferrer" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/build_addn_info.html#sync-firmware')">Qualcomm Linux 编译指南：同步固件</a>中的步骤，使用 <a href="https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-260" rel="noopener noreferrer" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-260')">Qualcomm<sup>®</sup> Intelligent Robotics Product SDK (QIR SDK) 2.0 Release Notes</a> （值为 <code class="docutils literal notranslate"><span class="pre">-b</span></code>） 中的 <code class="docutils literal notranslate"><span class="pre">firmware</span> <span class="pre">release</span> <span class="pre">tag</span></code> 同步 Qualcomm Linux 固件。在大多数情况下，您只需运行：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>git clone -b r1.0_00106.0 --depth 1 https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-1-0_ap_standard_oem_nm-qirpsdk.git
</code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div>
</div>
<p class="sd-card-text">如果您需要其他固件版本，请参阅提供的配置链接。</p>
</li>
<li><p class="sd-card-text">按照 <a href="https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/build_addn_info.html#build-firmware" rel="noopener noreferrer" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-254/build_addn_info.html#build-firmware')">Qualcomm Linux 编译指南：编译固件</a>中的步骤编译 Qualcomm Linux 固件。</p>
<p class="sd-card-text"><img alt="ico-bd-fw" style="width: 240.0px; height: 44.800000000000004px;" aria-label="ico-bd-fw" src="data:image/png;base64,UklGRroHAABXRUJQVlA4TK4HAAAvK8ENABVZYbVtcuUoMDAwcGBgYGDDwMDAwIYNAwMDGwYGBgZeGNgwsGHY7Pvm2Zdyd677Rlez7zOl1gesbJZMLM/mYmYFC32zevZSI2u2mt0yKhmZ1bCCP5ytdFFptpJmu89FpYssE49MPKxgsaDSbCVlK6eRJDlSvpzy37qDCw8efP1MI9uqs0B+JVECMjIlI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XxEBFhF69BDoQAjEaIOIAjIg7giIgDiBUQAbE6gAAiIgDLPRBxAEdEABwRARyxgogAiAiAdBBEBKDotxMcsQKOiOBYBHCkgyAiAGO3nQCOCG1FcCwCOHJArCAH1QF5pAV5BHRADnLH3sP4oeK9/fQfEg9JHBoPRZw/vrN7nNvHofDsir1H5VB05+pntnXrmofCz917tEPSmbVu2+ah8HP3HY1DqvMwzu/v2TXOrX4ovGOP+4/6S3M4fZXyMLbmsPivQ+pL/8flCe/hfIf9MN7jeYnX/spL/uc/3xMC"></p>
<p class="sd-card-text">对于前述编译，如果出现以下 zip 文件，则表明固件预编译成功：</p>
<blockquote>
<div><table class="docutils align-default" id="id9">
<caption><span class="caption-text"><strong>固件文件</strong></span></caption>
<thead>
<tr class="row-odd"><th class="head"><p class="sd-card-text">开发套件</p></th>
<th class="head"><p class="sd-card-text">文件路径</p></th>
<th class="head"><p class="sd-card-text">固件文件</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p class="sd-card-text">Qualcomm Dragonwing<sup>TM</sup> RB3 Gen 2 机器视觉开发套件</p></td>
<td><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">&lt;FIRMWARE_ROOT&gt;/qualcomm-linux-spf-1-0_ap_standard_oem_nomodem/QCM6490.LE.1.0/common/build/ufs/bin</span></code></p></td>
<td><ul class="simple">
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCM6490_bootbinaries.zip</span></code></p></li>
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCM6490_dspso.zip</span></code></p></li>
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCM6490_fw.zip</span></code></p></li>
</ul>
</td>
</tr>
<tr class="row-odd"><td><p class="sd-card-text">Qualcomm Dragonwing<sup>TM</sup> IQ-9075 评估套件</p></td>
<td><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">&lt;FIRMWARE_ROOT&gt;/qualcomm-linux-spf-1-0_ap_standard_oem_nm-qimpsdk/QCS9100.LE.1.0/common/build/ufs/bin</span></code></p></td>
<td><ul class="simple">
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS9100_bootbinaries.zip</span></code></p></li>
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS9100_dspso.zip</span></code></p></li>
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS9100_fw.zip</span></code></p></li>
</ul>
</td>
</tr>
<tr class="row-even"><td><p class="sd-card-text">IQ-8 Beta 评估套件</p></td>
<td><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">&lt;FIRMWARE_ROOT&gt;/qualcomm-linux-spf-1-0_ap_standard_oem_nm-qimpsdk/QCS8300.LE.1.0/common/build/ufs/bin</span></code></p></td>
<td><ul class="simple">
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS8300_bootbinaries.zip</span></code></p></li>
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS8300_dspso.zip</span></code></p></li>
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS8300_fw.zip</span></code></p></li>
</ul>
</td>
</tr>
</tbody>
</table>
</div></blockquote>
</li>
<li><p class="sd-card-text">获取 <code class="docutils literal notranslate"><span class="pre">meta-qcom-robotics-extras</span></code> 和 <code class="docutils literal notranslate"><span class="pre">meta-qcom-extras</span></code> 层。</p>
<blockquote>
<div><div class="admonition note">
<p class="admonition-title">Note</p><ul class="simple">
<li><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">-b</span></code> 参数表示 <code class="docutils literal notranslate"><span class="pre">&lt;meta-qcom-robotics-extras-release-tag&gt;</span></code>。要获取 <code class="docutils literal notranslate"><span class="pre">&lt;meta-qcom-robotics-extras-release-tag&gt;</span></code>，请参阅 <a href="https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-260" rel="noopener noreferrer" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-260')">Qualcomm<sup>®</sup> Intelligent Robotics Product SDK (QIR SDK) 2.0 Release Notes</a>。例如，<code class="docutils literal notranslate"><span class="pre">r1.0_00107.0</span></code>。</p></li>
<li><p class="sd-card-text">要获取 <code class="docutils literal notranslate"><span class="pre">&lt;product&gt;</span></code> 的值，请参阅下表。</p></li>
</ul>
</div>
<table class="longtable docutils align-default" id="id10">
<caption><span class="caption-text"><strong>表：</strong> <code class="docutils literal notranslate"><span class="pre">product</span></code> <strong>额外层的值</strong></span></caption>
<thead>
<tr class="row-odd"><th class="head"><p class="sd-card-text">参数</p></th>
<th class="head"><p class="sd-card-text">RB3 Gen 2 机器视觉开发套件</p></th>
<th class="head"><p class="sd-card-text">IQ-9075 评估套件</p></th>
<th class="head"><p class="sd-card-text">IQ-8 Beta 评估套件</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">product</span></code></p></td>
<td><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCM6490.LE.1.0</span></code></p></td>
<td><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS9100.LE.1.0</span></code></p></td>
<td><p class="sd-card-text"><code class="docutils literal notranslate"><span class="pre">QCS8300.LE.1.0</span></code></p></td>
</tr>
</tbody>
</table>
<div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>git clone -b r1.0_00107.0 --depth 1 https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-1-0_hlos_oem_metadata.git
mkdir -p layers/meta-qcom-robotics-extras
mkdir -p layers/meta-qcom-extras
cp -rf qualcomm-linux-spf-1-0_hlos_oem_metadata/&lt;product&gt;/common/config/meta-qcom-extras/* layers/meta-qcom-extras/
cp -rf qualcomm-linux-spf-1-0_hlos_oem_metadata/&lt;product&gt;/common/config/meta-qcom-robotics-extras/* layers/meta-qcom-robotics-extras/
</code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div>
</div>
</div></blockquote>
</li>
<li><p class="sd-card-text">按照 <a href="https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-set-up-build-environment"><span class="std std-ref">搭建编译环境</span></a> 中的步骤搭建编译环境。</p></li>
<li><p class="sd-card-text">配置固件变量。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>cd &lt;workspace&gt;
export CUST_ID=&quot;213195&quot;
export FWZIP_PATH=&quot;&lt;FIRMWARE_ROOT&gt;/qualcomm-linux-spf-1-0_ap_standard_oem_nomodem/&lt;product&gt;/common/build/ufs/bin&quot;
</code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div>
</div>
</li>
<li><p class="sd-card-text">配置 <code class="docutils literal notranslate"><span class="pre">EXTRALAYERS</span></code> 变量以将固件层添加到编译中。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>cat &gt;&gt; conf/bblayers.conf &lt;&lt;EOF
EXTRALAYERS = &quot; \\
\${WORKSPACE}/layers/meta-qcom-robotics-extras \\
\${WORKSPACE}/layers/meta-qcom-extras \\
&quot;
EOF
</code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div>
</div>
</li>
<li><p class="sd-card-text">运行 <a href="https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-build-robotics-image-and-qirp-sdk-artifacts"><span class="std std-ref">编译机器人镜像和 QIR SDK artifact</span></a> 中的编译命令。</p></li>
</ol>
</div>
</details>

## 搭建编译环境

运行以下命令搭建编译环境：

> 
> 
> cd <workspace>
>     MACHINE=<Machine_name> DISTRO=<Distro_name> QCOM_SELECTED_BSP=<Build_override> source setup-robotics-environment <Build_directory>
>     Copy to clipboard
> 
> 
> Note
> 
> 
> 如果您在 Arm64 Mac 的 Ubuntu Server VM 上编译 QIR SDK，请运行以下设置命令：
> 
> 
> Arm64 主机仅支持 `custom` 编译变体。
> 
> 
> MACHINE=<Machine_name> DISTRO=<Distro_name>  SDKMACHINE=aarch64 QCOM_SELECTED_BSP=custom source setup-robotics-environment <Build_directory>
>     Copy to clipboard

> 
> 
> 表：编译参数
> 
> 
> | **参数** | **Qualcomm Dragonwing™ RB3 Gen 2 机器视觉套件** | **Qualcomm Dragonwing™ IQ-9075 评估套件** | **IQ-8 Beta 评估套件** |
> | --- | --- | --- | --- |
> | **Machine\_name** | `qcs6490-rb3gen2-vision-kit` | `qcs9075-iq-9075-evk` | `qcs8300-ride-sx` |
> | **Distro\_name** | `qcom-robotics-ros2-jazzy` | `qcom-robotics-ros2-jazzy` | `qcom-robotics-ros2-jazzy` |
> | **Build\_override** | `custom` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">custom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">base</span></code></p></li><br></ul> | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">custom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">base</span></code></p></li><br></ul> |
> | **Build\_directory** | `build-qcs6490-custom` | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">build-qcs9075-custom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">build-qcs9075-base</span></code></p></li><br></ul> | <ul class="simple"><br><li><p><code class="docutils literal notranslate"><span class="pre">build-qcs8300-custom</span></code></p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">build-qcs8300-base</span></code></p></li><br></ul> |
> 
> 
> 
> Note
> 
> - 基础版本适用于需要纯上游和开源软件协议栈且不需要 Qualcomm 专有软件和电源/性能附加值软件的开发者。
> - 自定义版本提供丰富的功能，包含 Qualcomm 的附加值软件，例如 SDK 和功耗性能改进。它适合那些在其产品中依赖 Qualcomm 增值软件和专有/下游软件的开发者。
> - 有关更多详情，请参阅[软件概述](https://docs.qualcomm.com/bundle/publicresource/topics/80-70022-252/qualcomm-linux-sw-overview.html)。

## 编译机器人镜像和 QIR SDK artifact

运行以下命令编译 QIR SDK：

> 
> 
> cd <workspace>
>     ../qirp-build qcom-robotics-full-image
>     Copy to clipboard
> 
> 
> Note
> 
> 
> 此命令运行时间较长。根据网络和机器性能，可能需要 3-5 个小时。
> 
> 
> **结果：**
> 
> 
> Tab RB3 Gen 2 机器视觉开发套件
> Tab IQ-9075 评估套件
> Tab IQ-8 Beta 评估套件
> 
> - QIR SDK artifact：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs6490-custom/tmp-glibc/deploy/qirpsdk_artifacts/qcs6490-rb3gen2-vision-kit/qirp-sdk_<version>.tar.gz
> >         Copy to clipboard
> - 机器人镜像：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs6490-custom/tmp-glibc/deploy/images/qcs6490-rb3gen2-vision-kit/qcom-robotics-full-image
> >         Copy to clipboard
> 
> **使用** `custom` **override 的示例**
> 
> - QIR SDK artifact：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs9075-custom/tmp-glibc/deploy/qirpsdk_artifacts/qcs9075-iq-9075-evk/qirp-sdk_<version>.tar.gz
> >         Copy to clipboard
> - 机器人镜像：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs9075-custom/tmp-glibc/deploy/images/qcs9075-iq-9075-evk/qcom-robotics-full-image
> >         Copy to clipboard
> 
> 
> 
> **使用** `base` **override 的示例**
> 
> - QIR SDK artifact：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs9075-base/tmp-glibc/deploy/qirpsdk_artifacts/qcs9075-iq-9075-evk/qirp-sdk_<version>.tar.gz
> >         Copy to clipboard
> - 机器人镜像：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs9075-base/tmp-glibc/deploy/images/qcs9075-iq-9075-evk/qcom-robotics-full-image
> >         Copy to clipboard
> 
> **使用** `custom` **override 的示例**
> 
> - QIR SDK artifact：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs8300-custom/tmp-glibc/deploy/qirpsdk_artifacts/qcs8300-ride-sx/qirp-sdk_<version>.tar.gz
> >         Copy to clipboard
> - 机器人镜像：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs8300-custom/tmp-glibc/deploy/images/qcs8300-ride-sx/qcom-robotics-full-image
> >         Copy to clipboard
> 
> 
> 
> **使用** `base` **override 的示例**
> 
> - QIR SDK artifact：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs8300-base/tmp-glibc/deploy/qirpsdk_artifacts/qcs8300-ride-sx/qirp-sdk_<version>.tar.gz
> >         Copy to clipboard
> - 机器人镜像：
> 
> 
> 
> > 
> > 
> > <workspace>/build-qcs8300-base/tmp-glibc/deploy/images/qcs8300-ride-sx/qcom-robotics-full-image
> >         Copy to clipboard

## 将机器人镜像刷写到设备

参阅[刷写机器人镜像](https://docs.qualcomm.com/doc/80-70022-265Y/topic/quick_start.html#flash-img-qs)，使用 [编译机器人镜像和 QIR SDK artifact](https://docs.qualcomm.com/doc/80-70022-265Y/topic/github_workflow.html#section-build-robotics-image-and-qirp-sdk-artifacts) 中生成的 `qcom-robotics-full-image` 将机器人镜像刷写到设备。

Last Published: Nov 11, 2025

[Previous Topic
使用 QSC CLI 编译](https://docs.qualcomm.com/bundle/publicresource/80-70022-265Y/topics/qsc_cli.md) [Next Topic
使用 Docker 编译](https://docs.qualcomm.com/bundle/publicresource/80-70022-265Y/topics/docker_workflow.md)