From ad283fed1d1d6fa8b50011c60c8aee7bd14d8a62 Mon Sep 17 00:00:00 2001 From: Chen Wu Date: Wed, 27 Mar 2024 10:17:49 +0800 Subject: [PATCH] feat(ESPAT-1918): Supported to use external module_config - Supported to override the system configuration - Supported to override the patch directory - Supported to override the system partition table - Supported to override the secondary partition table - Supported to override the esp-idf version - Added an at_override_module_config example and detailed readme --- CMakeLists.txt | 28 ++- build.py | 22 ++- .../customized_partitions/CMakeLists.txt | 12 +- .../at_override_module_config/IDF_VERSION | 3 + examples/at_override_module_config/README.md | 97 ++++++++++ .../at_customize.csv | 2 + .../partitions_at.csv | 6 + .../patch/at_example.patch | 20 ++ .../patch/patch_list.ini | 9 + .../patch/support_ext_partition.patch | 20 ++ .../sdkconfig.defaults | 174 ++++++++++++++++++ .../module_esp32-d2wd/patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../module_esp32-sdio/patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../module_esp32_default/patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../module_esp32c2-2mb/patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../module_esp32c3-spi/patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ .../module_wrover-32/patch/patch_list.ini | 4 + .../patch/support_ext_partition.patch | 20 ++ 33 files changed, 643 insertions(+), 14 deletions(-) create mode 100644 examples/at_override_module_config/IDF_VERSION create mode 100644 examples/at_override_module_config/README.md create mode 100644 examples/at_override_module_config/at_customize.csv create mode 100644 examples/at_override_module_config/partitions_at.csv create mode 100644 examples/at_override_module_config/patch/at_example.patch create mode 100644 examples/at_override_module_config/patch/patch_list.ini create mode 100644 examples/at_override_module_config/patch/support_ext_partition.patch create mode 100644 examples/at_override_module_config/sdkconfig.defaults create mode 100644 module_config/module_esp32-d2wd/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32-sdio/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32_default/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32c2-2mb/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32c2_default/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32c3-spi/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32c3_default/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch create mode 100644 module_config/module_esp32c6_default/patch/support_ext_partition.patch create mode 100644 module_config/module_wrover-32/patch/support_ext_partition.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index e69dfd1a..8414565e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,10 @@ string(SUBSTRING "$ENV{ESP_AT_PROJECT_PLATFORM}" 9 31 PLATFORM_NAME) # remove PL string(STRIP ${PLATFORM_NAME} PLATFORM_NAME) string(TOLOWER ${PLATFORM_NAME} LOWER_NAME) -set(ESP_AT_MODULE_CONFIG_DIR ${CMAKE_SOURCE_DIR}/module_config/module_${LOWER_NAME}_default ) +set(ESP_AT_MODULE_CONFIG_DIR ${CMAKE_SOURCE_DIR}/module_config/module_${LOWER_NAME}_default) endif() -SET(ENV{ESP_AT_PROJECT_PATH} ${CMAKE_SOURCE_DIR} ) +SET(ENV{ESP_AT_PROJECT_PATH} ${CMAKE_SOURCE_DIR}) if (NOT DEFINED SILENCE) if (DEFINED ENV{SILENCE}) @@ -28,16 +28,32 @@ set(SILENCE 0) endif() endif() +# set the sdkconfig default file if (${SILENCE} EQUAL 1) -set(SDKCONFIG_DEFAULTS ${ESP_AT_MODULE_CONFIG_DIR}/sdkconfig_silence.defaults) + if(DEFINED ENV{AT_EXT_MODULE_CFG} AND EXISTS "$ENV{AT_EXT_MODULE_CFG}/sdkconfig_silence.defaults") + set(SDKCONFIG_DEFAULTS $ENV{AT_EXT_MODULE_CFG}/sdkconfig_silence.defaults) + else() + set(SDKCONFIG_DEFAULTS ${ESP_AT_MODULE_CONFIG_DIR}/sdkconfig_silence.defaults) + endif() else() -set(SDKCONFIG_DEFAULTS ${ESP_AT_MODULE_CONFIG_DIR}/sdkconfig.defaults) + if(DEFINED ENV{AT_EXT_MODULE_CFG} AND EXISTS "$ENV{AT_EXT_MODULE_CFG}/sdkconfig.defaults") + set(SDKCONFIG_DEFAULTS $ENV{AT_EXT_MODULE_CFG}/sdkconfig.defaults) + else() + set(SDKCONFIG_DEFAULTS ${ESP_AT_MODULE_CONFIG_DIR}/sdkconfig.defaults) + endif() endif() +message(STATUS "silence:${SILENCE}, sdkconfig:${SDKCONFIG_DEFAULTS}") -message("silence:${SILENCE} sdkconfig:${SDKCONFIG_DEFAULTS}") +# set the base directory of partition table +if(DEFINED ENV{AT_EXT_MODULE_CFG} AND EXISTS "$ENV{AT_EXT_MODULE_CFG}/partitions_at.csv") + set(CONFIG_PARTITION_TABLE_BASE_DIR "$ENV{AT_EXT_MODULE_CFG}") +else() + set(CONFIG_PARTITION_TABLE_BASE_DIR "${CMAKE_SOURCE_DIR}") +endif() +message(STATUS "partition_table_dir: ${CONFIG_PARTITION_TABLE_BASE_DIR}") if(NOT DEFINED ENV{IDF_PATH}) - SET(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf ) + SET(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) message(STATUS $ENV{IDF_PATH}) endif() diff --git a/build.py b/build.py index 1ee42ae4..3cff3ade 100755 --- a/build.py +++ b/build.py @@ -158,11 +158,18 @@ def at_submodules_update(platform, module): config_dir = os.path.join(os.getcwd(), 'module_config', 'module_{}_default'.format(platform.lower())) pairs = [] - idf_ver_file = os.path.join(config_dir, 'IDF_VERSION') + ext_module_cfg = os.environ.get('AT_EXT_MODULE_CFG') + if ext_module_cfg and os.path.exists(os.path.join(ext_module_cfg, 'IDF_VERSION')): + idf_ver_file = os.path.join(ext_module_cfg, 'IDF_VERSION') + else: + idf_ver_file = os.path.join(config_dir, 'IDF_VERSION') at_parse_idf_version(idf_ver_file, pairs) try: - submodules_file = os.path.join(config_dir, 'submodules') + if ext_module_cfg and os.path.exists(os.path.join(ext_module_cfg, 'submodules')): + submodules_file = os.path.join(ext_module_cfg, 'submodules') + else: + submodules_file = os.path.join(config_dir, 'submodules') at_parse_submodules(submodules_file, pairs) except Exception as e: ESP_LOGE('Failed to parse submodules:"{}" ({})'.format(submodules_file, e)) @@ -174,10 +181,13 @@ def at_submodules_update(platform, module): ESP_LOGI('submodules check completed for updates.') def at_patch_if_config(platform, module): - config_dir = os.path.join(os.getcwd(), 'module_config', 'module_{}'.format(module.lower())) - if not os.path.exists(config_dir): - config_dir = os.path.join(os.getcwd(), 'module_config', 'module_{}_default'.format(platform.lower())) - + ext_module_cfg = os.environ.get('AT_EXT_MODULE_CFG') + if ext_module_cfg and os.path.exists(os.path.join(ext_module_cfg, 'patch')): + config_dir = ext_module_cfg + else: + config_dir = os.path.join(os.getcwd(), 'module_config', 'module_{}'.format(module.lower())) + if not os.path.exists(config_dir): + config_dir = os.path.join(os.getcwd(), 'module_config', 'module_{}_default'.format(platform.lower())) patch_tool = os.path.join(os.getcwd(), 'tools', 'patch.py') if os.path.exists(patch_tool) and os.path.exists(config_dir): cmd = 'python {} {}'.format(patch_tool, config_dir) diff --git a/components/customized_partitions/CMakeLists.txt b/components/customized_partitions/CMakeLists.txt index 4dab4bd2..83b6bb89 100644 --- a/components/customized_partitions/CMakeLists.txt +++ b/components/customized_partitions/CMakeLists.txt @@ -6,13 +6,21 @@ idf_build_get_property(project_dir PROJECT_DIR) set(flash_customized_partition_args ${build_dir}/flash_customized_partition_args) set(module_info ${build_dir}/module_info) +# set the path of at_customize.csv +if(DEFINED ENV{AT_EXT_MODULE_CFG} AND EXISTS "$ENV{AT_EXT_MODULE_CFG}/${CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE}") + set(AT_CUSTOM_PARTITION_TABLE_PATH "$ENV{AT_EXT_MODULE_CFG}/${CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE}") +else() + set(AT_CUSTOM_PARTITION_TABLE_PATH "${project_dir}/${CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE}") +endif() +message(STATUS "Set custom partition table: ${AT_CUSTOM_PARTITION_TABLE_PATH}") + if (CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_SUPPORT) # generate at_customize.bin and add it to flash target STRING(REGEX REPLACE ".*/(.*)\.csv" "\\1" customize_bin ${CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE}) set(customize_bin_full_name ${customize_bin}.bin) execute_process( COMMAND ${PYTHON} ${IDF_PATH}/components/partition_table/gen_esp32part.py - ${project_dir}/${CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE} ${build_dir}/${customize_bin_full_name} + ${AT_CUSTOM_PARTITION_TABLE_PATH} ${build_dir}/${customize_bin_full_name} ) esptool_py_custom_target(${customize_bin} ${customize_bin} "${customize_bin}") esptool_py_flash_target_image(flash "${customize_bin}" "${CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_OFFSET}" "${build_dir}/${customize_bin_full_name}") @@ -22,7 +30,7 @@ if (CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_SUPPORT) COMMAND ${PYTHON} ${COMPONENT_DIR}/at_customized_target_generate.py --sdkconfig_file ${project_dir}/sdkconfig --dependency_file ${COMPONENT_DIR}/at_customized_config_dependency.txt - --partition_file ${project_dir}/${CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE} + --partition_file ${AT_CUSTOM_PARTITION_TABLE_PATH} --output_dir ${build_dir}/${COMPONENT_NAME} --flash_args_file ${flash_customized_partition_args} ) diff --git a/examples/at_override_module_config/IDF_VERSION b/examples/at_override_module_config/IDF_VERSION new file mode 100644 index 00000000..a0c36627 --- /dev/null +++ b/examples/at_override_module_config/IDF_VERSION @@ -0,0 +1,3 @@ +branch:release/v5.0 +commit:bcca689866db3dfda47f77670bf8df2a7ec94721 +repository:https://github.com/espressif/esp-idf.git diff --git a/examples/at_override_module_config/README.md b/examples/at_override_module_config/README.md new file mode 100644 index 00000000..24ea817b --- /dev/null +++ b/examples/at_override_module_config/README.md @@ -0,0 +1,97 @@ +### 1. Description +This `at_override_module_config` example works as an external directory, allowing you to override the default module configurations (`esp-at/module_config/`) for your module, and you will no longer need to modify the source code of the [esp-at repository](https://github.com/espressif/esp-at). This allows you to just host `at_override_module_config` directory in your git repository in a light-weight way, and it also allows you to freely choose any commit from the esp-at repository snapshot starting from March 2024 as the main project. + +### 2. About the Override +Here are five optional configurations that you may want to override, and you can choose to override one or more of them. Below are detailed descriptions of each override. + +**Notes:** +- If you don't override a configuration, the native configuration will be used. +- You must use the same filename and directory name to override. + +#### 2.1 Override the system configuration +The native system configuration file is `esp-at/module_config//sdkconfig.defaults` (disable silence mode) or `esp-at/module_config//sdkconfig_silence.defaults` (enable silence mode). You may want to enable or disable some features, for example, to enable WebSocket functionality and disable mDNS functionality. You can copy the native system configuration file to `at_override_module_config` directory, and add the following lines to `at_override_module_config/sdkconfig.defaults` file: + +``` +# Enable WebSocket and disable mDNS +CONFIG_AT_WS_COMMAND_SUPPORT=y +CONFIG_AT_MDNS_COMMAND_SUPPORT=n +``` + +The build system will use `at_override_module_config/sdkconfig.defaults` as your system configuration. + +#### 2.2 Override the patch directory +The native patch directory is `esp-at/module_config//patch`. You may want to add more patches, for example, to output one prompt message after esp-at is ready. You can copy the native patch directory to `at_override_module_config` directory, and add the `at_example.patch` file to `at_override_module_config/patch`, then specify this patch by adding the following lines to `at_override_module_config/patch/patch_list.ini` file: + +``` +[at_example.patch] + path = . + note = "This is a simple example to demonstrate how to override the patch directory" +``` + +The build system will use `at_override_module_config/patch` as your patch configuration. + +**Notes:** +- You can create the patch using either the `git format-patch` or `git diff` command. + +#### 2.3 Override the system partition table +The native system partition table file is `esp-at/module_config//partitions_at.csv`. You may want to modify it, for example, to enlarge app partition (`ota_0`) size to support more features. You can copy the native system partition table to `at_override_module_config/partitions_at.csv`, and update the system partition table by replacing the following lines to `at_override_module_config/partitions_at.csv` file: + +``` +# Name, Type, SubType, Offset, Size +otadata, data, ota, 0xd000, 0x2000 +phy_init, data, phy, 0xf000, 0x1000 +nvs, data, nvs, 0x10000, 0xE000 +at_customize, 0x40, 0, 0x1E000, 0x42000 +ota_0, app, ota_0, 0x60000, 0x3a0000 +``` + +The build system will use `at_override_module_config/partitions_at.csv` as your system partition table configuration. + +**Notes:** +- In order to increase the size of the `ota_0` partition, the `ota_1` partition has been removed in this example. This means that you cannot use the OTA commands (`AT+USEROTA` and `AT+CIUPDATE`) provided by the AT firmware. Therefore, your host MCU needs to support firmware updates of esp-at via the [esptool protocol](https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/serial-protocol.html). Otherwise, if any issues occur, the AT firmware will be unable to be updated. +- You need to override `sdkconfig.defaults` as you need to specify the relative path of the system partition table in `sdkconfig.defaults` using `CONFIG_PARTITION_TABLE_CUSTOM_FILENAME` and `CONFIG_PARTITION_TABLE_FILENAME`. The relative path is relative to `at_override_module_config` for `partitions_at.csv`. + +#### 2.4 Override the secondary partition table +The native secondary partition table (also called user partition table) file is `esp-at/module_config//at_customize.csv`. You may want to modify it, for example, to enlarge manufacturing nvs partition (`mfg_nvs`) size to support more parameters. You can copy the native secondary partition table to `at_override_module_config/at_customize.csv`, and update the secondary partition table by replacing the following lines to `at_override_module_config/at_customize.csv` file: + +``` +# Name, Type, SubType, Offset, Size +mfg_nvs, data, nvs, 0x1f000, 0x41000 +``` + +The build system will use `at_override_module_config/at_customize.csv` as your secondary partition table configuration. + +**Notes:** +- In order to increase the size of the `mfg_nvs` partition, the `fatfs` partition has been removed in this example. This means that you cannot use the FileSystem command (`AT+FS`) provided by the AT firmware. +- You need to override `sdkconfig.defaults` as you need to specify the relative path of the secondary partition table in `sdkconfig.defaults` using `CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE`. The relative path is relative to `at_override_module_config` for `at_customize.csv`. + +#### 2.5 Override the esp-idf version +It is strongly recommended to use the default `ESP-IDF` version of the `ESP-AT` project, and **NOT** recommended to update it (because of the potential [application binary interface](https://en.wikipedia.org/wiki/Application_binary_interface) incompatibility between the underlying ESP-IDF versions of `libesp_at_core.a` and the esp-at repository, which may cause incorrect operation of the firmware.), but we still keep the option to update the ESP-IDF for testing purposes. The native esp-idf version file is `esp-at/module_config//IDF_VERSION`. You can copy the native esp-idf version to `at_override_module_config/IDF_VERSION`, and keep it as it is. + +``` +branch:release/v5.0 +commit:bcca689866db3dfda47f77670bf8df2a7ec94721 +repository:https://github.com/espressif/esp-idf.git +``` + +The build system will use `at_override_module_config/IDF_VERSION` as your esp-idf version configuration. + +### 3. Usage +3.1 Based on the content of `2. About the Override` above and your needs, modify the configurations. + +3.2 Add your `at_override_module_config` directory into the build system of esp-at project. + +- Linux or macOS +``` +export AT_EXT_MODULE_CFG=(path_of_at_override_module_config) +``` + +- Windows +``` +set AT_EXT_MODULE_CFG=(path_of_at_override_module_config) +``` + +Notes: +- You need to replace (path_of_at_override_module_config) with your real absolute path of your `at_override_module_config` directory. + +3.3 Compile your firmware according to the [Compile ESP-AT Project](https://docs.espressif.com/projects/esp-at/en/latest/esp32/Compile_and_Develop/How_to_clone_project_and_compile_it.html#compile-esp-at-project-locally) guide. diff --git a/examples/at_override_module_config/at_customize.csv b/examples/at_override_module_config/at_customize.csv new file mode 100644 index 00000000..68504331 --- /dev/null +++ b/examples/at_override_module_config/at_customize.csv @@ -0,0 +1,2 @@ +# Name, Type, SubType, Offset, Size +mfg_nvs, data, nvs, 0x1f000, 0x41000 diff --git a/examples/at_override_module_config/partitions_at.csv b/examples/at_override_module_config/partitions_at.csv new file mode 100644 index 00000000..3be63cca --- /dev/null +++ b/examples/at_override_module_config/partitions_at.csv @@ -0,0 +1,6 @@ +# Name, Type, SubType, Offset, Size +otadata, data, ota, 0xd000, 0x2000 +phy_init, data, phy, 0xf000, 0x1000 +nvs, data, nvs, 0x10000, 0xE000 +at_customize, 0x40, 0, 0x1E000, 0x42000 +ota_0, app, ota_0, 0x60000, 0x3a0000 diff --git a/examples/at_override_module_config/patch/at_example.patch b/examples/at_override_module_config/patch/at_example.patch new file mode 100644 index 00000000..8d873d64 --- /dev/null +++ b/examples/at_override_module_config/patch/at_example.patch @@ -0,0 +1,20 @@ +diff --git a/main/app_main.c b/main/app_main.c +index 06939b6a..de98fbab 100644 +--- a/main/app_main.c ++++ b/main/app_main.c +@@ -3,6 +3,7 @@ + * + * SPDX-License-Identifier: Apache-2.0 + */ ++#include + #include "nvs_flash.h" + #include "esp_event.h" + #include "esp_err.h" +@@ -19,4 +20,7 @@ void app_main(void) + ESP_ERROR_CHECK(esp_event_loop_create_default()); + + esp_at_init(); ++ ++ char *prompt = "Welcome to the world of ESP-AT!\r\n"; ++ esp_at_port_active_write_data((uint8_t *)prompt, strlen(prompt)); + } diff --git a/examples/at_override_module_config/patch/patch_list.ini b/examples/at_override_module_config/patch/patch_list.ini new file mode 100644 index 00000000..36eb09f0 --- /dev/null +++ b/examples/at_override_module_config/patch/patch_list.ini @@ -0,0 +1,9 @@ +; Add your patches to the section below + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" + +[at_example.patch] + path = . + note = "This is a simple example to demonstrate how to override the patch directory" diff --git a/examples/at_override_module_config/patch/support_ext_partition.patch b/examples/at_override_module_config/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/examples/at_override_module_config/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/examples/at_override_module_config/sdkconfig.defaults b/examples/at_override_module_config/sdkconfig.defaults new file mode 100644 index 00000000..7646b710 --- /dev/null +++ b/examples/at_override_module_config/sdkconfig.defaults @@ -0,0 +1,174 @@ +# The Optimized Configuration +# Do NOT edit unless you know exactly what you are doing + +CONFIG_IDF_TARGET_ESP32C3=y + +# Serial flasher config +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y + +# Bootloader config +CONFIG_BOOTLOADER_WDT_ENABLE=y + +# Partition Table +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_at.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_FILENAME="partitions_at.csv" +CONFIG_PARTITION_TABLE_MD5=n + +# PHY +CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION=n + +# Hardware Settings +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=80 +CONFIG_XTAL_FREQ_40=y +CONFIG_XTAL_FREQ=40 + +# Power Save +CONFIG_PM_ENABLE=y +CONFIG_PM_USE_RTC_TIMER_REF=y +### Disable all GPIO at light sleep +CONFIG_PM_SLP_DISABLE_GPIO=y + +# Wi-Fi +CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y +CONFIG_ESP_WIFI_SLP_IRAM_OPT=y +CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=0 + +# Ethernet +CONFIG_DMA_RX_BUF_NUM=3 +CONFIG_DMA_TX_BUF_NUM=3 + +# Component config +CONFIG_BTDM_CTRL_MODE_BTDM=y +CONFIG_BT_ENABLED=y +CONFIG_BT_BLUEDROID_ENABLED=y +CONFIG_BT_DRAM_RELEASE=y +CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_STACK_NO_LOG=y +CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=y +CONFIG_BTDM_SCAN_DUPL_CACHE_SIZE=200 +CONFIG_BT_BTU_TASK_STACK_SIZE=5120 +CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y +CONFIG_BT_BLE_BLUFI_ENABLE=y +CONFIG_BT_CTRL_MODEM_SLEEP=y +CONFIG_BT_CTRL_MODEM_SLEEP_MODE_1=y + +# Log output +CONFIG_LOG_DEFAULT_LEVEL_ERROR=y + +# Compiler +CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y + +# Bluetooth +CONFIG_BT_ENABLED=y +CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y + +# Bluetooth controller(ESP32C3 Bluetooth Low Energy) +CONFIG_BT_CTRL_SLEEP_CLOCK_EFF=2 + +# MODEM SLEEP Options +CONFIG_BT_CTRL_LPCLK_SEL_EXT_32K_XTAL=y + +# FreeRTOS +CONFIG_FREERTOS_UNICORE=y +CONFIG_FREERTOS_HZ=1000 +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=n +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y + +# LWIP +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_RCVBUF=y +CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=3 +CONFIG_LWIP_SNTP_MAX_SERVERS=3 +CONFIG_LWIP_IP_FRAG=y +CONFIG_LWIP_IP_REASSEMBLY=y +CONFIG_LWIP_TCP_MAXRTX=6 +CONFIG_LWIP_TCP_SYNMAXRTX=3 +CONFIG_LWIP_SO_LINGER=y +CONFIG_LWIP_IPV6=y +CONFIG_LWIP_IPV6_AUTOCONFIG=y +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760 +CONFIG_LWIP_TCP_WND_DEFAULT=5760 + +# mbedTLS +CONFIG_MBEDTLS_HAVE_TIME_DATE=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +CONFIG_MBEDTLS_DHM_C=y +CONFIG_MBEDTLS_DYNAMIC_BUFFER=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CONFIG_DATA=y +CONFIG_MBEDTLS_DYNAMIC_FREE_CA_CERT=y +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=n + +# ESP-TLS +CONFIG_ESP_TLS_SERVER=y +CONFIG_ESP_TLS_PSK_VERIFICATION=y +CONFIG_ESP_TLS_INSECURE=y +CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY=y + +# Hardware Settings +CONFIG_RTC_CLK_SRC_EXT_CRYS=y +CONFIG_RTC_CLK_CAL_CYCLES=1024 + +# AT Customized Partitions +CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE="at_customize.csv" +CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_OFFSET=0x1e000 + +# AT +CONFIG_AT_ENABLE=y +CONFIG_AT_BASE_ON_UART=y +CONFIG_AT_MQTT_COMMAND_SUPPORT=y +CONFIG_AT_HTTP_COMMAND_SUPPORT=y +CONFIG_AT_PROCESS_TASK_STACK_SIZE=6144 +CONFIG_AT_OTA_SERVER_IP="iot.espressif.cn" +CONFIG_AT_OTA_SERVER_PORT=80 +CONFIG_AT_OTA_TOKEN_KEY="dd93253c287f725de50d4071a05dd28b72056ca7" +CONFIG_AT_OTA_SSL_TOKEN_KEY="dd93253c287f725de50d4071a05dd28b72056ca7" +CONFIG_AT_SOCKET_MAX_CONN_NUM=5 +CONFIG_ESP_AT_FW_VERSION="v3.2.0.0" + +# Wear Levelling +CONFIG_WL_SECTOR_SIZE_512=y + +# VFS +CONFIG_FATFS_LFN_HEAP=y +CONFIG_VFS_SUPPORT_TERMIOS=n + +# Newlib +CONFIG_NEWLIB_NANO_FORMAT=y + +# Common ESP-related +CONFIG_ESP_TASK_WDT_TIMEOUT_S=60 +CONFIG_ESP_TASK_WDT_PANIC=y +CONFIG_ESP_ERR_TO_NAME_LOOKUP=n + +# Cache config +CONFIG_ESP_DEBUG_STUBS_ENABLE=n +CONFIG_ESP_DEBUG_OCDAWARE=n + +# SPI Flash driver +CONFIG_SPI_FLASH_USE_LEGACY_IMPL=y + +# HTTP Server +CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 +CONFIG_HTTPD_MAX_URI_LEN=1024 + +# ESP System Settings +CONFIG_ESP_SYSTEM_RTC_EXT_XTAL=y +CONFIG_ESP_SYSTEM_RTC_EXT_XTAL_BOOTSTRAP_CYCLES=0 +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=n +CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=n + +# ESP HTTPS OTA +CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP=y + +# Enable WebSocket and disable mDNS +CONFIG_AT_WS_COMMAND_SUPPORT=y +CONFIG_AT_MDNS_COMMAND_SUPPORT=n diff --git a/module_config/module_esp32-d2wd/patch/patch_list.ini b/module_config/module_esp32-d2wd/patch/patch_list.ini index aebf5b1b..f039e6fc 100644 --- a/module_config/module_esp32-d2wd/patch/patch_list.ini +++ b/module_config/module_esp32-d2wd/patch/patch_list.ini @@ -7,3 +7,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32-d2wd/patch/support_ext_partition.patch b/module_config/module_esp32-d2wd/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32-d2wd/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32-sdio/patch/patch_list.ini b/module_config/module_esp32-sdio/patch/patch_list.ini index aebf5b1b..f039e6fc 100644 --- a/module_config/module_esp32-sdio/patch/patch_list.ini +++ b/module_config/module_esp32-sdio/patch/patch_list.ini @@ -7,3 +7,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32-sdio/patch/support_ext_partition.patch b/module_config/module_esp32-sdio/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32-sdio/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32_default/patch/patch_list.ini b/module_config/module_esp32_default/patch/patch_list.ini index aebf5b1b..f039e6fc 100644 --- a/module_config/module_esp32_default/patch/patch_list.ini +++ b/module_config/module_esp32_default/patch/patch_list.ini @@ -7,3 +7,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32_default/patch/support_ext_partition.patch b/module_config/module_esp32_default/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32_default/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c2-2mb/patch/patch_list.ini b/module_config/module_esp32c2-2mb/patch/patch_list.ini index 3dcd4f09..ebe32390 100644 --- a/module_config/module_esp32c2-2mb/patch/patch_list.ini +++ b/module_config/module_esp32c2-2mb/patch/patch_list.ini @@ -11,3 +11,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32c2-2mb/patch/support_ext_partition.patch b/module_config/module_esp32c2-2mb/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32c2-2mb/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c2-ble-2mb/patch/patch_list.ini b/module_config/module_esp32c2-ble-2mb/patch/patch_list.ini index 3dcd4f09..ebe32390 100644 --- a/module_config/module_esp32c2-ble-2mb/patch/patch_list.ini +++ b/module_config/module_esp32c2-ble-2mb/patch/patch_list.ini @@ -11,3 +11,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch b/module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32c2-ble-2mb/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c2_default/patch/patch_list.ini b/module_config/module_esp32c2_default/patch/patch_list.ini index 3dcd4f09..ebe32390 100644 --- a/module_config/module_esp32c2_default/patch/patch_list.ini +++ b/module_config/module_esp32c2_default/patch/patch_list.ini @@ -11,3 +11,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32c2_default/patch/support_ext_partition.patch b/module_config/module_esp32c2_default/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32c2_default/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c3-spi/patch/patch_list.ini b/module_config/module_esp32c3-spi/patch/patch_list.ini index aebf5b1b..f039e6fc 100644 --- a/module_config/module_esp32c3-spi/patch/patch_list.ini +++ b/module_config/module_esp32c3-spi/patch/patch_list.ini @@ -7,3 +7,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32c3-spi/patch/support_ext_partition.patch b/module_config/module_esp32c3-spi/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32c3-spi/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c3_default/patch/patch_list.ini b/module_config/module_esp32c3_default/patch/patch_list.ini index aebf5b1b..f039e6fc 100644 --- a/module_config/module_esp32c3_default/patch/patch_list.ini +++ b/module_config/module_esp32c3_default/patch/patch_list.ini @@ -7,3 +7,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32c3_default/patch/support_ext_partition.patch b/module_config/module_esp32c3_default/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32c3_default/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c3_rainmaker/patch/patch_list.ini b/module_config/module_esp32c3_rainmaker/patch/patch_list.ini index cbfe5231..c132809c 100644 --- a/module_config/module_esp32c3_rainmaker/patch/patch_list.ini +++ b/module_config/module_esp32c3_rainmaker/patch/patch_list.ini @@ -15,3 +15,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch b/module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32c3_rainmaker/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_esp32c6_default/patch/patch_list.ini b/module_config/module_esp32c6_default/patch/patch_list.ini index 0720646b..bf33710e 100644 --- a/module_config/module_esp32c6_default/patch/patch_list.ini +++ b/module_config/module_esp32c6_default/patch/patch_list.ini @@ -23,3 +23,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_esp32c6_default/patch/support_ext_partition.patch b/module_config/module_esp32c6_default/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_esp32c6_default/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. " diff --git a/module_config/module_wrover-32/patch/patch_list.ini b/module_config/module_wrover-32/patch/patch_list.ini index aebf5b1b..f039e6fc 100644 --- a/module_config/module_wrover-32/patch/patch_list.ini +++ b/module_config/module_wrover-32/patch/patch_list.ini @@ -7,3 +7,7 @@ [fatfs_generation.patch] path = esp-idf note = "Fixed an issue where data read after writing fatfs partition more than 63 times might be incorrect" + +[support_ext_partition.patch] + path = esp-idf + note = "[IDF-9560] Support to use partition table outside of the project directory" diff --git a/module_config/module_wrover-32/patch/support_ext_partition.patch b/module_config/module_wrover-32/patch/support_ext_partition.patch new file mode 100644 index 00000000..903fef7a --- /dev/null +++ b/module_config/module_wrover-32/patch/support_ext_partition.patch @@ -0,0 +1,20 @@ +diff --git a/components/partition_table/project_include.cmake b/components/partition_table/project_include.cmake +index d0969ba408..89a0f02cbd 100644 +--- a/components/partition_table/project_include.cmake ++++ b/components/partition_table/project_include.cmake +@@ -9,10 +9,14 @@ if(NOT BOOTLOADER_BUILD) + # Set PARTITION_CSV_PATH to the configured partition CSV file + # absolute path + if(CONFIG_PARTITION_TABLE_CUSTOM) ++ if(NOT CONFIG_PARTITION_TABLE_BASE_DIR) ++ set(CONFIG_PARTITION_TABLE_BASE_DIR "${project_dir}") ++ endif() ++ + idf_build_get_property(project_dir PROJECT_DIR) + # Custom filename expands any path relative to the project + get_filename_component(PARTITION_CSV_PATH "${CONFIG_PARTITION_TABLE_FILENAME}" +- ABSOLUTE BASE_DIR "${project_dir}") ++ ABSOLUTE BASE_DIR "${CONFIG_PARTITION_TABLE_BASE_DIR}") + + if(NOT EXISTS "${PARTITION_CSV_PATH}") + message(WARNING "Partition table CSV file ${PARTITION_CSV_PATH} not found. "