From c863a79a6d30ba30ac26fb27aaf823fd23d50a6f Mon Sep 17 00:00:00 2001 From: Armando Date: Mon, 11 Jul 2022 21:06:11 +0800 Subject: [PATCH 1/2] idf_as_lib: remove dependency to esp_psram Previously this dependency is introduced by mistake. As idf_as_lib example doesn't need esp_psram, remove this dependency. --- examples/build_system/cmake/idf_as_lib/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/build_system/cmake/idf_as_lib/CMakeLists.txt b/examples/build_system/cmake/idf_as_lib/CMakeLists.txt index 3a61956499..d9be86955e 100644 --- a/examples/build_system/cmake/idf_as_lib/CMakeLists.txt +++ b/examples/build_system/cmake/idf_as_lib/CMakeLists.txt @@ -15,7 +15,7 @@ if("${TARGET}" IN_LIST targets) # although esptool_py does not generate static library, # processing the component is needed for flashing related # targets and file generation - COMPONENTS freertos esptool_py esp_psram + COMPONENTS freertos esptool_py SDKCONFIG ${CMAKE_CURRENT_LIST_DIR}/sdkconfig BUILD_DIR ${CMAKE_BINARY_DIR}) else() @@ -33,7 +33,7 @@ add_executable(${elf_file} main.c) # Link the static libraries to the executable if("${TARGET}" IN_LIST targets) - target_link_libraries(${elf_file} idf::freertos idf::spi_flash idf::esp_psram) + target_link_libraries(${elf_file} idf::freertos idf::spi_flash) # Attach additional targets to the executable file for flashing, # linker script generation, partition_table generation, etc. idf_build_executable(${elf_file}) From 082ee45a762e9ee147a32efe7635be4752f20de8 Mon Sep 17 00:00:00 2001 From: Armando Date: Mon, 11 Jul 2022 21:07:51 +0800 Subject: [PATCH 2/2] ci: remove mfix-esp32-psram-cache-issue flag test when building idf_as_lib Previously psram driver was in esp_hw_support, which is a common requirement(when in non-bootloader build). So when building idf_as_lib (on esp32), the mfix-esp32-psram-cache-issue flag will always be added (when CONFIG_SPIRAM_CACHE_WORKAROUND is on). As psram driver is moved to esp_psram component, and esp_psram is added via idf_component_optional_requires, which is a "weak" dependency. You need to include esp_psram compoennt explicitly if psram will be in use. As idf_as_lib doesn't need psram, this test can be removed. --- tools/ci/test_build_system_cmake.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 489ea3f344..dd511cd472 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -529,12 +529,9 @@ function run_tests() print_status "Test for external libraries in custom CMake projects with ESP-IDF components linked" mkdir build IDF_AS_LIB=$IDF_PATH/examples/build_system/cmake/idf_as_lib - echo "CONFIG_SPIRAM=y" > $IDF_AS_LIB/sdkconfig - echo "CONFIG_SPIRAM_CACHE_WORKAROUND=y" >> $IDF_AS_LIB/sdkconfig # note: we just need to run cmake (cd build && cmake $IDF_AS_LIB -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32.cmake -DTARGET=esp32) grep -q '"command"' build/compile_commands.json || failure "compile_commands.json missing or has no no 'commands' in it" - (grep '"command"' build/compile_commands.json | grep -v mfix-esp32-psram-cache-issue) && failure "All commands in compile_commands.json should use PSRAM cache workaround" for strat in MEMW NOPS DUPLDST; do print_status "Test for external libraries in custom CMake projects with PSRAM strategy $strat"