diff --git a/docs/en/api-guides/build-system.rst b/docs/en/api-guides/build-system.rst index e5fecb8310..c22db7e76c 100644 --- a/docs/en/api-guides/build-system.rst +++ b/docs/en/api-guides/build-system.rst @@ -1643,6 +1643,23 @@ Flashing from Make ``make flash`` and similar targets still work to build and flash. However, project ``sdkconfig`` no longer specifies serial port and baud rate. Environment variables can be used to override these. See :ref:`flash-with-ninja-or-make` for more details. +Application Examples +-------------------- + +- :example:`build_system/wrappers` demonstrates how to use a linker feature to redefine or override any public function in both ESP-IDF and the bootloader, allowing modification or extension of a function's default behavior. + +- :example:`custom_bootloader/bootloader_override` demonstrates how to override the second-stage bootloader from a regular project, providing a custom bootloader that prints an extra message on startup, with the ability to conditionally override the bootloader based on certain conditions like target-dependency or KConfig options. + +- :example:`build_system/cmake/import_lib` demonstrates how to import and use third-party libraries using ExternalProject CMake module. + +- :example:`build_system/cmake/import_prebuilt` demonstrates how to import a prebuilt static library into the ESP-IDF build system, build a component with dependencies, and link it to the main component, ultimately outputting the current running partition. + +- :example:`build_system/cmake/idf_as_lib` demonstrates the creation of an application equivalent to :example:`hello world application ` using a custom CMake project. + +- :example:`build_system/cmake/multi_config` demonstrates how to build multiple configurations of a single application from a single codebase, it is useful for creating binaries for multiple similar products. + +- :example:`build_system/cmake/plugins` demonstrates features of the ESP-IDF build system related to link time registration of plugins, allowing you to add multiple implementations of a certain feature without the need to make the application aware of all these implementations. + .. _esp-idf-template: https://github.com/espressif/esp-idf-template .. _cmake: https://cmake.org .. _ninja: https://ninja-build.org diff --git a/docs/en/api-guides/tools/idf-component-manager.rst b/docs/en/api-guides/tools/idf-component-manager.rst index 4ba5721b68..b38b97f96b 100644 --- a/docs/en/api-guides/tools/idf-component-manager.rst +++ b/docs/en/api-guides/tools/idf-component-manager.rst @@ -33,7 +33,7 @@ To add a dependency to a component (e.g., ``my_component``) in your ESP-IDF proj To update dependencies of the ESP-IDF project, you can run the command ``idf.py update-dependencies``. You can also specify the path to the project directory using ``--project-dir PATH``. -There is an example application :example:`build_system/cmake/component_manager` that uses components installed by the component manager. +:example:`build_system/cmake/component_manager` demonstrates how to use the IDF Component Manager to download dependencies from the ESP Component Registry. It is not necessary to have a manifest for components that do not need any managed dependencies. diff --git a/docs/zh_CN/api-guides/build-system.rst b/docs/zh_CN/api-guides/build-system.rst index 95f1edf27a..569a3818dd 100644 --- a/docs/zh_CN/api-guides/build-system.rst +++ b/docs/zh_CN/api-guides/build-system.rst @@ -1643,6 +1643,23 @@ CMake 中不可用的功能 仍然可以使用 ``make flash`` 或者类似的目标来构建和烧录,但是项目 ``sdkconfig`` 不能再用来指定串口和波特率。可以使用环境变量来覆盖串口和波特率的设置,详情请参阅 :ref:`flash-with-ninja-or-make`。 +应用示例 +-------------------- + +- :example:`build_system/wrappers` 演示了如何使用链接器功能在 ESP-IDF 和引导程序中重新定义或覆盖任何公共函数,以修改或扩展函数的默认行为。 + +- :example:`custom_bootloader/bootloader_override` 演示了如何从常规项目中覆盖二级引导程序,提供一个自定义引导程序,在启动时打印额外的消息,并能够基于某些条件(如目标依赖性或 KConfig 选项)有条件地覆盖引导程序。 + +- :example:`build_system/cmake/import_lib` 演示了如何使用 ExternalProject CMake 模块导入和使用第三方库。 + +- :example:`build_system/cmake/import_prebuilt` 演示了如何将预构建的静态库导入到 ESP-IDF 构建系统中,构建具有依赖关系的组件,并将其链接到主组件,最终输出当前运行的分区。 + +- :example:`build_system/cmake/idf_as_lib` 演示了如何使用自定义 CMake 项目创建与 :example:`hello world application ` 类似的应用。 + +- :example:`build_system/cmake/multi_config` 演示了如何从单个代码库构建单个应用的多个配置,这可以方便地为多个相似产品创建固件。 + +- :example:`build_system/cmake/plugins` 演示了与插件的链接时注册相关的 ESP-IDF 构建系统功能,允许添加某个功能的多个实现,而无需让应用程序了解每个具体的实现。 + .. _esp-idf-template: https://github.com/espressif/esp-idf-template .. _Cmake: https://cmake.org .. _ninja: https://ninja-build.org diff --git a/docs/zh_CN/api-guides/tools/idf-component-manager.rst b/docs/zh_CN/api-guides/tools/idf-component-manager.rst index 0efcf519fb..2d70d03a22 100644 --- a/docs/zh_CN/api-guides/tools/idf-component-manager.rst +++ b/docs/zh_CN/api-guides/tools/idf-component-manager.rst @@ -33,7 +33,7 @@ IDF 组件管理器工具用于下载 ESP-IDF CMake 项目的依赖项,该下 要更新 ESP-IDF 项目的依赖项,请运行命令 ``idf.py update-dependencies``。你也可以使用 ``--project-dir PATH`` 选项,指定项目目录的路径。 -应用程序示例 :example:`build_system/cmake/component_manager` 使用了由组件管理器安装的组件。 +:example:`build_system/cmake/component_manager` 演示了如何使用 IDF 组件管理器从组件注册表中下载依赖项。 对于不需要受管理依赖项的组件,则无需提供清单文件。