构建单体项目

本教程将指导您为 Qt 示例应用程序构建单片式 INTEGRITY 项目。您可以选择任何使用支持的 Qt 模块的 Qt 示例应用程序。

在构建单片式 INTEGRITY 项目之前,请运行setEnvironment.sh 脚本来准备构建环境。有关该脚本的更多信息,请参阅创建设置环境 shell 脚本

source ~/setEnvironment.sh

构建 Qt 应用程序

  • CMake 工具

    要使用 CMake 根据 Qt6 构建应用程序,请在终端中运行以下命令:

    <Qt installation path>/bin/qt-cmake <Qt example application path>/CMakeLists.txt
    cmake --build .

    其中,qt-cmake 是调用 CMake 的封装脚本,用于为项目配置适当的包含路径。

  • qmake 工具

    要使用 qmake 根据 Qt6 构建应用程序,请在终端运行以下命令:

    <Qt installation path>/bin/qmake <Qt example application path>/application.pro
    make

构建单片机项目

高通骁龙 8155P 板的板卡支持包 (BSP) 提供了一个构建脚本,用于为板卡分区创建一组映像:

/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/build_ghs.sh

通过在monolith-service.int文件中添加 Qt 应用程序,将其添加到构建中:

  • 启动 MULTI Launcher。
  • 选择Components >Open Project Manager
  • 选择/work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/qc_bsp目录下的项目文件default.gpj

    选择一个项目。

    MULTI 应用程序会显示一个窗口,其中包含所选文件夹中的项目文件列表。

  • 选择Open

在 MULTI 项目管理器视图中,您将看到已打开项目的树形结构。

浏览default.gpj 子项目:

  • 选择target.auto vmm-adp-no-gvm-sa8155 .gpj>vvm-adp-gvm-ref.gpj>monolith - service. gpj。您可以观察项目结构并编辑项目文件。
  • 选择monolith-service.int

    项目树

    选中的monolith-service.int文件会在项目树中突出显示。

  • 右键单击该文件,然后从上下文菜单中选择Edit
  • 在文件末尾添加以下行。
    AddressSpace
    Name    myappname
    Filename    /path/to/your/app/executable
    MemoryPoolSize 0x2700000
    Language    C++
    HeapSize    0x90000
    
    Task Initial
    StackSize    0x80000
    StartIt    false
    EndTask
    Extendedmemorypoolsize 0x300000
    EndAddressSpace

    注意: 将 </path/to/your/app/executable> 替换为应用程序可执行文件的路径。

  • 运行构建脚本。
    bash /work/ghs/sa8155/es7/es7_dev_env/hlos_dev_boot/apps/ghs_apps_proc/build_ghs.sh

现在,您的单片机项目已准备就绪,可以闪存到主板上了。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.