From f1d3bfc0c7f2715336e50034ac4c10f955966f2e Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Thu, 5 Apr 2018 17:13:53 +1000 Subject: [PATCH] cmake: Add new flasher_args.json file for IDE parsing, document metadata files better --- components/esptool_py/CMakeLists.txt | 5 +++++ components/esptool_py/flasher_args.json.in | 11 +++++++++++ docs/en/api-guides/build-system-cmake.rst | 10 +++++++++- tools/cmake/project_description.json.in | 6 ------ 4 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 components/esptool_py/flasher_args.json.in diff --git a/components/esptool_py/CMakeLists.txt b/components/esptool_py/CMakeLists.txt index 5a7d23efd7..0d62557c81 100644 --- a/components/esptool_py/CMakeLists.txt +++ b/components/esptool_py/CMakeLists.txt @@ -7,3 +7,8 @@ foreach(part project app bootloader) "${CMAKE_BINARY_DIR}/flash_${part}_args" ) endforeach() + +configure_file( + "${CMAKE_CURRENT_LIST_DIR}/flasher_args.json.in" + "${CMAKE_BINARY_DIR}/flasher_args.json" + ) diff --git a/components/esptool_py/flasher_args.json.in b/components/esptool_py/flasher_args.json.in new file mode 100644 index 0000000000..0266316ea4 --- /dev/null +++ b/components/esptool_py/flasher_args.json.in @@ -0,0 +1,11 @@ +{ + "write_flash_args" : [ "--flash_mode", "${ESPFLASHMODE}", + "--flash_size", "${ESPFLASHSIZE}", + "--flash_freq", "${ESPFLASHFREQ}" ], + "flash_files" : { + "0x1000" : "bootloader/bootloader.bin", + "0x8000" : "partition_table/partition-table.bin", + "${CONFIG_APP_OFFSET}" : "${PROJECT_NAME}.bin", + "${PHY_PARTITION_OFFSET}" : "${PHY_PARTITION_BIN_FILE}" + } +} diff --git a/docs/en/api-guides/build-system-cmake.rst b/docs/en/api-guides/build-system-cmake.rst index c363058c60..a4de840608 100644 --- a/docs/en/api-guides/build-system-cmake.rst +++ b/docs/en/api-guides/build-system-cmake.rst @@ -638,7 +638,7 @@ You can pass any of these flasher argument files to ``esptool.py`` as follows:: Alternatively, it is possible to manually copy the parameters from the argument file and pass them on the command line. -The build directory also contains a generated file ``project_description.json`` which contains project information, including project flash information, in the JSON format. This file is used by ``idf.py`` and can also be used by other tools which need information about the project build. +The build directory also contains a generated file ``flasher_args.json`` which contains project flash information, in JSON format. This file is used by ``idf.py`` and can also be used by other tools which need information about the project build. Building the Bootloader ======================= @@ -727,6 +727,14 @@ The following variables no longer have default values: It is no longer necessary to set ``COMPONENT_SRCDIRS`` if setting ``COMPONENT_SRCS`` (in fact, ``COMPONENT_SRCDIRS`` is ignored if ``COMPONENT_SRCS`` is set). +Build System Metadata +===================== + +For integration into IDEs and other build systems, when cmake runs the build process generates a number of metadata files in the ``build/`` directory. To regenerate these files, run ``cmake`` or ``idf.py reconfigure`` (or any other ``idf.py`` build command). + +- ``project_description.json`` contains some general information about the project, configured paths, etc. +- ``flasher_args.json`` contains esptool.py arguments to flash the project's binary files. There are also ``flash_*_args`` files which can be used directly with esptool.py. See `Flash arguments`. +- ``CMakeCache.txt`` is the CMake cache file which contains other information about the CMake process, toolchain, etc. .. _esp-idf-template: https://github.com/espressif/esp-idf-template .. _cmake: https://cmake.org diff --git a/tools/cmake/project_description.json.in b/tools/cmake/project_description.json.in index 2fb99c149d..1acffbd627 100644 --- a/tools/cmake/project_description.json.in +++ b/tools/cmake/project_description.json.in @@ -6,12 +6,6 @@ "app_elf": "${PROJECT_NAME}.elf", "app_bin": "${PROJECT_NAME}.bin", "git_revision": "${IDF_VER}", - "project_binaries": { - "bootloader": [ "0x1000", "bootloader/bootloader.bin" ], - "partition_table": [ "0x8000", "partition_table/partition-table.bin" ], - "app": [ "${CONFIG_APP_OFFSET}", "${PROJECT_NAME}.bin" ], - "phy_data": [ "${PHY_PARTITION_OFFSET}", "${PHY_PARTITION_BIN_FILE}" ] - }, "phy_data_partition": "${CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION}", "monitor_baud" : "${CONFIG_MONITOR_BAUD}" } -- 2.40.0