高通的编译烧写流程

脚本来自:pds/sh/turbox/tools/build_script/common/turbox_build.sh at master · sghong/pds · GitHub

唉,最后还是来看这个,这次就好好总结一下吧。。以最常用的QFIL的FLAT包为例。

从脚本可以看出模块的划分

build_all(){

build_bl

build_uefi

build_rpm

build_aop

build_tz

build_adsp

build_cdsp

build_mpss

build_slpi

build_hlos

update_common_info

}

1 HLOS

source build/envsetup.sh

lunch qssi-userdebug

bash build.sh -j32 dist --qssi_only EXPERIMENTAL_USE_OPENJDK9=1.8

source build/envsetup.sh

lunch <target>-userdebug

bash build.sh -j8 dist --target_only EXPERIMENTAL_USE_OPENJDK9=1.8

这一步可以生成boot.img, system.img, userdata.img

如果是安装好的设备,可以使用fastboot刷写。

复制代码
# 烧录 boot.img
fastboot flash boot out/target/product/DEVICE/boot.img

# 烧录 system.img
fastboot flash system out/target/product/DEVICE/system.img

# 烧录 userdata.img
fastboot flash userdata out/target/product/DEVICE/userdata.img

# 烧录 recovery.img (可选)
fastboot flash recovery out/target/product/DEVICE/recovery.img

2 非HLOS

MPSS

Build images -- ./build_variant.py divar.gen.prod bparams=-k

Clean the build -- ./build_variant.py divar.gen.prod --clean

烧写

复制代码
fastboot flash modem modem.mbn

Bootloader

Trustzone

RPM

aDSP

cDSP

WLAN

video

3 分区

这个要单独制作一个partition.xml,这个好像是专供高通平台用的。

复制代码
<?xml version="1.0" encoding="UTF-8" ?>
<data>
    <partition>
        <label>boot</label>
        <filename>boot.img</filename>
        <physical_partition_number>0</physical_partition_number>
        <start_sector>32768</start_sector>
        <size_in_KB>8192</size_in_KB>
    </partition>
    <partition>
        <label>modem</label>
        <filename>modem.mbn</filename>
        <physical_partition_number>0</physical_partition_number>
        <start_sector>65536</start_sector>
        <size_in_KB>16384</size_in_KB>
    </partition>
    <!-- 更多分区定义 -->
</data>

4 打包

将所有文件放在一个文件夹,如下:

复制代码
/flat_install_package/
  ├── boot.img
  ├── emmc_appsboot.mbn
  ├── modem.mbn
  ├── rpm.mbn
  ├── tz.mbn
  ├── sbl1.mbn
  ├── system.img
  ├── userdata.img
  ├── partition.xml   # 分区表描述文件 (QFIL 等工具需要的文件)

之后直接使用zip压缩即可。

5 烧写

烧写的时候选中分区xml文件。

相关推荐
CinzWS9 分钟前
中断向量表中断号与 CMSIS IRQn 映射关系深度剖析:从硬件索引到软件句柄的桥梁
arm开发·架构·系统架构·嵌入式·cortex-m3·中断
small_wh1te_coder1 天前
拷打字节技术总监: 详解c语言嵌入式多线程编程中的头文件 #总结 上下篇合 #
c语言·开发语言·算法·操作系统·嵌入式
你疯了抱抱我1 天前
【射频】SMA天线、IPEX底座、IPEX带线插头(RF1.13)转SMA转接头 的选型和理由 原理分析
嵌入式硬件·嵌入式·射频工程·pcb·电路·电子
SSONICX1 天前
RK3506:1.介绍
嵌入式
济6171 天前
STM32实战:ADC单通道单次转换,光敏传感器实现智能光控LED---STM32 HAL库专栏
stm32·单片机·嵌入式·stm32hal库编程
FreakStudio1 天前
lvgl-micropython、lv_micropython和lv_binding_micropython到底啥关系?一文读懂
python·单片机·嵌入式·面向对象·电子diy
C^h2 天前
RTthread中的内存池理解
linux·数据库·c++·算法·嵌入式
正点原子2 天前
《DNESP32P4开发指南_V1.0》第十一章 LED实验
单片机·物联网·嵌入式
BackCatK Chen2 天前
2026国产科技技术全景解析:从芯片到系统的全栈自主可控路径
科技·嵌入式·业界资讯·鸿蒙·国产科技
FreakStudio2 天前
0 元学嵌入式 GUI!保姆级 LVGL+MicroPython 教程开更,从理论到实战全搞定
python·单片机·嵌入式·面向对象·电子diy