diff --git a/components/ulp/component_ulp_common.cmake b/components/ulp/component_ulp_common.cmake index ce207f802..30cbe44a7 100644 --- a/components/ulp/component_ulp_common.cmake +++ b/components/ulp/component_ulp_common.cmake @@ -15,4 +15,4 @@ foreach(ulp_exp_dep_src ${ULP_EXP_DEP_SRCS}) list(APPEND ulp_dep_srcs ${ulp_dep_src}) endforeach() -ulp_embed_binary(${ULP_APP_NAME} ${ulp_srcs} ${ulp_dep_srcs}) +ulp_embed_binary(${ULP_APP_NAME} "${ulp_srcs}" "${ulp_dep_srcs}") diff --git a/components/ulp/test/CMakeLists.txt b/components/ulp/test/CMakeLists.txt index 27311f953..072cfeb86 100644 --- a/components/ulp/test/CMakeLists.txt +++ b/components/ulp/test/CMakeLists.txt @@ -5,4 +5,4 @@ idf_component_register(SRC_DIRS "." set(ulp_app_name ulp_test_app) set(ulp_s_sources "ulp/test_jumps.S") set(ulp_exp_dep_srcs "test_ulp_as.c") -ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs}) +ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}") diff --git a/docs/en/api-guides/ulp.rst b/docs/en/api-guides/ulp.rst index 8cc9761f5..e68b10206 100644 --- a/docs/en/api-guides/ulp.rst +++ b/docs/en/api-guides/ulp.rst @@ -39,7 +39,7 @@ To compile ULP code as part of a component, the following steps must be taken: set(ulp_s_sources ulp/ulp_assembly_source_file.S) set(ulp_exp_dep_srcs "ulp_c_source_file.c") - ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs}) + ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}") The first argument to ``ulp_embed_binary`` specifies the ULP binary name. The name specified here will also be used other generated artifacts such as the ELF file, map file, header file and linker export file. The second argument specifies the ULP assembly source files. diff --git a/docs/zh_CN/api-guides/ulp.rst b/docs/zh_CN/api-guides/ulp.rst index 13ed09045..b4e122d65 100644 --- a/docs/zh_CN/api-guides/ulp.rst +++ b/docs/zh_CN/api-guides/ulp.rst @@ -44,8 +44,7 @@ ULP 协处理器代码是用汇编语言编写的,并使用 `binutils-esp32ulp ``set(ULP_APP_NAME ulp_${COMPONENT_NAME})`` 为生成的 ULP 应用程序设置名称,不带扩展名。此名称用于 ULP 应用程序的构建输出:ELF 文件、.map 文件、二进制文件、生成的头文件和链接器导出文件。 -``set(ULP_S_SOURCES "ulp/ulp_assembly_source_file_1.S ulp/ulp_assembly_source_file_2.S")`` - 设置要传递给 ULP 汇编器的程序集文件列表,用空格隔开,路径可以是绝对路径,也可以是组件 CMakeLists.txt 的相对路径。 + ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}") ``set(ULP_EXP_DEP_SRCS "ulp_c_source_file_1.c ulp_c_source_file_2.c")`` 设置组件中源文件名称的列表。所有包含被生成的头文件的原文件都必须在列表里。此列表建立正确构建依赖项,并确保在构建过程会先生成才编译包含头文件的原文件。请参考下文,查看为 ULP 应用程序生成的头文件等相关概念。此列表需要用空格隔开,路径可以是组件 CMakeLists.txt 文件的相对路径,也可以是绝对路径。 diff --git a/examples/system/ulp/main/CMakeLists.txt b/examples/system/ulp/main/CMakeLists.txt index af7cb3f76..98925d11a 100644 --- a/examples/system/ulp/main/CMakeLists.txt +++ b/examples/system/ulp/main/CMakeLists.txt @@ -18,4 +18,4 @@ set(ulp_exp_dep_srcs "ulp_example_main.c") # # 4. Call function to build ULP binary and embed in project using the argument # values above. -ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs}) +ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}") diff --git a/examples/system/ulp_adc/main/CMakeLists.txt b/examples/system/ulp_adc/main/CMakeLists.txt index ef85f9b2f..c2da07619 100644 --- a/examples/system/ulp_adc/main/CMakeLists.txt +++ b/examples/system/ulp_adc/main/CMakeLists.txt @@ -18,4 +18,4 @@ set(ulp_exp_dep_srcs "ulp_adc_example_main.c") # # 4. Call function to build ULP binary and embed in project using the argument # values above. -ulp_embed_binary(${ulp_app_name} ${ulp_s_sources} ${ulp_exp_dep_srcs}) +ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}")