高通的编译烧写流程

脚本来自: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文件。

相关推荐
CQ_YM1 天前
ARM之I2C与ADC
arm开发·嵌入式硬件·嵌入式·arm
plmm烟酒僧2 天前
使用 Lua 进行汽车 UDS 诊断:轻量级脚本化诊断新思路
嵌入式·lua·汽车电子·uds诊断·汽车诊断·can通信·诊断协议
charlie1145141912 天前
现代嵌入式 C++——自定义删除器(Custom Deleter)
开发语言·c++·笔记·学习·嵌入式
嵌入小生0072 天前
基于Linux系统下的C语言程序错误及常见内存问题调试方法教程(嵌入式-Linux-C语言)
linux·c语言·开发语言·嵌入式·小白·内存管理调试·程序错误调试
Hello_Embed3 天前
USB 虚拟串口源码改造与 FreeRTOS 适配
笔记·单片机·嵌入式·freertos·usb
LN花开富贵4 天前
LM393的工作原理和引脚作用
笔记·单片机·嵌入式硬件·学习·嵌入式
凉、介4 天前
ARM 架构中的内存屏障
arm开发·笔记·学习·架构·操作系统·嵌入式
Try1harder4 天前
极海APM32F107V6 + DP83848CVV驱动网口(一)
嵌入式·网口·极海
辰尘_星启5 天前
解决幽灵容器
linux·docker·容器·机器人·嵌入式
changzehai6 天前
Rust + VSCode + probe-rs搭建stm32-rs嵌入式开发调试环境
vscode·后端·stm32·rust·嵌入式·probe-rs