From d5d7116f00a5c210f3cfd37f876b2f2dfa28d16a Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Tue, 11 May 2021 22:20:34 +0800 Subject: [PATCH] Update CHIP Code to use ESP-IDF v4.3 (#6615) * update esp-idf version to release/v4.3 * update dockerfile and chip-build version * update other apps esp-idf version to release/v4.3 * update test_driver README file --- examples/all-clusters-app/esp32/CMakeLists.txt | 2 +- examples/all-clusters-app/esp32/Makefile | 2 +- examples/all-clusters-app/esp32/README.md | 4 ++-- examples/lock-app/esp32/CMakeLists.txt | 2 +- examples/lock-app/esp32/README.md | 4 ++-- examples/persistent-storage/esp32/CMakeLists.txt | 2 +- examples/persistent-storage/esp32/Makefile | 2 +- examples/persistent-storage/esp32/README.md | 4 ++-- examples/pigweed-app/esp32/CMakeLists.txt | 2 +- examples/pigweed-app/esp32/README.md | 4 ++-- examples/temperature-measurement-app/esp32/CMakeLists.txt | 2 +- examples/temperature-measurement-app/esp32/Makefile | 2 +- examples/temperature-measurement-app/esp32/README.md | 4 ++-- examples/temperature-measurement-app/esp32/main/component.mk | 1 + integrations/docker/images/chip-build-esp32/Dockerfile | 2 +- src/platform/ESP32/PlatformManagerImpl.cpp | 2 +- src/test_driver/esp32/README.md | 4 ++-- 17 files changed, 23 insertions(+), 22 deletions(-) diff --git a/examples/all-clusters-app/esp32/CMakeLists.txt b/examples/all-clusters-app/esp32/CMakeLists.txt index f1e501c3c9fa46..2a38c800e1ef4a 100644 --- a/examples/all-clusters-app/esp32/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/CMakeLists.txt @@ -28,5 +28,5 @@ set(EXTRA_COMPONENT_DIRS ) project(chip-all-clusters-app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) diff --git a/examples/all-clusters-app/esp32/Makefile b/examples/all-clusters-app/esp32/Makefile index 7d46e246b8bd6e..9874885e300d12 100644 --- a/examples/all-clusters-app/esp32/Makefile +++ b/examples/all-clusters-app/esp32/Makefile @@ -27,7 +27,7 @@ EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32 $(PROJECT_PATH)/../../common/QRCode \ $(PROJECT_PATH)/../../common/screen-framework \ -CXXFLAGS += -std=c++14 -Os -DLWIP_IPV6_SCOPES=0 +CXXFLAGS += -std=gnu++14 -Os -DLWIP_IPV6_SCOPES=0 CPPFLAGS += -Os -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H CFLAGS += -Os -DLWIP_IPV6_SCOPES=0 diff --git a/examples/all-clusters-app/esp32/README.md b/examples/all-clusters-app/esp32/README.md index b690419922d3fc..68b9d9ef695aed 100644 --- a/examples/all-clusters-app/esp32/README.md +++ b/examples/all-clusters-app/esp32/README.md @@ -33,13 +33,13 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout release/v4.2 branch +- Clone the Espressif ESP-IDF and checkout release/v4.3 branch $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.2 + $ git checkout release/v4.3 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh diff --git a/examples/lock-app/esp32/CMakeLists.txt b/examples/lock-app/esp32/CMakeLists.txt index cbe9c2a1baec5e..8d27c084ec6e41 100644 --- a/examples/lock-app/esp32/CMakeLists.txt +++ b/examples/lock-app/esp32/CMakeLists.txt @@ -27,5 +27,5 @@ set(EXTRA_COMPONENT_DIRS ) project(chip-lock-app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) diff --git a/examples/lock-app/esp32/README.md b/examples/lock-app/esp32/README.md index 2438dd2161dcf8..0333936e57a236 100644 --- a/examples/lock-app/esp32/README.md +++ b/examples/lock-app/esp32/README.md @@ -8,13 +8,13 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout release/v4.2 branch +- Clone the Espressif ESP-IDF and checkout release/v4.3 branch $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.2 + $ git checkout release/v4.3 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh diff --git a/examples/persistent-storage/esp32/CMakeLists.txt b/examples/persistent-storage/esp32/CMakeLists.txt index 54ea09260202b7..a2d33ac4ede066 100644 --- a/examples/persistent-storage/esp32/CMakeLists.txt +++ b/examples/persistent-storage/esp32/CMakeLists.txt @@ -24,5 +24,5 @@ set(EXTRA_COMPONENT_DIRS ) project(persistent-storage) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) diff --git a/examples/persistent-storage/esp32/Makefile b/examples/persistent-storage/esp32/Makefile index a6fad126da2e06..1e96211faff072 100644 --- a/examples/persistent-storage/esp32/Makefile +++ b/examples/persistent-storage/esp32/Makefile @@ -23,7 +23,7 @@ PROJECT_NAME := persistent-storage EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32/components \ -CXXFLAGS += -std=gnu++17 -Os -DLWIP_IPV6_SCOPES=0 +CXXFLAGS += -std=gnu++14 -Os -DLWIP_IPV6_SCOPES=0 CPPFLAGS += -Os -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H CFLAGS += -Os -DLWIP_IPV6_SCOPES=0 diff --git a/examples/persistent-storage/esp32/README.md b/examples/persistent-storage/esp32/README.md index 1f896bf5bf3239..a4a1c8366e9f45 100644 --- a/examples/persistent-storage/esp32/README.md +++ b/examples/persistent-storage/esp32/README.md @@ -41,13 +41,13 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout release/v4.2 branch +- Clone the Espressif ESP-IDF and checkout release/v4.3 branch $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.2 + $ git checkout release/v4.3 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh diff --git a/examples/pigweed-app/esp32/CMakeLists.txt b/examples/pigweed-app/esp32/CMakeLists.txt index 9d604f9291f4be..f1882322dfea8a 100644 --- a/examples/pigweed-app/esp32/CMakeLists.txt +++ b/examples/pigweed-app/esp32/CMakeLists.txt @@ -25,5 +25,5 @@ set(EXTRA_COMPONENT_DIRS ) project(chip-pigweed-app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) diff --git a/examples/pigweed-app/esp32/README.md b/examples/pigweed-app/esp32/README.md index 001b94c696dbda..bcc1bd937c6588 100644 --- a/examples/pigweed-app/esp32/README.md +++ b/examples/pigweed-app/esp32/README.md @@ -36,13 +36,13 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout release/v4.2 branch +- Clone the Espressif ESP-IDF and checkout release/v4.3 branch $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.2 + $ git checkout release/v4.3 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh diff --git a/examples/temperature-measurement-app/esp32/CMakeLists.txt b/examples/temperature-measurement-app/esp32/CMakeLists.txt index c72b7a3935dd4c..b001582261aced 100644 --- a/examples/temperature-measurement-app/esp32/CMakeLists.txt +++ b/examples/temperature-measurement-app/esp32/CMakeLists.txt @@ -34,5 +34,5 @@ set(EXTRA_COMPONENT_DIRS ) project(chip-temperature-measurement-app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=c++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DLWIP_IPV6_SCOPES=0;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os;-DLWIP_IPV6_SCOPES=0" APPEND) diff --git a/examples/temperature-measurement-app/esp32/Makefile b/examples/temperature-measurement-app/esp32/Makefile index 17e13f40e3af9d..1b6c593e0bb476 100644 --- a/examples/temperature-measurement-app/esp32/Makefile +++ b/examples/temperature-measurement-app/esp32/Makefile @@ -26,7 +26,7 @@ EXTRA_COMPONENT_DIRS += $(PROJECT_PATH)/third_party/connectedhomeip/config/esp32 $(PROJECT_PATH)/../../common/QRCode \ $(PROJECT_PATH)/../../common/screen-framework \ -CXXFLAGS += -std=c++14 -Os -DLWIP_IPV6_SCOPES=0 +CXXFLAGS += -std=gnu++14 -Os -DLWIP_IPV6_SCOPES=0 CPPFLAGS += -Os -DLWIP_IPV6_SCOPES=0 -DCHIP_HAVE_CONFIG_H CFLAGS += -Os -DLWIP_IPV6_SCOPES=0 diff --git a/examples/temperature-measurement-app/esp32/README.md b/examples/temperature-measurement-app/esp32/README.md index 206033d6a40987..5aa8bf0ce70014 100644 --- a/examples/temperature-measurement-app/esp32/README.md +++ b/examples/temperature-measurement-app/esp32/README.md @@ -8,13 +8,13 @@ Development Framework and the xtensa-esp32-elf toolchain. The VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout release/v4.2 branch +- Clone the Espressif ESP-IDF and checkout release/v4.3 branch $ mkdir ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.2 + $ git checkout release/v4.3 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh diff --git a/examples/temperature-measurement-app/esp32/main/component.mk b/examples/temperature-measurement-app/esp32/main/component.mk index 58501eb3ccceb1..bc8ad65e18f184 100644 --- a/examples/temperature-measurement-app/esp32/main/component.mk +++ b/examples/temperature-measurement-app/esp32/main/component.mk @@ -29,6 +29,7 @@ COMPONENT_SRCDIRS := ../third_party/connectedhomeip/src/app/reporting \ ../third_party/connectedhomeip/src/app/clusters/basic \ ../third_party/connectedhomeip/src/app/clusters/bindings \ + ../third_party/connectedhomeip/src/app/clusters/general-commissioning-server \ ../third_party/connectedhomeip/src/app/clusters/network-commissioning \ ../third_party/connectedhomeip/src/app/clusters/temperature-measurement-server \ diff --git a/integrations/docker/images/chip-build-esp32/Dockerfile b/integrations/docker/images/chip-build-esp32/Dockerfile index 2894fa72a2aba9..418d4d6a6555d4 100644 --- a/integrations/docker/images/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/chip-build-esp32/Dockerfile @@ -7,7 +7,7 @@ RUN set -x \ && DEBIAN_FRONTEND=noninteractive apt-get install -y python libgcrypt20-dev \ && mkdir -p /opt/espressif \ && cd /opt/espressif \ - && git clone --progress -b release/v4.2 https://github.com/espressif/esp-idf.git \ + && git clone --progress -b release/v4.3 https://github.com/espressif/esp-idf.git \ && cd esp-idf \ && git submodule update --init --progress \ && IDF_TOOLS_PATH=/opt/espressif/tools ./install.sh \ diff --git a/src/platform/ESP32/PlatformManagerImpl.cpp b/src/platform/ESP32/PlatformManagerImpl.cpp index b90115c70d999e..2b35fdd82b866a 100644 --- a/src/platform/ESP32/PlatformManagerImpl.cpp +++ b/src/platform/ESP32/PlatformManagerImpl.cpp @@ -90,7 +90,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) esp_fill_random(ap_mac, sizeof(ap_mac)); /* Bit 0 of the first octet of MAC Address should always be 0 */ ap_mac[0] &= (uint8_t) ~0x01; - err = esp_wifi_set_mac(ESP_IF_WIFI_AP, ap_mac); + err = esp_wifi_set_mac(WIFI_IF_AP, ap_mac); SuccessOrExit(err); } diff --git a/src/test_driver/esp32/README.md b/src/test_driver/esp32/README.md index f45292f3d1fc28..9197a09bc2b342 100644 --- a/src/test_driver/esp32/README.md +++ b/src/test_driver/esp32/README.md @@ -29,13 +29,13 @@ The `chip-build` Docker container and VSCode devcontainer has these components pre-installed, so you can skip this step. To install these components manually, follow these steps: -- Clone the Espressif ESP-IDF and checkout release/v4.2 branch +- Clone the Espressif ESP-IDF and checkout release/v4.3 branch $ mkdir -p ${HOME}/tools $ cd ${HOME}/tools $ git clone https://github.com/espressif/esp-idf.git $ cd esp-idf - $ git checkout release/v4.2 + $ git checkout release/v4.3 $ git submodule update --init $ export IDF_PATH=${HOME}/tools/esp-idf $ ./install.sh