diff --git a/components/esptool_py/CMakeLists.txt b/components/esptool_py/CMakeLists.txt index 6d3b01c80b..f4ce6e0a93 100644 --- a/components/esptool_py/CMakeLists.txt +++ b/components/esptool_py/CMakeLists.txt @@ -34,12 +34,14 @@ if(NOT BOOTLOADER_BUILD) set(ESPTOOLPY_AFTER "no_reset") endif() - file(READ "flasher_args.json.in" flasher_args_content) - string(CONFIGURE "${flasher_args_content}" flasher_args_content) + if(CONFIG_APP_BUILD_GENERATE_BINARIES) + file(READ "flasher_args.json.in" flasher_args_content) + string(CONFIGURE "${flasher_args_content}" flasher_args_content) - file_generate("${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in" - CONTENT "${flasher_args_content}") - file_generate("${CMAKE_BINARY_DIR}/flasher_args.json" - INPUT "${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in") + file_generate("${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in" + CONTENT "${flasher_args_content}") + file_generate("${CMAKE_BINARY_DIR}/flasher_args.json" + INPUT "${CMAKE_CURRENT_BINARY_DIR}/flasher_args.json.in") + endif() endif() diff --git a/components/esptool_py/flasher_args.json.in b/components/esptool_py/flasher_args.json.in index 6b72fc9bfc..2152d68776 100644 --- a/components/esptool_py/flasher_args.json.in +++ b/components/esptool_py/flasher_args.json.in @@ -12,7 +12,7 @@ > }, $,, - >, + >$<$>:,> "extra_esptool_args" : { "after" : "${ESPTOOLPY_AFTER}", "before" : "${ESPTOOLPY_BEFORE}", diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index 7d42c44489..2b78a1f226 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -97,9 +97,10 @@ endif() idf_component_get_property(main_args esptool_py FLASH_ARGS) idf_component_get_property(sub_args esptool_py FLASH_SUB_ARGS) -esptool_py_flash_target(partition_table-flash "${main_args}" "${sub_args}") -esptool_py_flash_target_image(partition_table-flash partition_table "${PARTITION_TABLE_OFFSET}" - "${build_dir}/partition_table/partition-table.bin") -esptool_py_flash_target_image(flash partition_table "${PARTITION_TABLE_OFFSET}" - "${build_dir}/partition_table/partition-table.bin") - +if(CONFIG_APP_BUILD_GENERATE_BINARIES) + esptool_py_flash_target(partition_table-flash "${main_args}" "${sub_args}") + esptool_py_flash_target_image(partition_table-flash partition_table "${PARTITION_TABLE_OFFSET}" + "${build_dir}/partition_table/partition-table.bin") + esptool_py_flash_target_image(flash partition_table "${PARTITION_TABLE_OFFSET}" + "${build_dir}/partition_table/partition-table.bin") +endif() diff --git a/tools/ci/test_build_system_cmake.sh b/tools/ci/test_build_system_cmake.sh index 48a156a2fa..6526ef2dbe 100755 --- a/tools/ci/test_build_system_cmake.sh +++ b/tools/ci/test_build_system_cmake.sh @@ -716,6 +716,13 @@ endmenu\n" >> ${IDF_PATH}/Kconfig grep "build/dfu.bin\" has been written. You may proceed with DFU flashing." tmp.log || (tail -n 100 tmp.log ; failure "DFU build should succeed for esp32s2") rm tmp.log assert_built ${APP_BINS} ${BOOTLOADER_BINS} ${PARTITION_BIN} "dfu.bin" + rm -rf build sdkconfig + + print_status "Loadable ELF build works" + echo "CONFIG_APP_BUILD_TYPE_ELF_RAM=y" > sdkconfig + idf.py reconfigure || failure "Couldn't configure for loadable ELF file" + test -f build/flasher_args.json && failure "flasher_args.json should not be generated in a loadable ELF build" + idf.py build || failure "Couldn't build a loadable ELF file" print_status "All tests completed" if [ -n "${FAILURES}" ]; then diff --git a/tools/test_apps/system/gdb_loadable_elf/app_test.py b/tools/test_apps/system/gdb_loadable_elf/app_test.py index 126cf433d2..923c4077db 100644 --- a/tools/test_apps/system/gdb_loadable_elf/app_test.py +++ b/tools/test_apps/system/gdb_loadable_elf/app_test.py @@ -12,7 +12,7 @@ import ttfw_idf class SerialThread(object): def run(self, log_path, exit_event): - with serial.Serial('/dev/ttyUSB1', 115200) as ser, open(log_path, 'wb') as f: + with serial.Serial(os.getenv('ESPPORT', '/dev/ttyUSB1'), 115200) as ser, open(log_path, 'wb') as f: while True: f.write(ser.read(ser.in_waiting)) if exit_event.is_set(): @@ -38,7 +38,7 @@ class SerialThread(object): def test_app_loadable_elf(env, extra_data): rel_project_path = os.path.join('tools', 'test_apps', 'system', 'gdb_loadable_elf') - app_files = ['gdb_loadable_elf.elf', 'partition_table/partition-table.bin'] + app_files = ['gdb_loadable_elf.elf'] example = ttfw_idf.LoadableElfTestApp(rel_project_path, app_files, target="esp32") idf_path = example.get_sdk_path() proj_path = os.path.join(idf_path, rel_project_path) diff --git a/tools/test_apps/system/gdb_loadable_elf/sdkconfig.ci.default b/tools/test_apps/system/gdb_loadable_elf/sdkconfig.defaults similarity index 100% rename from tools/test_apps/system/gdb_loadable_elf/sdkconfig.ci.default rename to tools/test_apps/system/gdb_loadable_elf/sdkconfig.defaults