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

# BSP image build with firmware

## Introduction

Provides a high-level overview of how to build firmware
components from source and integrate them into the Qualcomm BSP image.

Firmware sources are available to users that have signed the required
agreements. If you don't yet have access, visit the
[Working with Qualcomm](https://www.qualcomm.com/support/working-with-qualcomm) page to
create a Qualcomm ID and learn more about account verification and access levels.

At a high level, you will learn the following:

* Set up the host system and install the required packages – [Host Setup](#host-setup)
* Switch Python versions to match a build step's requirement – [Switch Python versions](#switch-python-versions)
* Sync and build the firmware from source – [Build Firmware](#build-firmware)
* Include built firmware into the BSP image – [Build BSP Image](#build-bsp-image)

## Host system requirements

* Operating System
  * Ubuntu 22.04

- Configuration
  * x86 machine
  * Quad-core CPU, for example, Intel i7-2600 at 3.4 GHz (equivalent or better)
  * 300 GB free disk space (swap partition > 32 GB)
  * 16 GB RAM

* Tools
  * Git 1.8.3.1 or later versions
  * Tar 1.28 or later versions
  * Python 3.10.2 or later versions
  * GCC 10.1 or later versions
  * GNU Make 4.0 or later versions
  * Kas 4.8 or later versions

- Permissions
  * `sudo` permission is required to run a few commands

## Install QSC-CLI

`qsc-cli` is a command-line tool provided by Qualcomm that offers an end-to-end workflow
to access, manage, and build the 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 Qualcomm ID. For most users, your Qualcomm ID is your
  email address. This opens a browser window to complete authentication. If the browser
  doesn't open automatically, copy the link printed in the terminal and paste it into your
  browser to complete authentication.
  ```bash theme={null}
  qsc-cli login
  ```

## Host setup

The following instructions are intended for use on a Ubuntu host system. The
Yocto build is also supported on other [distributions](https://docs.yoctoproject.org/ref-manual/system-requirements.html#supported-linux-distributions)
compatible with Yocto, but no validation is performed against them. If you encounter
issues, also refer to the [Yocto Project Quick Build guide](https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html#yocto-project-quick-build)
for comprehensive documentation on host prerequisites and troubleshooting.

* Install the following packages to prepare your host environment for the Yocto build

  ```bash theme={null}
  sudo apt update
  sudo apt install build-essential chrpath cpio debianutils diffstat \
       file gawk gcc git iputils-ping libacl1 locales python3 python3-git \
       python3-jinja2 python3-pexpect python3-pip python3-subunit socat \
       texinfo unzip wget xz-utils zstd
  ```

* Qualcomm uses the `kas` tool to sync and build the Yocto project. Use
  the following steps to install `kas` on your system

  <Note>
    On older Ubuntu versions, the `kas` version provided by the system package
    manager may be outdated. Using `pipx` is the recommended way to install kas.
  </Note>

  1. Install `pipx`

     ```bash theme={null}
     sudo apt install pipx
     ```

  2. Add the `pipx` install location to your `PATH`

     ```bash theme={null}
     pipx ensurepath
     ```

     This command updates your shell's startup file, so the change only
     takes effect in new shell sessions. Restart your shell session before
     continuing to the next step.

  3. Install `kas` (version 4.8 or higher is required)

     ```bash theme={null}
     pipx install "kas>=4.8"
     ```

* Verify if the kas installation is successful.

  ```bash theme={null}
  kas --version
  ```

- Compile the firmware using the following additional packages:
  ```bash theme={null}
  sudo apt-get install lib32stdc++6 libncurses5 checkinstall libreadline-dev \
       libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
       libbz2-dev libffi-dev curl
  ```

- Use `qsc-cli` to obtain the PAT token for Chipcode access. This
  token expires in two weeks.

  ```bash theme={null}
  qsc-cli show-access-token
  ```

  ```text Sample output theme={null}
  user@hostname:/local/mnt/workspace$ qsc-cli show-access-token
  [Info]: Starting qsc-cli version 0.0.0.9
  5LThNlklb55mMVLB5C2KqUGU2jCF
  ```

- Add the following entries to your `~/.netrc` file to authenticate access
  to Chipcode repositories:
  ```text theme={null}
  machine chipmaster2.qti.qualcomm.com
  login <login-id>
  password <access-token>

  machine qpm-git.qualcomm.com
  login <login-id>
  password <access-token>
  ```

- Update git configurations:
  ```bash theme={null}
  # 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
  # Add the following git configurations to follow remote redirects from http-alternates files or alternates
  git config --global http.https://chipmaster2.qti.qualcomm.com.followRedirects true
  git config --global http.https://qpm-git.qualcomm.com.followRedirects true
  ```

## Configuration parameters

The following table describes the build tags for the current release. These
values need to be substituted in the build commands.

| Release Tag | Identifier |
| - | - |
| meta-qcom-release-tag | qli-2.1.1 |
| meta-qcom-extras-release-tag | qli-2.1.1 |
| firmware-release-tag | r2.0\_00016.0 |
| firmware-release-tag (IQ-X7181/IQ-X5121) | r2.0\_00017.0 |
| firmware-release-tag (CQ-2390/IQ-2390) | r2.0\_00015.0 |

## Firmware Distributions

The following tables describe the firmware distributions that you can download.
For more information about the Yocto layers, see
[Qualcomm Linux metadata layers](/Key-Documents/Yocto-Guide/qualcomm-linux-metadata-layers).

**Supported firmware distributions**

| **Distribution** | **Description** | **Yocto layers** |
| - | - | - |
| Qualcomm\_Linux.SPF.2.0\|AP\|Standard\|OEM\|NoModem | High-level OS and firmware in source without modem | `meta-qcom`<br />`meta-qcom-distro`<br />`meta-qcom-extras` |
| Qualcomm\_Linux.SPF.2.0\|AP\|Standard\|OEM | High-level OS and firmware (GPS only) source | `meta-qcom`<br />`meta-qcom-distro`<br />`meta-qcom-extras` |
| Qualcomm\_Linux.SPF.2.0\|AMSS\|Standard\|OEM | High-level OS and firmware (GPS and modem) source | `meta-qcom`<br />`meta-qcom-distro`<br />`meta-qcom-extras` |

*`AP` = Application Processor; `AMSS` = Advanced Mobile Subscriber Software*

**Mapping firmware distributions to git repositories**

| **Distribution** | **Repository URL** | **Clone Directory** |
| - | - | - |
| Qualcomm\_Linux.SPF.2.0\|AP\|Standard\|OEM\|NoModem\| | [https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-2-0\_ap\_standard\_oem\_nomodem.git](https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-2-0_ap_standard_oem_nomodem.git) | qualcomm-linux-spf-2-0\_ap\_standard\_oem\_nomodem |
| Qualcomm\_Linux.SPF.2.0\|AP\|Standard\|OEM\| | [https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-2-0\_ap\_standard\_oem.git](https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-2-0_ap_standard_oem.git) | qualcomm-linux-spf-2-0\_ap\_standard\_oem |
| Qualcomm\_Linux.SPF.2.0\|AMSS\|Standard\|OEM\| | [https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-2-0\_amss\_standard\_oem.git](https://qpm-git.qualcomm.com/home2/git/qualcomm/qualcomm-linux-spf-2-0_amss_standard_oem.git) | qualcomm-linux-spf-2-0\_amss\_standard\_oem |

## Supported SoCs

The following table lists the chipsets and distributions covered by this guide. If your SoC or distribution is not listed as supported, the firmware build process described here does not apply to your device.

| SoC | `AP\|Standard\|OEM\|NoModem` | `AP\|Standard\|OEM` | `AMSS\|Standard\|OEM` |
| - | :-: | :-: | :-: |
| QCS6490/QCS5430 | ✓ | ✓ | ✓ |
| IQ-9075 | ✓ | — | — |
| IQ-8275 | ✓ | — | — |
| IQ-615 | ✓ | — | — |
| IQ-X7181 | ✓ | — | — |
| IQ-X5121 | ✓ | — | — |
| IQ-2390/CQ-2390 | ✓ | — | — |

✓ = Supported, — = Not Applicable.

## Switch Python versions

Different firmware image build steps require different Python versions, as
called out in the **Python version** requirement listed under each build
step. You can use a Python version-management tool to install and switch
between the versions needed, without affecting the system-level Python
installation. Common options include [pyenv](https://github.com/pyenv/pyenv)
and [uv](https://docs.astral.sh/uv/). This section shows how to use `pyenv`.

* Install the build dependencies first, since `pyenv` compiles each Python version from source. Without these packages, the build skips
  modules such as `readline`, `sqlite3`, and `lzma`:
  ```bash theme={null}
  sudo apt update
  sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev \
       libreadline-dev libsqlite3-dev libncursesw5-dev xz-utils tk-dev \
       libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
  ```

* Install `pyenv`. This requires the `git` and `curl` packages, which are
  installed as part of the [Host system requirements](#host-system-requirements).
  ```bash theme={null}
  curl https://pyenv.run | bash
  ```

* Configure the shell by adding the following lines to the end of your
  `~/.bashrc` file:
  ```bash theme={null}
  export PYENV_ROOT="$HOME/.pyenv"
  export PATH="$PYENV_ROOT/bin:$PATH"

  eval "$(pyenv init - bash)"
  ```

* Reload the shell configuration:
  ```bash theme={null}
  source ~/.bashrc
  ```

* List the available Python versions and locate the version required by the
  build step you are running (for example, Python 3.8.2):
  ```bash theme={null}
  pyenv install --list | grep 3.8.2
  ```

* Install the required Python version:
  ```bash theme={null}
  pyenv install 3.8.2
  ```

* Activate the installed version. Use `pyenv global` to set it as the
  default for your user account, or `pyenv local` to scope it to the current
  directory only:

  ```bash theme={null}
  pyenv global 3.8.2
  ```

  Verify that the correct version is active:

  ```bash theme={null}
  python --version
  which python
  ```

<Note>
  `pyenv global` and `pyenv local` change the Python version only for your
  user account through `pyenv`. They don't modify or replace the system-level
  Python installation, so other users and system applications remain
  unaffected.
</Note>

* Revert to the system Python version (if required):
  ```bash theme={null}
  pyenv global system
  ```

* Disable `pyenv` by removing the lines added to `~/.bashrc` during the shell configuration step, and then reload the shell configuration:
  ```bash theme={null}
  source ~/.bashrc
  ```

## Build firmware

* Create a workspace directory for the firmware sources and navigate to it. All subsequent instructions assume this as the working directory.
  ```bash theme={null}
  mkdir -p <firmware-root>
  cd <firmware-root>
  ```

* Clone the firmware sources from Qualcomm Chipcode<sup>™</sup> using the release tag and clone the URL from the [Firmware Source Mapping](#firmware-source-mapping) table.
  ```bash theme={null}
  git clone -b <firmware-release-tag> --depth 1 <clone-url>
  ```

* Substitute the `<firmware-root>` and `<distro-clone-directory>` in the following commands with the correct values based on the chosen access profile.

<Tabs>
  <Tab title="QCM6490/QCS5430">
    **Prerequisites**

    * Ensure that the working shell is `bash`:

      ```bash theme={null}
      echo $0
      ```

      The expected output of the command should be `bash`. If not, enter the bash
      shell.

      ```bash theme={null}
      bash
      ```

    * Install the libffi6 package using the following commands. This is required
      for the QAIC compiler, which generates the header and the source files from
      the IDL files.
      ```bash theme={null}
      curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
      sudo dpkg -i libffi6_3.2.1-8_amd64.deb
      ```

    * Install LLVM for AOP, Qualcomm<sup>®</sup> Trusted Execution Environment
      (TEE), and boot compilation:
      ```bash theme={null}
      cd <firmware-root>
      mkdir llvm
      # Sign in to qsc-cli and activate the license
      qsc-cli login
      qsc-cli tool activate-license --name sdllvm_arm
      # LLVM requirement for boot compilation is 14.0.4
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4
      chmod -R 777 <firmware-root>/llvm/14.0.4
      # LLVM requirement for the Qualcomm TEE compilation is 16.0.7
      qsc-cli tool install --name sdllvm_arm --required-version 16.0.7 --path <firmware-root>/llvm/16.0.7
      chmod -R 777 <firmware-root>/llvm/16.0.7
      ```

    * Export the `SECTOOLS` variable and compile the firmware builds
      (`<firmware-root>/<distro-clone-directory>`
      is the top-level directory):
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/QCM6490.LE.2.0/common/sectoolsv2/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/QCM6490.LE.2.0/common/sectoolsv2/ext/Linux
      ```

    * Install and set up Qualcomm<sup>®</sup> Hexagon<sup>™</sup> Processor. Set
      the environment variable HEXAGON\_ROOT to the path where the Hexagon SDK is
      installed. To change the install path when using `qsc-cli`, see
      [Change the Hexagon tool install path](/Key-Documents/Firmware-Guide/how-to-change-hexagon-install-path).
      ```bash theme={null}
      qsc-cli tool extract --name hexagon8.4 --required-version 8.4.07
      qsc-cli tool extract --name hexagon8.4 --required-version 8.4.10
      export HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```

    **Build cDSP**

    **Tools required**

    * Hexagon 8.4.07
    * Python 3.10.2
    * libffi6 package

    **Build steps**

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/CDSP.HT.2.5.c3/cdsp_proc/build/ms
      ```

    * Clean the build:
      ```bash theme={null}
      python ./build_variant.py kodiak.cdsp.prod --clean
      ```

    * Build the image:
      ```bash theme={null}
      python ./build_variant.py kodiak.cdsp.prod
      ```

    **Build aDSP**

    **Tools required**

    * Hexagon 8.4.07
    * Python 3.10.2
    * libffi6 package

    **Build steps**

    * Nanopb integration (one-time setup):
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.5.c8/adsp_proc/qsh_api
      curl https://jpa.kapsi.fi/nanopb/download/nanopb-0.3.9.5-linux-x86.tar.gz -o nanopb-0.3.9.5-linux-x86.tar.gz
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.5.c8/adsp_proc/
      python qsh_api/build/config_nanopb_dependency.py -f nanopb-0.3.9.5-linux-x86
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.5.c8/adsp_proc/build/ms
      ```

    * Clean the build:
      ```bash theme={null}
      python ./build_variant.py kodiak.adsp.prod --clean
      ```

    * Build the image:
      ```bash theme={null}
      python ./build_variant.py kodiak.adsp.prod
      ```

    **Build Boot**

    **Tools required**

    * LLVM version must be updated to 14.0.4
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/14.0.4/
      ```
    * Python 3.12.7
    * Ubuntu 24.04
    * libffi6 package

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF.1.0.c1/
      ```

    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```

    * Clean the build:
      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t kodiak,QcomToolsPkg -v LAA -r RELEASE --build_flags=cleanall
      ```

    * Build the image:

      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t kodiak,QcomToolsPkg -v LAA -r RELEASE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build Qualcomm TEE firmware**

    **Tools required**

    * LLVM 16.0.7
    * Python 3.10

    **Build steps**

    * Install LLVM:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      vi build_config_deploy_kodiak.xml
      # Edit all the occurrences of /pkg/qct/software/llvm/release/arm/16.0.7/ to <firmware-root>/llvm/16.0.7/
      ```

    * Clean the build:
      ```bash theme={null}
      python build_all.py -b TZ.XF.5.0 CHIPSET=kodiak --cfg=build_config_deploy_kodiak.xml --clean
      ```

    * Build the image:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      python build_all.py -b TZ.XF.5.0 CHIPSET=kodiak --cfg=build_config_deploy_kodiak.xml
      ```

    **Build AOP firmware**

    **Tools required**

    * LLVM 14.0.4
    * Python 3.10

    **Build steps**

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/AOP.HO.3.6/aop_proc/build/
      ```

    * Clean the build:
      ```bash theme={null}
      ./build_kodiak.sh -c -l <firmware-root>/llvm/14.0.4/
      ```

    * Build the image:
      ```bash theme={null}
      ./build_kodiak.sh -l <firmware-root>/llvm/14.0.4/
      ```

    **Build MPSS**

    <Note>
      This step is only applicable for `Qualcomm_Linux.SPF.2.0|AMSS|Standard|OEM|`.
    </Note>

    **Tools required**

    * Hexagon 8.4.10
    * Python 3.8.2

    **Build steps**

    * Nanopb integration (one-time setup):
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/MPSS.HI.4.3.3.c6.2/modem_proc/ssc_api
      curl https://jpa.kapsi.fi/nanopb/download/nanopb-0.3.9.5-linux-x86.tar.gz -o nanopb-0.3.9.5-linux-x86.tar.gz
      cd <firmware-root>/<distro-clone-directory>/MPSS.HI.4.3.3.c6.2/modem_proc
      python ssc_api/build/config_nanopb_dependency.py -f  nanopb-0.3.9.5-linux-x86
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/MPSS.HI.4.3.3.c6.2/modem_proc/build/ms
      ```

    * Clean the build:
      ```bash theme={null}
      python build_variant.py kodiak.gen.prod --clean
      ```

    * Build the image:
      ```bash theme={null}
      python build_variant.py kodiak.gen.prod bparams=-k
      ```

    **CPUCP firmware**

    Qualcomm releases the CPUCP firmware as a binary and you don’t need to compile
    the build.

    **CPUSYS.VM firmware**

    Qualcomm releases the CPUSYS.VM firmware as a binary and you don’t need to
    compile the build.

    **BTFM firmware**

    Qualcomm releases the BTFM firmware as a binary and you don’t need to compile
    the build.

    **WLAN firmware**

    Qualcomm releases the WLAN firmware as a binary and you don’t need to compile
    the build.

    **Generate firmware prebuilts (boot-critical and split-firmware binaries)**

    <Note>
      This step is only applicable for `Qualcomm_Linux.SPF.2.0|AP|Standard|OEM|`.

      ```bash theme={null}
      rm -rf <firmware-root>/<distro-clone-directory>/QCM6490.LE.2.0/common/build/ufs/bin/*
      ```
    </Note>

    * Create an integrated firmware binary from the individual components that you
      compiled:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/QCM6490.LE.2.0/common/build
      python build.py --imf
      ```

    * Firmware prebuilt is successful if the following zip files are generated in the
      `<firmware-root>/<distro-clone-directory>/QCM6490.LE.2.0/common/build/ufs/bin`
      directory:
      * `QCM6490_bootbinaries.zip`
      * `QCM6490_dspso.zip`
      * `QCM6490_fw.zip`
  </Tab>

  <Tab title="IQ-9075">
    **Prerequisites**

    * Ensure that the working shell is `bash`:

      ```bash theme={null}
      echo $0
      ```

      The expected output of the command should be `bash`. If not, enter the
      bash shell.

      ```bash theme={null}
      bash
      ```

    * Install the libffi6 package using the following commands. This is required for
      the QAIC compiler, which generates the header and the source files from the
      IDL files:
      ```bash theme={null}
      curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
      sudo dpkg -i libffi6_3.2.1-8_amd64.deb
      ```

    * Install LLVM for AOP, Qualcomm<sup>®</sup> Trusted Execution Environment
      (TEE), and boot compilation:
      ```bash theme={null}
      cd <firmware-root>
      mkdir llvm
      # Sign in to qsc-cli and activate the license
      qsc-cli login
      qsc-cli tool activate-license --name sdllvm_arm
      # LLVM requirement for boot compilation is 14.0.4
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4
      chmod -R 777 <firmware-root>/llvm/14.0.4
      # LLVM requirement for the Qualcomm TEE compilation is 16.0.7
      qsc-cli tool install --name sdllvm_arm --required-version 16.0.7 --path <firmware-root>/llvm/16.0.7
      chmod -R 777 <firmware-root>/llvm/16.0.7
      ```

    * Export the `SECTOOLS` variable and compile the firmware builds
      (`<firmware-root>/<distro-clone-directory>` is the
      top-level directory):
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/QCS9100.LE.2.0/common/sectoolsv2/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/QCS9100.LE.2.0/common/sectoolsv2/ext/Linux
      ```

    * Install and set up Qualcomm<sup>®</sup> Hexagon<sup>™</sup>. Set the environment variable HEXAGON\_ROOT to the
      path where the Hexagon SDK is installed. To change the install path when using
      `qsc-cli`, see [Change the Hexagon tool install path](/Key-Documents/Firmware-Guide/how-to-change-hexagon-install-path).
      ```bash theme={null}
      qsc-cli tool extract --name hexagon8.6 --required-version 8.6.05.2
      export HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```

    **Build DSP**

    **Tools required**

    * Hexagon 8.6.05.2
    * Python 3.12.7
    * Ubuntu 24.04

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC_PATH=/usr/bin
      ```

    * Install the dependencies:
      ```bash theme={null}
      pip install ruamel.yaml==0.17.17
      pip install dtschema==2021.10
      pip install jsonschema==4.0.0
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/DSP.AT.1.0.1/dsp_proc/build/ms
      ```

    * Clean the build:
      ```bash theme={null}
      python ./build_variant.py lemans.adsp.prod --clean
      python ./build_variant.py lemans.cdsp0.prod --clean
      python ./build_variant.py lemans.cdsp1.prod --clean
      python ./build_variant.py lemans.gpdsp0.prod --clean
      python ./build_variant.py lemans.gpdsp1.prod --clean
      ```

    * Build the image:
      ```bash theme={null}
      python ./build_variant.py lemans.adsp.prod && python ./build_variant.py lemans.cdsp0.prod && python ./build_variant.py lemans.cdsp1.prod && python ./build_variant.py lemans.gpdsp0.prod && python ./build_variant.py lemans.gpdsp1.prod
      ```

    **Build Boot**

    **Tools required**

    * LLVM version must be updated to 14.0.4
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/14.0.4/
      ```
    * Python 3.12.7
    * Ubuntu 24.04
    * libffi6 package

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF.1.0.c1/
      ```

    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```

    * Clean the build:
      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t lemans,QcomToolsPkg -v LAA -r RELEASE --build_flags=cleanall
      ```

    * Build the image:

      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t lemans,QcomToolsPkg -v LAA -r RELEASE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build Qualcomm TEE firmware**

    **Tools required**

    * LLVM 16.0.7
    * Python 3.10

    **Build steps**

    * Install LLVM:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      vi build_config_deploy_lemans.xml
      # Edit all the occurrences of /pkg/qct/software/llvm/release/arm/16.0.7/ to <firmware-root>/llvm/16.0.7/
      ```

    * Clean the build:
      ```bash theme={null}
      python build_all.py -b TZ.XF.5.0 CHIPSET=lemans --cfg=build_config_deploy_lemans.xml --clean
      ```

    * Build the image:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      python build_all.py -b TZ.XF.5.0 CHIPSET=lemans --cfg=build_config_deploy_lemans.xml
      ```

    **Build AOP firmware**

    **Tools required**

    * LLVM 14.0.4
    * Python 3.10

    **Build steps**

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/AOP.HO.3.6.1/aop_proc/build/
      ```

    * Clean the build:
      ```bash theme={null}
      ./build_lemansau.sh -c -l <firmware-root>/llvm/14.0.4/
      ```

    * Build the image:
      ```bash theme={null}
      ./build_lemansau.sh -l <firmware-root>/llvm/14.0.4/
      ```

    **CPUCP firmware**

    Qualcomm releases the CPUCP firmware as a binary and you don’t need to compile
    the build.

    **CPUSYS.VM firmware**

    Qualcomm releases the CPUSYS.VM firmware as a binary and you don’t need to
    compile the build.

    **BTFM firmware**

    Qualcomm releases the BTFM firmware as a binary and you don’t need to compile
    the build.

    **WLAN firmware**

    Qualcomm releases the WLAN firmware as a binary and you don’t need to compile
    the build.

    **Generate firmware prebuilts (boot-critical and split-firmware binaries)**

    * Create an integrated firmware binary from the individual components that you
      compiled:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/QCS9100.LE.2.0/common/build
      python build.py --imf
      ```

    * Firmware prebuilt is successful if the following zip files are generated in
      the `<firmware-root>/<distro-clone-directory>/QCS9100.LE.2.0/common/build/ufs/bin`
      directory:
      * `QCS9100_bootbinaries.zip`
      * `QCS9100_dspso.zip`
      * `QCS9100_fw.zip`
  </Tab>

  <Tab title="IQ-8275">
    **Prerequisites**

    * Ensure that the working shell is `bash`:

      ```bash theme={null}
      echo $0
      ```

      The expected output of the command should be `bash`. If not, enter the
      bash shell.

      ```bash theme={null}
      bash
      ```

    * Install the libffi6 package using the following commands. This is required
      for the QAIC compiler, which generates the header and the source files from
      the IDL files.
      ```bash theme={null}
      curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
      sudo dpkg -i libffi6_3.2.1-8_amd64.deb
      ```

    * Install LLVM for AOP, Qualcomm<sup>®</sup> Trusted Execution Environment
      (TEE), and boot compilation:
      ```bash theme={null}
      cd <firmware-root>
      mkdir llvm
      # Sign in to qsc-cli and activate the license
      qsc-cli login
      qsc-cli tool activate-license --name sdllvm_arm
      # LLVM requirement for boot compilation is 14.0.4
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4
      chmod -R 777 <firmware-root>/llvm/14.0.4
      # LLVM requirement for the Qualcomm TEE compilation is 16.0.7
      qsc-cli tool install --name sdllvm_arm --required-version 16.0.7 --path <firmware-root>/llvm/16.0.7
      chmod -R 777 <firmware-root>/llvm/16.0.7
      ```

    * Export the `SECTOOLS` variable and compile the firmware builds
      (`<firmware-root>/<distro-clone-directory>` is the
      top-level directory):
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/QCS8300.LE.2.0/common/sectoolsv2/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/QCS8300.LE.2.0/common/sectoolsv2/ext/Linux
      ```

    * Install and set up Qualcomm<sup>®</sup> Hexagon<sup>™</sup>. Set the environment variable HEXAGON\_ROOT to the
      path where the Hexagon SDK is installed. To change the install path when using
      `qsc-cli`, see [Change the Hexagon tool install path](/Key-Documents/Firmware-Guide/how-to-change-hexagon-install-path).
      ```bash theme={null}
      qsc-cli tool extract --name hexagon8.6 --required-version 8.6.05.2
      qsc-cli tool extract --name hexagon8.7 --required-version 8.7.02.1
      export HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```

    **Build DSP**

    **Tools required**

    * Hexagon 8.6.05.2 and 8.7.02.1
    * Python 3.12.7
    * Ubuntu 24.04

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC_PATH=/usr/bin
      ```

    * Install the dependencies:
      ```bash theme={null}
      pip install ruamel.yaml==0.17.17
      pip install dtschema==2021.10
      pip install jsonschema==4.0.0
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/DSP.AT.1.0.1/dsp_proc/build/ms
      ```

    * Clean the build:
      ```bash theme={null}
      python ./build_variant.py lemans.adsp.prod --clean
      python ./build_variant.py monaco.cdsp0.prod --clean
      python ./build_variant.py lemans.gpdsp0.prod --clean
      ```

    * Build the image:
      ```bash theme={null}
      python ./build_variant.py lemans.adsp.prod && python ./build_variant.py monaco.cdsp0.prod && python ./build_variant.py lemans.gpdsp0.prod
      ```

    **Build Boot**

    **Tools required**

    * LLVM version must be updated to 14.0.4
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/14.0.4/
      ```
    * Python 3.12.7
    * Ubuntu 24.04
    * libffi6 package

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF.1.0.c1/
      ```

    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```

    * Clean the build:
      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t monaco,QcomToolsPkg -v LAA -r RELEASE --build_flags=cleanall
      ```

    * Build the image:

      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t monaco,QcomToolsPkg -v LAA -r RELEASE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build Qualcomm TEE firmware**

    **Tools required**

    * LLVM 16.0.7
    * Python 3.10

    **Build steps**

    * Install LLVM:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      vi build_config_deploy_monaco.xml
      # Edit all the occurrences of /pkg/qct/software/llvm/release/arm/16.0.7/ to <firmware-root>/llvm/16.0.7/
      ```

    * Clean the build:
      ```bash theme={null}
      python build_all.py -b TZ.XF.5.0 CHIPSET=monaco --cfg=build_config_deploy_monaco.xml --clean
      ```

    * Build the image:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      python build_all.py -b TZ.XF.5.0 CHIPSET=monaco --cfg=build_config_deploy_monaco.xml
      ```

    **Build AOP firmware**

    **Tools required**

    * LLVM 14.0.4
    * Python 3.10

    **Build steps**

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/AOP.HO.3.6.1/aop_proc/build/
      ```

    * Clean the build:
      ```bash theme={null}
      ./build_monaco.sh -c -l <firmware-root>/llvm/14.0.4/
      ```

    * Build the image:
      ```bash theme={null}
      ./build_monaco.sh -l <firmware-root>/llvm/14.0.4/
      ```

    **CPUCP firmware**

    Qualcomm releases the CPUCP firmware as a binary and you don’t need to compile
    the build.

    **CPUSYS.VM firmware**

    Qualcomm releases the CPUSYS.VM firmware as a binary and you don’t need to
    compile the build.

    **BTFM firmware**

    Qualcomm releases the BTFM firmware as a binary and you don’t need to compile
    the build.

    **WLAN firmware**

    Qualcomm releases the WLAN firmware as a binary and you don’t need to compile
    the build.

    **Generate firmware prebuilts (boot-critical and split-firmware binaries)**

    * Create an integrated firmware binary from the individual components that
      you compiled:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/QCS8300.LE.2.0/common/build
      python build.py --imf
      ```

    * Firmware prebuilt is successful if the following zip files are generated in
      the `<firmware-root>/<distro-clone-directory>/QCS8300.LE.2.0/common/build/ufs/bin`
      directory:
      * `QCS8300_bootbinaries.zip`
      * `QCS8300_dspso.zip`
      * `QCS8300_fw.zip`
  </Tab>

  <Tab title="IQ-615">
    **Prerequisites**

    * Ensure that the working shell is `bash`:

      ```bash theme={null}
      echo $0
      ```

      The expected output of the command should be `bash`. If not, enter the
      bash shell.

      ```bash theme={null}
      bash
      ```

    * Install the libffi6 package using the following commands. This is required
      for the QAIC compiler, which generates the header and the source files from
      the IDL files.
      ```bash theme={null}
      curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
      sudo dpkg -i libffi6_3.2.1-8_amd64.deb
      ```

    * Install LLVM for AOP, Qualcomm<sup>®</sup> Trusted Execution Environment (TEE), and boot compilation:
      ```bash theme={null}
      cd <firmware-root>
      mkdir llvm
      # Sign in to qsc-cli and activate the license
      qsc-cli login
      qsc-cli tool activate-license --name sdllvm_arm
      # LLVM requirement for AOP is 3.9.3
      mkdir -p /pkg/qct/software/llvm
      qsc-cli tool install --name sdllvm_arm --required-version 3.9.3 --path /pkg/qct/software/llvm/release/arm/3.9.3
      chmod -R 777 /pkg/qct/software/llvm/release/arm/3.9.3
      # LLVM requirement for boot compilation is 14.0.4
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4
      chmod -R 777 <firmware-root>/llvm/14.0.4
      # LLVM requirement for Qualcomm TrustZone compilation is 16.0.7
      qsc-cli tool install --name sdllvm_arm --required-version 16.0.7 --path <firmware-root>/llvm/16.0.7
      chmod -R 777 <firmware-root>/llvm/16.0.7
      ```

    * Export the `SECTOOLS` variable and compile the firmware builds
      (`<firmware-root>/<distro-clone-directory>` is the top-level directory):
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/QCS615.LE.2.0/common/sectoolsv2/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/QCS615.LE.2.0/common/sectoolsv2/ext/Linux
      ```

    * Install and set up Qualcomm<sup>®</sup> Hexagon<sup>™</sup>. Set the environment variable `HEXAGON_ROOT`` to the
      path where the Hexagon SDK is installed. To change the install path when using
      `qsc-cli\`, see [Change the Hexagon tool install path](/Key-Documents/Firmware-Guide/how-to-change-hexagon-install-path).
      ```bash theme={null}
      qsc-cli tool extract --name hexagon8.2 --required-version 8.2.05.1
      export HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```

    **Build cDSP**

    **Tools required**

    * Hexagon 8.2.05
    * Python 2.7.18
    * libffi6 package

    **Build steps**

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/CDSP.VT.2.2.c4
      ```

    * Clean the build:
      ```bash theme={null}
      python cdsp_proc/build/build.py -c sm6150 -o clean -f CDSP
      ```

    * Build the image:
      ```bash theme={null}
      python cdsp_proc/build/build.py -c sm6150 -o all -f CDSP
      ```

    **Build aDSP**

    **Tools required**

    * Hexagon 8.2.05
    * Python 2.7.18
    * libffi6 package

    **Build steps**

    * Nanopb integration (one-time setup):
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.VT.5.2.c6/adsp_proc/ssc_api
      curl https://jpa.kapsi.fi/nanopb/download/nanopb-0.3.9.5-linux-x86.tar.gz -o nanopb-0.3.9.5-linux-x86.tar.gz
      cd <firmware-root>/<distro-clone-directory>/ADSP.VT.5.2.c6/adsp_proc/
      python ssc_api/build/config_nanopb_dependency.py -f nanopb-0.3.9.5-linux-x86
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.VT.5.2.c6
      ```

    * Clean the build:
      ```bash theme={null}
      python adsp_proc/build/build.py -c sm6150 -o clean -f ADSP
      ```

    * Build the image:
      ```bash theme={null}
      python adsp_proc/build/build.py -c sm6150 -o all -f ADSP
      ```

    **Build AOP**

    **Tools required**

    * LLVM 3.9.3
    * Python 3.10

    **Build steps**

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/AOP.HO.3.6.2/aop_proc/build/
      ```

    * Clean the build:
      ```bash theme={null}
      ./build_TalosAU.sh -c
      ```

    * Build the image:
      ```bash theme={null}
      ./build_TalosAU.sh
      ```

    **Build Boot**

    **Tools required**

    * LLVM version must be updated to 14.0.4
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/14.0.4/
      ```
          <Note>
            To avoid build errors, ensure that there is a / at the end of the command
          </Note>

    * Python 3.12.7

    * Ubuntu 24.04

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF.1.0.c1/
      ```

    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```

    * Clean the build:
      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t talos,QcomToolsPkg -v LAA -r RELEASE --build_flags=cleanall
      ```

    * Build the image:

      ```bash theme={null}
      python -u boot_images/boot_tools/buildex.py -t talos,QcomToolsPkg -v LAA -r RELEASE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build TrustZone**

    **Tools required**

    * LLVM 16.0.7
    * Python 3.10

    **Build steps**

    * Install LLVM:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      vi build_config_deploy_talos.xml
      # Edit all the occurrences of /pkg/qct/software/llvm/release/arm/16.0.7/ to <firmware-root>/llvm/16.0.7/
      ```
    * Clean the build:
      ```bash theme={null}
      python build_all.py -b TZ.XF.5.0 CHIPSET=talos --cfg=build_config_deploy_talos.xml --clean
      ```
    * Build the image:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.29.1/trustzone_images/build/ms/
      python build_all.py -b TZ.XF.5.0 CHIPSET=talos --cfg=build_config_deploy_talos.xml
      ```

    **BTFM firmware**

    Qualcomm releases the BTFM firmware as a binary and you don’t need to compile
    the build.

    **WLAN firmware**

    Qualcomm releases the WLAN firmware as a binary and you don’t need to compile
    the build.

    **Generate firmware prebuilts (boot-critical and split-firmware binaries)**

    * Create an integrated firmware binary from the individual components that
      you compiled:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/QCS615.LE.2.0/common/build
      python build.py --imf
      ```

    * Firmware prebuilt is successful if the following zip files are generated in
      the `<firmware-root>/<distro-clone-directory>/QCS615.LE.2.0/common/build/common/bin`
      directory:
      * `QCS615_bootbinaries.zip`
      * `QCS615_dspso.zip`
      * `QCS615_fw.zip`
  </Tab>

  <Tab title="IQ-X7181">
    **Prerequisites**

    * Ensure that the working shell is `bash`:

      ```bash theme={null}
      echo $0
      ```

      The expected output of the command should be `bash`. If not, enter the
      bash shell.

      ```bash theme={null}
      bash
      ```

    * Install the libffi6 package using the following commands. This is required for
      the QAIC compiler, which generates the header and the source files from the
      IDL files.
      ```bash theme={null}
      curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
      sudo dpkg -i libffi6_3.2.1-8_amd64.deb
      ```

    * Install LLVM for AOP, Qualcomm<sup>®</sup> Trusted Execution Environment
      (TEE), and boot compilation:
      ```bash theme={null}
      cd <firmware-root>
      mkdir llvm

      # Sign in to qsc-cli and activate the license
      qsc-cli login
      qsc-cli tool activate-license --name sdllvm_arm

      # LLVM requirement for aDSP is 14.0.1
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.1 --path <firmware-root>/llvm/14.0.1
      chmod -R 777 <firmware-root>/llvm/14.0.1

      # LLVM requirement for the AOP is 14.0.0
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.0 --path <firmware-root>/llvm/14.0.0
      chmod -R 777 <firmware-root>/llvm/14.0.0

      # LLVM requirement for BOOT compilation is 16.0.2
      qsc-cli tool install --name sdllvm_arm --required-version 16.0.2 --path <firmware-root>/llvm/16.0.2
      chmod -R 777 <firmware-root>/llvm/16.0.2

      # LLVM requirement for BOOT_UEFI and Qualcomm TEE (TZ_XF) compilation is 18.0.1
      qsc-cli tool install --name sdllvm_arm --required-version 18.0.1 --path <firmware-root>/llvm/18.0.1
      chmod -R 777 <firmware-root>/llvm/18.0.1
      ```

    * Export the `SECTOOLS` variable and compile the firmware builds
      (`<firmware-root>/<distro-clone-directory>` is the top-level directory):
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/common/sectoolsv2/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/common/sectoolsv2/ext/Linux
      ```

    * Install and set up Qualcomm<sup>®</sup> Hexagon<sup>™</sup> Processor. Set
      the environment variable HEXAGON\_ROOT to the path where the Hexagon SDK is
      installed. To change the install path when using
      `qsc-cli`, see [Change the Hexagon tool install path](/Key-Documents/Firmware-Guide/how-to-change-hexagon-install-path).
      ```bash theme={null}
      qsc-cli tool extract --name hexagon8.4 --required-version 8.6.06
      export HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```

    **Build aDSP**

    **Tools required**

    * Hexagon 8.6.06
    * Python 3.8.2
    * libffi6 package

    **Build steps**

    * Check Hexagon directory:
      ```bash theme={null}
      export HEXAGON_ROOT=$HOME/QUalcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```
    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Nanopb integration (one-time setup):
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.9/adsp_proc/qsh_api
      curl https://jpa.kapsi.fi/nanopb/download/nanopb-0.3.9.5-linux-x86.tar.gz -o nanopb-0.3.9.5-linux-x86.tar.gz
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.9/adsp_proc/
      python qsh_api/build/config_nanopb_dependency.py -f nanopb-0.3.9.5-linux-x86
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.9/adsp_proc/build/ms
      ```
    * Clean the build:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.adsp.prod --clean && python3 ./build_variant.py hamoa.adsp.charger --clean
      ```
    * Build the image:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.adsp.prod && python3 ./build_variant.py hamoa.adsp.charger
      ```

    **Build cDSP**

    **Tools required**

    * Hexagon 8.6.06
    * Python 3.8.2
    * libffi6 package

    **Build steps**

    * Check Hexagon directory:
      ```bash theme={null}
      export HEXAGON_ROOT=$HOME/QUalcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```
    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/CDSP.HT.2.9.c1/cdsp_proc/build/ms
      ```
    * Clean the build:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.cdsp.prod --clean
      ```
    * Build the image:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.cdsp.prod
      ```

    **Build Boot**

    **Tools required**

    * LLVM version must be updated to 16.0.2
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/16.0.2/
      ```
    * Python 3.10.6
    * libffi6 package

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF.2.4.2/
      ```
    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```
    * Clean the build:
      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE --build_flags=cleanall
      ```
    * Build the image:

      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build BOOT\_UEFI**

    **Tools required**

    * LLVM version must be updated to 18.0.1
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/18.0.1/
      ```
    * Python 3.10.6
    * libffi6 package

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF_UEFI.2.5/
      ```
    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```
    * Clean the build:
      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE --build_flags=cleanall
      ```
    * Build the image:

      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build Qualcomm TEE firmware**

    **Tools required**

    * LLVM version must be updated to 18.0.1
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/18.0.1/
      ```
    * Python 3.10

    **Build steps**

    * Export the `SECTOOLS` variable:
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/ext/Linux
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.0/trustzone_images/build/ms
      ```
    * Clean the build:
      ```bash theme={null}
      python3 build_all.py -b TZ.XF.5.0 CHIPSET=hamoa --clean
      ```
    * Build the image:
      ```bash theme={null}
      python3 build_all.py -b TZ.XF.5.0 CHIPSET=hamoa
      ```

    **Build AOP firmware**

    **Tools required**

    * LLVM version must be updated to 14.0.0
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/14.0.0/
      ```
    * Python 3.10

    **Build steps**

    * Export the `SECTOOLS` variable:
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/ext/Linux
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/AOP.HO.5.2/
      ```
    * Build the image:
      ```bash theme={null}
      ./aop_proc/build/build_hamoa.sh
      ```

    **CPUCP firmware**

    Qualcomm releases the CPUCP firmware as a binary and you don’t need to compile
    the build.

    **BTFM firmware**

    Qualcomm releases the BTFM firmware as a binary and you don’t need to compile
    the build.

    **WLAN firmware**

    Qualcomm releases the WLAN firmware as a binary and you don’t need to compile
    the build.

    **Generate firmware prebuilts (boot-critical and split-firmware binaries)**

    * Create an integrated firmware binary from the individual components that you
      compiled:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/common/build
      python build.py --imf
      ```

    * Firmware prebuilt is successful if the following zip files are generated in
      the `<firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/common/build/ufs/bin`
      directory:
      * `HAMOA_bootbinaries.zip`
      * `HAMOA_fw.zip`
  </Tab>

  <Tab title="IQ-X5121">
    **Prerequisites**

    * Ensure that the working shell is `bash`:

      ```bash theme={null}
      echo $0
      ```

      The expected output of the command should be `bash`. If not, enter the
      bash shell.

      ```bash theme={null}
      bash
      ```

    * Install the libffi6 package using the following commands. This is required for
      the QAIC compiler, which generates the header and the source files from the
      IDL files.
      ```bash theme={null}
      curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
      sudo dpkg -i libffi6_3.2.1-8_amd64.deb
      ```

    * Install LLVM for AOP, Qualcomm<sup>®</sup> Trusted Execution Environment
      (TEE), and boot compilation:
      ```bash theme={null}
      cd <firmware-root>
      mkdir llvm

      # Sign in to qsc-cli and activate the license
      qsc-cli login
      qsc-cli tool activate-license --name sdllvm_arm

      # LLVM requirement for aDSP is 14.0.1
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.1 --path <firmware-root>/llvm/14.0.1
      chmod -R 777 <firmware-root>/llvm/14.0.1

      # LLVM requirement for the AOP is 14.0.0
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.0 --path <firmware-root>/llvm/14.0.0
      chmod -R 777 <firmware-root>/llvm/14.0.0

      # LLVM requirement for BOOT compilation is 16.0.2
      qsc-cli tool install --name sdllvm_arm --required-version 16.0.2 --path <firmware-root>/llvm/16.0.2
      chmod -R 777 <firmware-root>/llvm/16.0.2

      # LLVM requirement for BOOT_UEFI and Qualcomm TEE (TZ_XF) compilation is 18.0.1
      qsc-cli tool install --name sdllvm_arm --required-version 18.0.1 --path <firmware-root>/llvm/18.0.1
      chmod -R 777 <firmware-root>/llvm/18.0.1
      ```

    * Export the `SECTOOLS` variable and compile the firmware builds
      (`<firmware-root>/<distro-clone-directory>` is the top-level directory):
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/Purwa_IOT.LE.2.0/common/sectoolsv2/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/Purwa_IOT.LE.2.0/common/sectoolsv2/ext/Linux
      ```

    * Install and set up Qualcomm<sup>®</sup> Hexagon<sup>™</sup> Processor. Set
      the environment variable HEXAGON\_ROOT to the path where the Hexagon SDK is
      installed. To change the install path when using
      `qsc-cli`, see [Change the Hexagon tool install path](/Key-Documents/Firmware-Guide/how-to-change-hexagon-install-path).
      ```bash theme={null}
      qsc-cli tool extract --name hexagon8.4 --required-version 8.6.06
      export HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```

    **Build aDSP**

    **Tools required**

    * Hexagon 8.6.06
    * Python 3.8.2
    * libffi6 package

    **Build steps**

    * Check Hexagon directory:
      ```bash theme={null}
      export HEXAGON_ROOT=$HOME/QUalcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```
    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Nanopb integration (one-time setup):
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.9/adsp_proc/qsh_api
      curl https://jpa.kapsi.fi/nanopb/download/nanopb-0.3.9.5-linux-x86.tar.gz -o nanopb-0.3.9.5-linux-x86.tar.gz
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.9/adsp_proc/
      python qsh_api/build/config_nanopb_dependency.py -f nanopb-0.3.9.5-linux-x86
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/ADSP.HT.5.9/adsp_proc/build/ms
      ```
    * Clean the build:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.adsp.prod --clean && python3 ./build_variant.py hamoa.adsp.charger --clean
      ```
    * Build the image:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.adsp.prod && python3 ./build_variant.py hamoa.adsp.charger
      ```

    **Build cDSP**

    **Tools required**

    * Hexagon 8.6.06
    * Python 3.8.2
    * libffi6 package

    **Build steps**

    * Check Hexagon directory:
      ```bash theme={null}
      export HEXAGON_ROOT=$HOME/QUalcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```
    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/CDSP.HT.2.9.c1/cdsp_proc/build/ms
      ```
    * Clean the build:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.cdsp.prod --clean
      ```
    * Build the image:
      ```bash theme={null}
      python3 ./build_variant.py hamoa.cdsp.prod
      ```

    **Build Boot**

    **Tools required**

    * LLVM version must be updated to 16.0.2
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/16.0.2/
      ```
    * Python 3.10.6
    * libffi6 package

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF.2.4.2/
      ```
    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```
    * Clean the build:
      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE --build_flags=cleanall
      ```
    * Build the image:

      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build BOOT\_UEFI**

    **Tools required**

    * LLVM version must be updated to 18.0.1
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/18.0.1/
      ```
    * Python 3.10.6
    * libffi6 package

    **Build steps**

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF_UEFI.2.5/
      ```
    * Install the dependencies:
      ```bash theme={null}
      python -m pip install -r boot_images/boot_tools/dtschema_tools/oss/requirements.txt
      pip install json-schema-for-humans
      ```
    * Clean the build:
      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE --build_flags=cleanall
      ```
    * Build the image:

      ```bash theme={null}
      python3 boot_images/boot_tools/buildex.py -t Hamoa,QcomToolsPkg -r RELEASE -v LE
      ```

          <Note>
            For debug variant builds, replace `RELEASE` with `DEBUG`.
          </Note>

    **Build Qualcomm TEE firmware**

    **Tools required**

    * LLVM version must be updated to 18.0.1
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/18.0.1/
      ```
    * Python 3.10

    **Build steps**

    * Export the `SECTOOLS` variable:
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/Purwa.LE.2.0/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/Purwa.LE.2.0/ext/Linux
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.0/trustzone_images/build/ms
      ```
    * Clean the build:
      ```bash theme={null}
      python3 build_all.py -b TZ.XF.5.0 CHIPSET=hamoa --clean
      ```
    * Build the image:
      ```bash theme={null}
      python3 build_all.py -b TZ.XF.5.0 CHIPSET=hamoa
      ```

    **Build AOP firmware**

    **Tools required**

    * LLVM version must be updated to 14.0.0
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/14.0.0/
      ```
    * Python 3.10

    **Build steps**

    * Export the `SECTOOLS` variable:
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/Purwa.LE.2.0/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/Purwa.LE.2.0/ext/Linux
      ```
    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/AOP.HO.5.2/
      ```
    * Build the image:
      ```bash theme={null}
      ./aop_proc/build/build_hamoa.sh
      ```

    **CPUCP firmware**

    Qualcomm releases the CPUCP firmware as a binary and you don’t need to compile
    the build.

    **BTFM firmware**

    Qualcomm releases the BTFM firmware as a binary and you don’t need to compile
    the build.

    **WLAN firmware**

    Qualcomm releases the WLAN firmware as a binary and you don’t need to compile
    the build.

    **Generate firmware prebuilts (boot-critical and split-firmware binaries)**

    * Create an integrated firmware binary from the individual components that you
      compiled:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/Purwa.LE.2.0/common/build
      python build.py --imf
      ```

    * Firmware prebuilt is successful if the following zip files are generated in
      the `<firmware-root>/<distro-clone-directory>/Purwa.LE.2.0/common/build/ufs/bin`
      directory:
      * `HAMOA_bootbinaries.zip`
      * `HAMOA_fw.zip`
  </Tab>

  <Tab title="CQ-2390/IQ-2390">
    **Prerequisites**

    * Ensure that the working shell is `bash`:

      ```bash theme={null}
      echo $0
      ```

      The expected output of the command should be `bash`. If not, enter the bash
      shell.

      ```bash theme={null}
      bash
      ```

    * Install the libffi6 package using the following commands. This is required
      for the QAIC compiler, which generates the header and the source files from
      the IDL files.
      ```bash theme={null}
      curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
      sudo dpkg -i libffi6_3.2.1-8_amd64.deb
      ```

    * Install LLVM for RPM, Qualcomm<sup>®</sup> Trusted Execution Environment
      (TEE), and boot compilation:
      ```bash theme={null}
      cd <firmware-root>
      mkdir llvm

      # Sign in to qsc-cli and activate the license
      qsc-cli login
      qsc-cli tool activate-license --name sdllvm_arm

      # LLVM requirement for BOOT.MXF.1.0.c1
      qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4
      chmod -R 777 <firmware-root>/llvm/14.0.4

      # LLVM requirement for BOOT.XF.4.1.4
      qsc-cli tool install --name sdllvm_arm --required-version 4.0.2 --path <firmware-root>/llvm/4.0.2
      chmod -R 777 <firmware-root>/llvm/4.0.2

      # LLVM requirement for RPM
      qsc-cli tool install --name sdllvm_arm --required-version 3.9.2 --path <firmware-root>/llvm/3.9.2
      chmod -R 777 <firmware-root>/llvm/3.9.2

      # LLVM requirement for Qualcomm TEE compilation
      qsc-cli tool install --name sdllvm_arm --required-version 18.0.1 --path <firmware-root>/llvm/18.0.1
      chmod -R 777 <firmware-root>/llvm/18.0.1
      ```

    * Export the `SECTOOLS` variable and compile the firmware builds
      (`<firmware-root>/<distro-clone-directory>` is the top-level directory):
      ```bash theme={null}
      export SECTOOLS=<firmware-root>/<distro-clone-directory>/CQ2390.LE.1.0/common/sectoolsv2/ext/Linux/sectools
      export SECTOOLS_DIR=<firmware-root>/<distro-clone-directory>/CQ2390.LE.1.0/common/sectoolsv2/ext/Linux
      ```

    * Install and set up Qualcomm<sup>®</sup> Hexagon<sup>™</sup> Processor. Set
      the environment variable `HEXAGON_ROOT` to the path where the Hexagon SDK is
      installed. To change the install path when using `qsc-cli`, see
      [Change the Hexagon tool install path](/Key-Documents/Firmware-Guide/how-to-change-hexagon-install-path).
      ```bash theme={null}
      qsc-cli tool extract --name hexagon8.6 --required-version 8.6.04.1
      qsc-cli tool extract --name hexagon8.7 --required-version 8.7.11.1
      qsc-cli tool extract --name hexagon8.2 --required-version 8.2.05.1
      export HEXAGON_ROOT=$HOME/Qualcomm/HEXAGON_Tools
      echo $HEXAGON_ROOT
      ```

    **Build Boot MXF**

    **Tools required**

    * LLVM 14.0.4
    * Python 3.10.6
    * libffi6 package

    **Build steps**

    * Set the LLVM environment variable:
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/14.0.4/
      ```

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.MXF.1.0.c1/
      ```

    * Clean the build:
      ```bash theme={null}
      python boot_images/boot_tools/buildex.py -t Shikra -r RELEASE -v LE --build_flags=cleanall
      ```

    * Build the image:
      ```bash theme={null}
      python boot_images/boot_tools/buildex.py -t Shikra -r RELEASE -v LE
      ```

    **Build Boot XF**

    **Tools required**

    * LLVM 4.0.2
    * Python 3.10.6

    **Build steps**

    * Set the LLVM environment variable:
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/4.0.2/
      ```

    * Install the device tree compiler:
      ```bash theme={null}
      sudo apt-get install device-tree-compiler
      export DTC=/usr/bin
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/BOOT.XF.4.1.4/
      ```

    * Clean the build:
      ```bash theme={null}
      python3 -u boot_images/QcomPkg/buildex.py --variant LE -t ShikraPkg,QcomToolsPkg --build_flags=cleanall
      ```

    * Build the image:
      ```bash theme={null}
      python3 -u boot_images/QcomPkg/buildex.py --variant LE -t ShikraPkg,QcomToolsPkg
      ```

    **Build RPM**

    **Tools required**

    * LLVM 3.9.2
    * Python 3.10.6

    **Build steps**

    * Set the LLVM environment variable:
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/3.9.2/
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/RPM.BF.1.16/rpm_proc/build
      ```

    * Clean the build:
      ```bash theme={null}
      ./build_shikra.sh --clean
      ```

    * Build the image:
      ```bash theme={null}
      ./build_shikra.sh
      ```

    **Build Qualcomm TEE firmware**

    **Tools required**

    * LLVM 18.0.1
    * Python 3.10.6

    **Build steps**

    * Set the LLVM environment variable:
      ```bash theme={null}
      export LLVM=<firmware-root>/llvm/18.0.1/
      ```

    * Go to the following directory:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/TZ.XF.5.36/trustzone_images/build/ms
      ```

    * Clean the build:
      ```bash theme={null}
      python build_all.py -b TZ.XF.5.0 CHIPSET=shikra --clean
      ```

    * Build the image:
      ```bash theme={null}
      python build_all.py -b TZ.XF.5.0 CHIPSET=shikra
      ```

    **Build LPAICP**

    **Tools required**

    * Python 3.12.10

    **Build steps**

    * Go to the following directory and activate Python 3.12.10:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/LPAICP.FW.1.2/wasp_proc/build/ms
      pyenv local 3.12.10
      python --version
      ```

    * Install the required system packages:
      ```bash theme={null}
      sudo apt-get update
      sudo apt-get install cmake ninja-build
      ```

    * Install the required Python packages:
      ```bash theme={null}
      pip install west
      pip install jsonschema
      pip install pyelftools
      pip install pyfatfs
      python -m pip install "setuptools<=68"
      ```

    * Clean the build:
      ```bash theme={null}
      python ./build_variant.py shikra.lpaicp.prod --clean
      ```

    * Build the image:
      ```bash theme={null}
      python ./build_variant.py shikra.lpaicp.prod
      ```

    **Build cDSP**

    **Tools required**

    * Hexagon 8.6.04 and Hexagon 8.2.05
    * Python 3.12.7 or later

    **Build steps**

    * Go to the following directory and activate Python 3.12.10:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/CDSP.VT.2.4.3/cdsp_proc/build/ms
      pyenv local 3.12.10
      ```

    * Clean the build:
      ```bash theme={null}
      python ./build_variant.py shikra.cdsp.prod --clean
      ```

    * Build the image:
      ```bash theme={null}
      python ./build_variant.py shikra.cdsp.prod
      ```

    **MPSS firmware**

    Qualcomm releases the MPSS firmware as a binary and you don't need to compile
    the build.

    **BTFM firmware**

    Qualcomm releases the BTFM firmware as a binary and you don't need to compile
    the build.

    **WLAN firmware**

    Qualcomm releases the WLAN firmware as a binary and you don't need to compile
    the build.

    **Generate firmware prebuilts**

    * Create an integrated firmware binary from the individual components that you
      compiled:
      ```bash theme={null}
      cd <firmware-root>/<distro-clone-directory>/CQ2390.LE.1.0/common/build
      python build.py --imf
      ```

    * Firmware prebuilt is successful if the following zip files are generated in
      the `<firmware-root>/<distro-clone-directory>/CQ2390.LE.1.0/common/build/bin`
      directory:
      * `Shikra_bootbinaries.zip`
      * `Shikra_fw.zip`
  </Tab>
</Tabs>

## Build BSP image

This section describes how to integrate firmware binaries and other source
components into a full BSP image using the meta-qcom-extras layer. The BSP
image build combines the compiled firmware from the previous step with the
Yocto layer stack, producing a flashable image that includes all required
binaries.

* Download Qualcomm's Yocto layer `meta-qcom-extras`. For the latest
  `<meta-qcom-extras-release-tag>`, see [Configuration Parameters](#configuration-parameters).

  ```bash theme={null}
  git clone https://qpm-git.qualcomm.com/home2/git/component-revision-history/qualcomm-linux/meta-qcom-extras.git -b <meta-qcom-extras-release-tag> --depth 1
  ```

**Layer Setup**

* Export `NETRC_FILE` parameter to ensure `~/.netrc` credentials are visible
  in the `kas` environment:
  ```bash theme={null}
  export NETRC_FILE=~/.netrc
  ```

* Set the outbound license for the layer and its checksum. `CUST_LICENSE`
  and `CUST_LIC_CHKSUM` are required for every recipe in the layer.
  * Customers must specify an appropriate outbound license in the recipes to
    build the proprietary sources.
  * Customers should consult their own legal team for guidance on outbound
    licensing decisions.
  * The chosen outbound license must be compatible with the PKLA.
  ```bash theme={null}
  export CUST_LICENSE="<CUST_LICENSE>"
  export CUST_LIC_CHKSUM="<CUST_LIC_CHKSUM>"
  ```

* The following values match the placeholder LICENSE files already present in the
  source repositories. Use them for internal builds and evaluation without needing
  to replace any license files.
  **Do not use these values for production builds. Define your own license
  values for any deployment.**

  | Variable | Value |
  | - | - |
  | `CUST_LICENSE` | `LICENSE.qcom-2` |
  | `CUST_LIC_CHKSUM` | `165287851294f2fb8ac8cbc5e24b02b0` |

* Update the license file in the source repositories before building.
  All sources used by `meta-qcom-extras` contain a placeholder LICENSE
  file by default. Recipes verify `CUST_LICENSE` against this file at
  build time, so it must be replaced with your chosen outbound license.

  The upstream repositories cannot be modified directly. Mirror each
  repository to a local or remote server you own, replace the placeholder
  LICENSE file, then update the `SRC_URI` variable in the affected recipes
  to point to the new URI.

**Firmware Setup**

* Set `FWZIP_PATH` to the directory containing the firmware ZIP files to
  include locally compiled firmware zip paths in the build.
  ```bash theme={null}
  export FWZIP_PATH="<FWZIP_PATH>"
  ```

* Set the modem-specific license and its checksum. `CUST_MDM_LICENSE` and
  `CUST_MDM_LIC_CHKSUM` are required only when building modem firmware.
  ```bash theme={null}
  export CUST_MDM_LICENSE="<CUST_MDM_LICENSE>"
  export CUST_MDM_LIC_CHKSUM="<CUST_MDM_LIC_CHKSUM>"
  ```

* The following values match the placeholder LICENSE files already present in the
  source repositories. Use them for internal builds and evaluation without needing
  to replace any license files.
  **Do not use these values for production builds. Define your own license
  values for any deployment.**

  | Variable | Value |
  | - | - |
  | `CUST_MDM_LICENSE` | `Modemreadme.txt` |
  | `CUST_MDM_LIC_CHKSUM` | `bcd23be15c15909fe9de30ec32af0f89` |

* `firmware-qcom-selective.inc` applies these rules at parse time:

  * If `FWZIP_PATH` or `FWZIP_NAME` are unset, the recipe is silently skipped.
  * If both are set but the ZIP file is missing, the build fails with a fatal error.
  * If no `PREFERRED_RPROVIDER` points to the recipe, the recipe is silently skipped.

* Edit `meta-qcom-extras/ci/providers.yml` to add the needed `FWZIP_NAME`
  assignments to enable the recipe during image compilation.

  <CodeGroup>
    ```yaml IQ-9075 theme={null}
    firmware-qcs9100: |
      FWZIP_NAME:pn-firmware-qcs9100 = "QCS9100_dsp"
    firmware-qcs9100-bootbins: |
      FWZIP_NAME:pn-firmware-qcs9100-bootbins = "QCS9100_bootbinaries"
    ```

    ```yaml IQ-8275 theme={null}
    firmware-qcs8300: |
      FWZIP_NAME:pn-firmware-qcs8300 = "QCS8300_dsp"
    firmware-qcs8300-bootbins: |
      FWZIP_NAME:pn-firmware-qcs8300-bootbins = "QCS8300_bootbinaries"
    ```

    ```yaml QCS6490 theme={null}
    firmware-qcs6490-adsp: |
      FWZIP_NAME:pn-firmware-qcs6490-adsp = "QCM6490_adsp"
    firmware-qcs6490-cdsp: |
      FWZIP_NAME:pn-firmware-qcs6490-cdsp = "QCM6490_cdsp"
    firmware-qcs6490-modem: |
      FWZIP_NAME:pn-firmware-qcs6490-modem = "QCM6490_modem"
    firmware-qcs6490-bootbins: |
      FWZIP_NAME:pn-firmware-qcs6490-bootbins = "QCM6490_bootbinaries"
    ```

    ```yaml IQ-615-EVK theme={null}
    firmware-qcs615-adsp: |
      FWZIP_NAME:pn-firmware-qcs615-adsp = "QCS615_adsp"
    firmware-qcs615-cdsp: |
      FWZIP_NAME:pn-firmware-qcs615-cdsp = "QCS615_cdsp"
    firmware-qcs615-bootbins: |
      FWZIP_NAME:pn-firmware-qcs615-bootbins = "QCS615_bootbinaries"
    ```

    ```yaml IQ-X7181-EVK theme={null}
    firmware-hamoa-adsp: |
      FWZIP_NAME:pn-firmware-hamoa-adsp = "IQX7181_adsp"
      PREFERRED_RPROVIDER_linux-firmware-qcom-x1e80100-audio = "firmware-hamoa-adsp"
      PREFERRED_RPROVIDER_hexagon-dsp-binaries-qcom-hamoa-iot-evk-adsp = "firmware-hamoa-adsp"
    firmware-hamoa-cdsp: |
      FWZIP_NAME:pn-firmware-hamoa-cdsp = "IQX7181_cdsp"
      PREFERRED_RPROVIDER_linux-firmware-qcom-x1e80100-compute = "firmware-hamoa-cdsp"
      PREFERRED_RPROVIDER_hexagon-dsp-binaries-qcom-hamoa-iot-evk-cdsp = "firmware-hamoa-cdsp"
    firmware-hamoa-purwa-bootbins: |
      FWZIP_NAME:pn-firmware-hamoa-purwa-bootbins = "HAMOA_bootbinaries"
      PREFERRED_PROVIDER_firmware-qcom-boot-iq-x7181 = "firmware-hamoa-purwa-bootbins"
    ```

    ```yaml IQ-X5121-EVK theme={null}
    firmware-purwa-adsp: |
      FWZIP_NAME:pn-firmware-purwa-adsp = "IQX5121_adsp"
      PREFERRED_RPROVIDER_linux-firmware-qcom-x1p42100-audio = "firmware-purwa-adsp"
      PREFERRED_RPROVIDER_hexagon-dsp-binaries-qcom-purwa-iot-evk-adsp = "firmware-purwa-adsp"
    firmware-purwa-cdsp: |
      FWZIP_NAME:pn-firmware-purwa-cdsp = "IQX5121_cdsp"
      PREFERRED_RPROVIDER_linux-firmware-qcom-x1p42100-compute = "firmware-purwa-cdsp"
      PREFERRED_RPROVIDER_hexagon-dsp-binaries-qcom-purwa-iot-evk-cdsp = "firmware-purwa-cdsp"
    firmware-hamoa-purwa-bootbins: |
      FWZIP_NAME:pn-firmware-hamoa-purwa-bootbins = "HAMOA_bootbinaries"
      PREFERRED_PROVIDER_firmware-qcom-boot-iq-x7181 = "firmware-hamoa-purwa-bootbins"
    ```

    ```yaml IQ2390 / CQ2390 theme={null}
    firmware-shikra-cdsp: |
      PREFERRED_RPROVIDER_linux-firmware-qcom-shikra-compute:shikra-evk = "firmware-shikra-cdsp"
      PREFERRED_RPROVIDER_hexagon-dsp-binaries-qcom-shikra-cqm-evk-cdsp:shikra-evk = "firmware-shikra-cdsp"
      PREFERRED_RPROVIDER_hexagon-dsp-binaries-qcom-shikra-cqs-evk-cdsp:shikra-evk = "firmware-shikra-cdsp"
      PREFERRED_RPROVIDER_hexagon-dsp-binaries-qcom-shikra-iqs-evk-cdsp:shikra-evk = "firmware-shikra-cdsp"
    firmware-shikra-lpaicp: |
      PREFERRED_RPROVIDER_linux-firmware-qcom-shikra-audio:shikra-evk = "firmware-shikra-lpaicp"
    firmware-shikra-bootbins: |
      PREFERRED_PROVIDER_firmware-qcom-boot-shikra:shikra-evk = "firmware-shikra-bootbins"
    ```
  </CodeGroup>

* Update the license file in the firmware ZIPs before building.
  All ZIPs used by `meta-qcom-extras` contain a placeholder LICENSE
  file by default. Recipes verify `CUST_LICENSE` against this file at
  build time, so it must be replaced with your chosen outbound license.

**Build Image**

* Run the setup script to apply these parameters to the build environment.

  ```bash theme={null}
  meta-qcom-extras/setup_extras_config.sh
  ```

* Build the software image using `kas`. You define build targets based
  on machine and distro combinations.

  <CodeGroup>
    ```bash IQ-9075-EVK theme={null}
    kas build meta-qcom-extras/ci/iq-9075-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
    ```

    ```bash IQ-8275-EVK theme={null}
    kas build meta-qcom-extras/ci/iq-8275-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
    ```

    ```bash IQ-615-EVK theme={null}
    kas build meta-qcom-extras/ci/iq-615-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
    ```

    ```bash QCS6490 theme={null}
    kas build meta-qcom-extras/ci/rb3gen2-core-kit.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
    ```

    ```bash IQ-X7181-EVK theme={null}
    kas build meta-qcom-extras/ci/iq-x7181-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
    ```

    ```bash IQ-X5121-EVK theme={null}
    kas build meta-qcom-extras/ci/iq-x5121-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
    ```

    ```bash IQ2390 / CQ2390 theme={null}
    kas build meta-qcom-extras/ci/shikra-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
    ```
  </CodeGroup>

## Related topics

* [How to change default installation path for Hexagon?](./how-to-change-hexagon-install-path)
