Provides a high-level overview of how to build firmware
components from source and integrate them into the Qualcomm BSP image.
It is intended for registered users with the appropriate licenses, as
access to firmware sources is restricted.At a high level, you will learn the following:
Set up the host system and install the required packages – Host Setup
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.
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:
The following instructions are intended for use on a Ubuntu host system. The
Yocto build is also supported on other distributions
compatible with Yocto, but no validation is performed against them.
Install the following packages to prepare your host environment for the Yocto build
Qualcomm uses the kas tool to sync and build the Yocto project. Use
the following commands to install kas on your system
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.
sudo apt install pipx # Restart your shell session after running this command to ensure # path changes take effect pipx ensurepath # The kas version is expected to be 4.8 or higher pipx install "kas>=4.8"
The following packages are additionally required to compile firmware:
# Add the following git configurations to fetch large size repositories and to avoid unreliable connectionsgit config --global http.postBuffer 1048576000git config --global http.maxRequestBuffer 1048576000git config --global http.lowSpeedLimit 0git config --global http.lowSpeedTime 999999# Add the following git configurations to follow remote redirects from http-alternates files or alternatesgit config --global http.https://chipmaster2.qti.qualcomm.com.followRedirects truegit config --global http.https://qpm-git.qualcomm.com.followRedirects true
The following tables describe the firmware distributions that you can download.
For more information about the Yocto layers, see
Qualcomm Linux metadata layers.Mapping access levels to firmware distributions
Distribution
Description
Yocto layers
Qualcomm_Linux.SPF.2.0|AP|Standard|OEM|NoModem
High-level OS and firmware source (GPS only)
meta-qcom meta-qcom-distro meta-qcom-extras
Qualcomm_Linux.SPF.2.0|AP|Standard|OEM
High-level OS and firmware (GPS only) source
meta-qcom meta-qcom-distro meta-qcom-extras
Qualcomm_Linux.SPF.2.0|AMSS|Standard|OEM
High-level OS and firmware (GPS and modem) source
meta-qcom meta-qcom-distro meta-qcom-extras
Mapping firmware distributions to git repositories
Substitute the <firwmare-root> and <distro-clone-directory> in the following
commands with the correct values based on the chosen access profile.
QCM6490/QCS5430
IQ-9075
IQ-8275
IQ-615
IQ-X7181
IQ-X5121
Prerequisites
Ensure that the working shell is bash:
echo $0
The expected output of the command should be bash. If not, enter the bash
shell.
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.
Install LLVM for AOP, Qualcomm® Trusted Execution Environment
(TEE), and boot compilation:
cd <firmware-root>mkdir llvm# Sign in to qsc-cli and activate the licenseqsc-cli loginqsc-cli tool activate-license --name sdllvm_arm# LLVM requirement for boot compilation is 14.0.4qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4chmod -R 777 <firmware-root>/llvm/14.0.4# LLVM requirement for the Qualcomm TEE compilation is 16.0.7qsc-cli tool install --name sdllvm_arm --required-version 16.0.7 --path <firmware-root>/llvm/16.0.7chmod -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):
Install and set up Qualcomm® Hexagon™ 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.
For debug variant builds, replace RELEASE with DEBUG.
Build Qualcomm TEE firmwareTools required
Compiler version: LLVM 16.0.7
Python version: Python 3.10
Build steps
Install LLVM:
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/
CPUCP firmwareQualcomm releases the CPUCP firmware as a binary and you don’t need to compile
the build.CPUSYS.VM firmwareQualcomm releases the CPUSYS.VM firmware as a binary and you don’t need to
compile the build.BTFM firmwareQualcomm releases the BTFM firmware as a binary and you don’t need to compile
the build.WLAN firmwareQualcomm 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:
cd <firmware-root>/<distro-clone-directory>/QCM6490.LE.2.0/common/buildpython 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
Prerequisites
Ensure that the working shell is bash:
echo $0
The expected output of the command should be bash. If not, enter the
bash shell.
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:
Install LLVM for AOP, Qualcomm® Trusted Execution Environment
(TEE), and boot compilation:
cd <firmware-root>mkdir llvm# Sign in to qsc-cli and activate the licenseqsc-cli loginqsc-cli tool activate-license --name sdllvm_arm# LLVM requirement for boot compilation is 14.0.4qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4chmod -R 777 <firmware-root>/llvm/14.0.4# LLVM requirement for the Qualcomm TEE compilation is 16.0.7qsc-cli tool install --name sdllvm_arm --required-version 16.0.7 --path <firmware-root>/llvm/16.0.7chmod -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):
Install and set up Qualcomm® Hexagon™. 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.
For debug variant builds, replace RELEASE with DEBUG.
Build Qualcomm TEE firmwareTools required
Compiler version: LLVM 16.0.7
Python version: Python 3.10
Build steps
Install LLVM:
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/
CPUCP firmwareQualcomm releases the CPUCP firmware as a binary and you don’t need to compile
the build.CPUSYS.VM firmwareQualcomm releases the CPUSYS.VM firmware as a binary and you don’t need to
compile the build.BTFM firmwareQualcomm releases the BTFM firmware as a binary and you don’t need to compile
the build.WLAN firmwareQualcomm 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:
cd <firmware-root>/<distro-clone-directory>/QCS9100.LE.2.0/common/buildpython 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
Prerequisites
Ensure that the working shell is bash:
echo $0
The expected output of the command should be bash. If not, enter the
bash shell.
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.
Install LLVM for AOP, Qualcomm® Trusted Execution Environment
(TEE), and boot compilation:
cd <firmware-root>mkdir llvm# Sign in to qsc-cli and activate the licenseqsc-cli loginqsc-cli tool activate-license --name sdllvm_arm# LLVM requirement for boot compilation is 14.0.4qsc-cli tool install --name sdllvm_arm --required-version 14.0.4 --path <firmware-root>/llvm/14.0.4chmod -R 777 <firmware-root>/llvm/14.0.4# LLVM requirement for the Qualcomm TEE compilation is 16.0.7qsc-cli tool install --name sdllvm_arm --required-version 16.0.7 --path <firmware-root>/llvm/16.0.7chmod -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):
Install and set up Qualcomm® Hexagon™. 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.
For debug variant builds, replace RELEASE with DEBUG.
Build Qualcomm TEE firmwareTools required
Compiler version: LLVM 16.0.7
Python version: Python 3.10
Build steps
Install LLVM:
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/
CPUCP firmwareQualcomm releases the CPUCP firmware as a binary and you don’t need to compile
the build.CPUSYS.VM firmwareQualcomm releases the CPUSYS.VM firmware as a binary and you don’t need to
compile the build.BTFM firmwareQualcomm releases the BTFM firmware as a binary and you don’t need to compile
the build.WLAN firmwareQualcomm 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:
cd <firmware-root>/<distro-clone-directory>/QCS8300.LE.2.0/common/buildpython 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
Prerequisites
Ensure that the working shell is bash:
echo $0
The expected output of the command should be bash. If not, enter the
bash shell.
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.
Install and set up Qualcomm® Hexagon™. 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.
For debug variant builds, replace RELEASE with DEBUG.
Build TrustZoneTools required
Compiler version: LLVM 16.0.7
Python version: Python 3.10
Build steps
Install LLVM:
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/
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 firmwareQualcomm releases the BTFM firmware as a binary and you don’t need to compile
the build.WLAN firmwareQualcomm 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:
cd <firmware-root>/<distro-clone-directory>/QCS615.LE.2.0/common/buildpython 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
Prerequisites
Ensure that the working shell is bash:
echo $0
The expected output of the command should be bash. If not, enter the
bash shell.
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.
Install and set up Qualcomm® Hexagon™ 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.
cd <firmware-root>/<distro-clone-directory>/AOP.HO.5.2/
Build the image:
./aop_proc/build/build_hamoa.sh
CPUCP firmwareQualcomm releases the CPUCP firmware as a binary and you don’t need to compile
the build.BTFM firmwareQualcomm releases the BTFM firmware as a binary and you don’t need to compile
the build.WLAN firmwareQualcomm 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:
cd <firmware-root>/<distro-clone-directory>/Hamoa_IOT.LE.2.0/common/buildpython 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
Prerequisites
Ensure that the working shell is bash:
echo $0
The expected output of the command should be bash. If not, enter the
bash shell.
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.
Install and set up Qualcomm® Hexagon™ 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.
cd <firmware-root>/<distro-clone-directory>/AOP.HO.5.2/
Build the image:
./aop_proc/build/build_purwa.sh
CPUCP firmwareQualcomm releases the CPUCP firmware as a binary and you don’t need to compile
the build.BTFM firmwareQualcomm releases the BTFM firmware as a binary and you don’t need to compile
the build.WLAN firmwareQualcomm 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:
cd <firmware-root>/<distro-clone-directory>/Purwa.LE.2.0/common/buildpython 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:
This section describes how to integrate firmware binaries and other source
components into a full BSP image build. The BSP image build combines the
compiled firmware outputs from the previous step with the Yocto layer stack,
producing a flashable image that includes all required binaries.
IQ-X7181 and IQ-X5121 aren’t supported by the meta-qcom-extras layer yet; to
load custom firmware binaries on these boards, use devtool to modify the
upstream recipes instead.
IQ-X7181
IQ-X5121
Other Kits
Download Qualcomm’s Yocto layer meta-qcom-extras. For the latest
<meta-qcom-extras-release-tag>, see Configuration Parameters.
Set your Qualcomm Customer ID. To find it, sign in at qualcomm.com,
click the Profile icon, select Account Settings, and scroll to the
Company Information section.
export CUST_ID="<CUST_ID>"
Set the outbound license for the layer and its checksum. CUST_LICENSE
and CUST_LIC_CHKSUM are required for every recipe in the layer.
Export NETRC_FILE parameter to ensure ~/.netrc credentials are visible
in the kas environment:
export NETRC_FILE=~/.netrc
Update the license file in the source repositories. By default, all sources
used by meta-qcom-extras contain a placeholder LICENSE file. Replace it
with your outbound license in each source before building. The recipes verify
CUST_LICENSE against this file at build time.
Firmware Setup
Set FWZIP_PATH to the directory containing the firmware ZIP files to
include locally compiled firmware zip paths in the build.
export FWZIP_PATH="<FWZIP_PATH>"
Override Linux-firmware BinariesIf you want to modify the Linux firmware binaries, use this section to
substitute them into the build.
Create a kas configuration file at meta-qcom-extras/ci/firmware.yml with the
following content:
When you override the firmwares in linux-firmware, you must also override
the Hexagon DSP binaries.
Override DSPSO BinariesIf you want to modify the Hexagon DSP shared-object binaries, use this section
to substitute the ADSP and CDSP binaries into the build.
Initialize a devtool workspace for hexagon-dsp-binaries:
kas shell -c "devtool modify hexagon-dsp-binaries" meta-qcom-extras/ci/iq-x7181-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
Unzip the firmware archive:
unzip $FWZIP_PATH/HAMOA_fw.zip -d $FWZIP_PATH
Copy the ADSP binaries into the devtool workspace:
Once all override steps are complete, the subsequent Yocto image build will
automatically use the locally provided firmware binaries rather than upstream sources.Build Image
Run the setup script to apply these parameters to the build environment.
meta-qcom-extras/setup_extras_config.sh
Build the software image using kas. You define build targets based
on machine and distro combinations.
kas shell -c "devtool build-image qcom-multimedia-proprietary-image" meta-qcom-extras/ci/iq-x7181-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
Download Qualcomm’s Yocto layer meta-qcom-extras. For the latest
<meta-qcom-extras-release-tag>, see Configuration Parameters.
Set your Qualcomm Customer ID. To find it, sign in at qualcomm.com,
click the Profile icon, select Account Settings, and scroll to the
Company Information section.
export CUST_ID="<CUST_ID>"
Set the outbound license for the layer and its checksum. CUST_LICENSE
and CUST_LIC_CHKSUM are required for every recipe in the layer.
Export NETRC_FILE parameter to ensure ~/.netrc credentials are visible
in the kas environment:
export NETRC_FILE=~/.netrc
Update the license file in the source repositories. By default, all sources
used by meta-qcom-extras contain a placeholder LICENSE file. Replace it
with your outbound license in each source before building. The recipes verify
CUST_LICENSE against this file at build time.
Firmware Setup
Set FWZIP_PATH to the directory containing the firmware ZIP files to
include locally compiled firmware zip paths in the build.
export FWZIP_PATH="<FWZIP_PATH>"
Override Linux-firmware BinariesIf you want to modify the Linux firmware binaries, use this section to
substitute them into the build.
Create a kas configuration file at meta-qcom-extras/ci/firmware.yml with the
following content:
When you override the firmwares in linux-firmware, you must also override
the Hexagon DSP binaries.
Override DSPSO BinariesIf you want to modify the Hexagon DSP shared-object binaries, use this section
to substitute the ADSP and CDSP binaries into the build.
Initialize a devtool workspace for hexagon-dsp-binaries:
kas shell -c "devtool modify hexagon-dsp-binaries" meta-qcom-extras/ci/iq-x5121-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
Unzip the firmware archive:
unzip $FWZIP_PATH/HAMOA_fw.zip -d $FWZIP_PATH
Copy the ADSP binaries into the devtool workspace:
Once all override steps are complete, the subsequent Yocto image build will
automatically use the locally provided firmware binaries rather than upstream sources.Build Image
Run the setup script to apply these parameters to the build environment.
meta-qcom-extras/setup_extras_config.sh
Build the software image using kas. You define build targets based
on machine and distro combinations.
kas shell -c "devtool build-image qcom-multimedia-proprietary-image" meta-qcom-extras/ci/iq-x5121-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml
Download Qualcomm’s Yocto layer meta-qcom-extras. For the latest
<meta-qcom-extras-release-tag>, see Configuration Parameters.
Set your Qualcomm Customer ID. To find it, sign in at qualcomm.com,
click the Profile icon, select Account Settings, and scroll to the
Company Information section.
export CUST_ID="<CUST_ID>"
Set the outbound license for the layer and its checksum. CUST_LICENSE
and CUST_LIC_CHKSUM are required for every recipe in the layer.
Export NETRC_FILE parameter to ensure ~/.netrc credentials are visible
in the kas environment:
export NETRC_FILE=~/.netrc
Update the license file in the source repositories. By default, all sources
used by meta-qcom-extras contain a placeholder LICENSE file. Replace it
with your outbound license in each source before building. The recipes verify
CUST_LICENSE against this file at build time.
Firmware Setup
Set FWZIP_PATH to the directory containing the firmware ZIP files to
include locally compiled firmware zip paths in the build.
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.
Update the license file in the firmware ZIPs. By default, all ZIPs
used by meta-qcom-extras contain a placeholder LICENSE file. Replace it
with your outbound license in each ZIP before building. The recipes verify
CUST_LICENSE against this file at build time.
Build Image
Run the setup script to apply these parameters to the build environment.
meta-qcom-extras/setup_extras_config.sh
Build the software image using kas. You define build targets based
on machine and distro combinations.
kas build meta-qcom-extras/ci/iq-9075-evk.yml:meta-qcom-extras/ci/qcom-distro.yml:meta-qcom-extras/ci/performance.yml