> ## 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.

# BSP image build with QSC CLI

## Introduction

This document provides instructions to sync, build, and flash images
using the `qsc-cli` tool. It is intended for registered users who have access
to Qualcomm’s proprietary resources. The `qsc-cli` tool streamlines the workflow
by providing a unified interface that runs tasks in containerized environments,
ensuring simplicity, consistency, and reproducibility.

At a high level, you will learn the following:

* Set up and authenticate `qsc-cli` – [Install QSC-CLI](#install-qsc-cli)
* Sync required sources and dependencies using `qsc-cli` – [Download the software](#download-the-software)
* Build Qualcomm images using `qsc-cli` – [Build the default configuration](#build-the-default-configuration)

## Supported SoCs

The following SoCs are supported in this guide. If you do not see your SoC listed, the QSC CLI build process described here does not apply to your device.

The following SoCs are supported by this document. If your chipset is not
listed, the firmware build process described here does not apply to your device.

| SoC      | Description                                    | Supported |
| -------- | ---------------------------------------------- | --------- |
| QCS6490  | Qualcomm Dragonwing™ RB3 Gen 2 Vision Kit      | ✓         |
|          | Qualcomm Dragonwing™ RB3 Gen 2 Core Kit        | ✓         |
|          | Qualcomm Dragonwing™ RB3 Gen 2 Industrial Kit  | ✓         |
| QCS5430  | Qualcomm Dragonwing™ RB3 Gen 2 Lite Vision Kit | ✓         |
|          | Qualcomm Dragonwing™ RB3 Gen 2 Lite Core Kit   | ✓         |
| IQ9      | Qualcomm Dragonwing™ IQ-9075 Evaluation Kit    | ✓         |
| IQ8      | Qualcomm Dragonwing™ IQ-8275 Evaluation Kit    | ✓         |
| IQ6      | Qualcomm Dragonwing™ IQ-615 Evaluation Kit     | ✓         |
| IQ-X7181 | Qualcomm Dragonwing™ IQ-X7181 Evaluation Kit   | ✓         |
| IQ-X5121 | Qualcomm Dragonwing™ IQ-X5121 Evaluation Kit   | ✓         |

## Install QSC-CLI

`qsc-cli` is a command-line tool provided by Qualcomm that offers an end-to-end workflow
for accessing, managing, and building Qualcomm software. Follow these steps to install
`qsc-cli` on your system:

* Register your Qualcomm email ID by visiting the [Qualcomm Support Page](https://www.qualcomm.com/support/working-with-qualcomm).

* Download the Debian package for `qsc-cli`:

  <CodeGroup>
    ```bash x86 theme={null}
    wget https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Software_Center/Linux/Debian/latest.deb -O qsc_installer.deb
    ```

    ```bash ARM64 theme={null}
    wget https://softwarecenter.qualcomm.com/api/download/software/tools/Qualcomm_Software_Center/Linux/ARM64/Debian/latest.deb -O qsc_installer.deb
    ```
  </CodeGroup>

* Install the `qsc-cli` Debian package:
  ```bash theme={null}
  sudo apt update
  sudo apt install ./qsc_installer.deb
  ```

* Sign in to `qsc-cli` using your registered email ID:
  ```bash theme={null}
  qsc-cli login -u <username>
  ```

## Configuration parameters

The following table lists the `--product`, `--release`, and `--image` parameter
values for the `chip-software download` command. Each product maps to one or
more firmware images that must be downloaded for a complete build.

| --product         | --release | --image                                                                                                                      |
| ----------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| QCM6490.LE.2.0    | r00131.2  | ADSP.HT.5.5.c8  <br />CDSP.HT.2.5.c3 <br />AOP.HO.3.6     <br />BOOT.MXF.1.0.c1<br />TZ.XF.5.29                              |
| QCS9100.LE.2.0    | r00131.2  | DSP.AT.1.0.1    <br />AOP.HO.3.6.1   <br />BOOT.MXF.1.0.c1<br />TZ.XF.5.29.1                                                 |
| QCS8300.LE.2.0    | r00131.3  | DSP.AT.1.0.1    <br />AOP.HO.3.6.1   <br />BOOT.MXF.1.0.c1<br />TZ.XF.5.29.1                                                 |
| QCS615.LE.2.0     | r00131.2  | BOOT.MXF.1.0.c1 <br />AOP.HO.3.6.2   <br />TZ.XF.5.29.1   <br />ADSP.VT.5.2.c6 <br />CDSP.VT.2.2.c4                          |
| Hamoa\_IOT.LE.2.0 | r00014.1  | BOOT.MXF.2.4.2  <br />AOP.HO.5.2     <br />TZ.XF.5.0      <br />ADSP.HT.5.9    <br />CDSP.HT.2.9.c1 <br />BOOT.MXF\_UEFI.2.5 |
| Purwa\_IOT.LE.2.0 | r00014.1  | BOOT.MXF.2.4.2  <br />AOP.HO.5.2     <br />TZ.XF.5.0      <br />ADSP.HT.5.9    <br />CDSP.HT.2.9.c1 <br />BOOT.MXF\_UEFI.2.5 |

| Distribution                                         | Description                                        | Usage                                                   |
| ---------------------------------------------------- | -------------------------------------------------- | ------------------------------------------------------- |
| `Qualcomm_Linux.SPF.2.0\|TEST\|DEVICE\|PUBLIC`       | High level OS and prebuilt firmware (No modem)     | Developers building for no modem with prebuilt firmware |
| `Qualcomm_Linux.SPF.2.0\|AP\|Standard\|OEM\|NoModem` | High level OS and firmware in source without modem | Developers building no modem firmware with HLOS         |
| `Qualcomm_Linux.SPF.2.0\|AP\|Standard\|OEM`          | High-level OS and firmware (GPS only) source       | Developers building firmware with GPS chipsets          |
| `Qualcomm_Linux.SPF.2.0\|AMSS\|Standard\|OEM`        | High-level OS and firmware (GPS and modem) source  | Developers building firmware with full modem            |

## Download the software

Download a software release using the `chip-software download` command. Use the
previous table to look up the `--product`, `--release`, and `--distribution` values for
your SoC:

```bash theme={null}
qsc-cli chip-software download --workspace-path '<absolute-workspace-path>' --product '<product-id>' --release '<release-id>'  --distribution '<distribution-name>'
```

## Build the default configuration

### Compile

When the download is complete, start the compilation process. Depending on the size of the software and the host computer configuration, the compilation process can take a few hours.

```bash theme={null}
qsc-cli chip-software compile --workspace-path '<absolute-workspace-path>'
```

This process builds the necessary Qualcomm firmware and completes the Qualcomm
Linux build.

### Recompile

To recompile individual software images after any modifications to the software
release, use your existing workspace built using QSC CLI:

```bash theme={null}
qsc-cli chip-software compile --image '<image-name>' --workspace-path '<absolute-workspace-path>'
```

## Build your own configuration

To build your own configuration, you must compile the build with the default
machine configuration and then compile the software product with your own
machine and distribution configuration files.

When compiling a software image, ensure that you also compile the software
product. For example, if you compile `BOOT.MXF.1.0.c1`, ensure that you also
compile the software product (such as `QCS9100.LE.2.0`).

* Compile the build for the default machine configuration.

* Compile the software product with your own machine and distribution
  configuration files.
  ```bash theme={null}
  qsc-cli chip-software open-build-env --workspace-path <absolute-workspace-path> --image <software-image-name>
  ```
  This command opens a terminal.

* Update the highlighted command according to your own machine configuration
  and run it on the terminal. For example, to build IQ-9075-EVK, change the value of `<machine.yml>` to `iq-9075-evk.yml`.
  <img src="https://mintcdn.com/qualcomm-prod/n8AD--PnCVwV_rxK/Key-Documents/Firmware-Guide/media/k2c-qli-build-ga/qsc-cli-open-build-terminal.png?fit=max&auto=format&n=n8AD--PnCVwV_rxK&q=85&s=3169813171bd90d3e8500ebad8a840e9" alt="build-own-config" width="1572" height="184" data-path="Key-Documents/Firmware-Guide/media/k2c-qli-build-ga/qsc-cli-open-build-terminal.png" />

- The build creates a single tarball containing all the relevant files to
  perform a full clean flash, including partition metadata, boot firmware,
  ESP partition and the rootfs. After a successful build, check if the
  qcomflash tarball exists in the build artifacts. The following examples
  use `qcom-multimedia-proprietary-image` as the image name.

  <CodeGroup>
    ```bash IQ-9075-EVK theme={null}
    ls build/tmp/deploy/images/iq-9075-evk/qcom-multimedia-proprietary-image-iq-9075-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-8275-EVK theme={null}
    ls build/tmp/deploy/images/iq-8275-evk/qcom-multimedia-proprietary-image-iq-8275-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-615-EVK theme={null}
    ls build/tmp/deploy/images/iq-615-evk/qcom-multimedia-proprietary-image-iq-615-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash QCS6490 theme={null}
    ls build/tmp/deploy/images/rb3gen2-core-kit/qcom-multimedia-proprietary-image-rb3gen2-core-kit.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-X7181-EVK theme={null}
    ls build/tmp/deploy/images/iq-x7181-evk/qcom-multimedia-proprietary-image-iq-x7181-evk.rootfs.qcomflash.tar.gz
    ```

    ```bash IQ-X5121-EVK theme={null}
    ls build/tmp/deploy/images/iq-x5121-evk/qcom-multimedia-proprietary-image-iq-x5121-evk.rootfs.qcomflash.tar.gz
    ```
  </CodeGroup>

<Warning>
  An environment is set up to run your own build commands for a specific
  software image. QSC won't track the status of input workspaces in
  future releases, and you cannot flash these workspaces with qsc-cli.
</Warning>
