Quick Start
Initialize the workspace with repo, sync all source trees, and build the toolchains and components. Complete the common setup below, then pick a bootflow to build the images and flash the board.
Get the sources and build the stack
These three steps are shared by every bootflow. Do them once, then pick a bootflow below for the flow-specific image build and flashing.
# create the sandbox and pull the manifest mkdir sandbox.lemans && cd sandbox.lemans repo init -u https://github.com/ldts/qcom-manifest -m lemans.xml
repo sync -j4 --no-clone-bundle
cd build
make -j8 toolchains
make -j8 all # linux-firmware is fetched automatically by buildroot
make bootimage # tz.mbn + uefi.elf β the signed boot chain make efi # efi.bin β kernel UKI + Buildroot rootfs
Flash over USB β board plugged into this host, qdl on PATH
The board is in EDL (9008) mode on the same Linux host you built on,
with qdl on the PATH. These targets are flash-only β
the images were already built in step 4 β so they just push bits to the
device over USB.
For the full Linux procedure β installing qdl, putting the board
into EDL mode, and provisioning the UFS β follow Qualcomm's official
Flash over QLI guide.
# fetch the Qualcomm boot-chain blobs the flash targets need # (xbl, aop, cpucp, cdt, GPT + rawprogram XMLs) β no Yocto build needed make fetch-blobs # flash the full boot chain (LUNs 1β5) once, then the kernel (LUN 0) make flash-loader make flash-kernel
# reflash just efi.bin β no loader re-flash needed
make flash-kernel
Package for off-server flashing β board not on the build server
If the EVK lives on a different machine β typically a Windows
box running Qualcomm's PCATApp or QFIL β the
build server can't reach it over USB. Instead, package the images into a single
self-contained directory here, copy it across, and flash from there. The
edl-* targets assemble the package but flash nothing, so no
device needs to be connected while building. File lookup mirrors the flash
targets: input/ β Yocto deploy dir β blobs/, so
make fetch-blobs is enough to populate a package.
# build the images (steps 3β4) and fetch the boot-chain blobs first make fetch-blobs # assemble everything PCATApp/QFIL needs into one flat directory: # prog_firehose_ddr.elf, all rawprogram*/patch* XMLs, GPT bins, # firmware MBNs/ELFs, tz.mbn, uefi.elf, efi.bin, qupv3fw.elf make edl-package # output: lemans/output/edl-package/ # the target pre-selects the safe XML variants (originals kept as # *.xml.backup): rawprogram4 with qupfw_a/b populated (avoids GENI # SE boot storms) and rawprogram0 with rootfs.img stripped out.
# only XBL, CDT, tz.mbn, uefi.elf + supporting FW β no efi.bin/rootfs. # the path to take when only OP-TEE / U-Boot changed. OP-TEE is built # with full debug logging (LOG_LEVEL=4) for this package, then the # quiet production build is restored so lemans/output/ stays clean. make edl-bootloader # output: lemans/output/edl-bootloader/
# copy the whole directory across (scp, USB stick, share, β¦) scp -r lemans/output/edl-package user@winbox:C:/edl-package # put the board in EDL (9008) mode, then in the tool: # Programmer: prog_firehose_ddr.elf # XMLs: rawprogram0.xml β¦ rawprogram5.xml + patch0.xml (full) # rawprogram1β4.xml + patch1β4.xml (bootloader-only)
Re-provision the UFS β last resort after a firmware upgrade gone wrong
The board must be in EDL (9008) mode with qdl
on the PATH. The target downloads the CodeLinaro
provision.zip, loads the DDR firehose programmer (resolved just
like the flash targets: input/ β Yocto deploy dir β
blobs/), and applies a provision layout over
qdl --storage ufs. See Qualcomm's
Flash over QLI guide
for the full UFS provisioning procedure.
# default layout grows HLOS LUN 0 (provision_1_2.xml) β LUN 0 is # where this build writes efi.bin + rootfs.img make flash-ufs-provision # then rebuild the device from a clean slate make flash-loader make flash-kernel
# provision_1_1.xml grows User LUN 7 instead; larger NHLOS LUNs make flash-ufs-provision UFS_PROVISION_XML=provision_1_1.xml
Iterate on a single component
After the first full build, you rarely rebuild everything. Edit one tree (OP-TEE OS, TF-A, U-Boot or Linux), rebuild just that component, repackage, and reflash. Builds are incremental β only the changed source is recompiled β so the edit β flash loop is seconds to a couple of minutes, not the hour a full build takes.
# rebuild just the component you touched (incremental β secondsβminutes) make optee-os # or: make u-boot / make spl make bootimage # repackage the signed boot image (tz.mbn + uefi.elf) make flash-loader # reflash the boot chain
# rebuild the kernel (incremental β typically ~1β2 min) make linux make efi # repackage the EFI image / UKI (efi.bin) make flash-kernel # reflash the kernel partition only β firmware untouched
Lemans: SPL is signed locally via
qtestsign (open-source, no CASS required) β signing runs automatically
as part of make bootimage / make spl.
make fetch-blobs pulls the Qualcomm boot binaries and CDT directly from the
public Qualcomm / CodeLinaro URLs, so a full Yocto BSP build is not required.
The flash targets look for inputs in input/ β Yocto deploy dir β
blobs/, so the blobs fetched in step 3 are used automatically.
Build & flash the stock Yocto release
Build and flash the released, unmodified Qualcomm BSP as a known-good reference β nothing from the manifest is substituted. This flow flashes over USB from the build host only; there is no off-server package for it. Not required for a normal build β the Buildroot flow already gives you a bootable image.
# clones meta-qcom and builds via kas β several hours. # flash-yocto reads the release straight from the Yocto deploy # dir, so no manual copy into lemans/output/ is needed. make yocto
# flashes the pristine BSP: bootloader, firmware, efi.bin + rootfs.img. make flash-yocto # NOTE: this overwrites whatever flash-loader / flash-kernel installed. # Re-run those afterward to restore your custom build.
Run your kernel on the on-disk Yocto rootfs
Wrap the locally-built kernel in a UKI that boots
root=PARTLABEL=rootfs against the already-flashed
Yocto rootfs, instead of the Buildroot initramfs. Only the
efi.bin is reflashed β the rootfs is untouched.
Prerequisite: run the
Yocto flow first β make efi-kernel-only
errors out unless the Yocto efi.bin exists and the Yocto
rootfs is flashed on the board.
# wraps the freshly-built kernel in an efi.bin that boots the # on-disk Yocto rootfs (root=PARTLABEL=rootfs). make efi-kernel-only make flash-kernel # reflash efi.bin only β Yocto rootfs untouched
make efi-kernel-only builds the kernel for you β it depends on
make linux, which generates .config from
make linux-defconfig automatically on the first build and rebuilds
incrementally afterwards. Run make linux-defconfig yourself only to
clean and refresh the kernel config (it runs mrproper, forcing a
full rebuild) β e.g. after bumping the kernel or changing enabled options.
Run make help in build/ for the full target list.