diff --git a/components/esp_matter/CMakeLists.txt b/components/esp_matter/CMakeLists.txt index f7da41d6c..a806f986a 100644 --- a/components/esp_matter/CMakeLists.txt +++ b/components/esp_matter/CMakeLists.txt @@ -71,7 +71,7 @@ set(INCLUDE_DIRS_LIST "." "${MATTER_SDK_PATH}/src" "${ZAP_GENERATED_PATH}/../") -set(REQUIRES_LIST chip bt esp_matter_console) +set(REQUIRES_LIST chip bt esp_matter_console nvs_flash) if ("${IDF_TARGET}" STREQUAL "esp32h2") list(APPEND REQUIRES_LIST openthread esp_matter_openthread) diff --git a/components/esp_matter_console/CMakeLists.txt b/components/esp_matter_console/CMakeLists.txt index 84e47d3ed..f69a51c9e 100644 --- a/components/esp_matter_console/CMakeLists.txt +++ b/components/esp_matter_console/CMakeLists.txt @@ -1,3 +1,3 @@ idf_component_register(SRCS esp_matter_console.cpp esp_matter_console_diagnostics.cpp INCLUDE_DIRS . - PRIV_REQUIRES chip esp32_mbedtls) + PRIV_REQUIRES chip esp32_mbedtls esp_timer) diff --git a/components/esp_matter_openthread/CMakeLists.txt b/components/esp_matter_openthread/CMakeLists.txt index 98e683caa..9b401dadf 100644 --- a/components/esp_matter_openthread/CMakeLists.txt +++ b/components/esp_matter_openthread/CMakeLists.txt @@ -4,4 +4,4 @@ endif() idf_component_register(SRCS ${srcs} INCLUDE_DIRS . - PRIV_REQUIRES openthread) + PRIV_REQUIRES openthread esp_netif driver) diff --git a/connectedhomeip/connectedhomeip b/connectedhomeip/connectedhomeip index 06457aea2..069b09b5f 160000 --- a/connectedhomeip/connectedhomeip +++ b/connectedhomeip/connectedhomeip @@ -1 +1 @@ -Subproject commit 06457aea2d2112e76f88c95ee4ab0e22a9dbe9f5 +Subproject commit 069b09b5f31d07d0772cfef91ba8010237f81b49 diff --git a/device_hal/led_driver/ws2812/led_driver.c b/device_hal/led_driver/ws2812/led_driver.c index 3eb160f39..5ff3f6a7f 100644 --- a/device_hal/led_driver/ws2812/led_driver.c +++ b/device_hal/led_driver/ws2812/led_driver.c @@ -28,23 +28,37 @@ led_driver_handle_t led_driver_init(led_driver_config_t *config) { ESP_LOGI(TAG, "Initializing light driver"); esp_err_t err = ESP_OK; - +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) rmt_config_t rmt_cfg = RMT_DEFAULT_CONFIG_TX(config->gpio, config->channel); rmt_cfg.clk_div = 2; err = rmt_config(&rmt_cfg); if (err != ESP_OK) { ESP_LOGE(TAG, "rmt_cfg failed"); + return NULL; } err = rmt_driver_install(rmt_cfg.channel, 0, 0); if (err != ESP_OK) { ESP_LOGE(TAG, "rmt_driver_install failed"); + return NULL; } led_strip_config_t strip_config = LED_STRIP_DEFAULT_CONFIG(1, (led_strip_dev_t)rmt_cfg.channel); led_strip_t *strip = led_strip_new_rmt_ws2812(&strip_config); +#else + led_strip_config_t strip_config = { + .strip_gpio_num = config->gpio, + .max_leds = 1, + }; + led_strip_handle_t strip; + err = led_strip_new_rmt_device(&strip_config, &strip); + if (err != ESP_OK) { + ESP_LOGE(TAG, "led_strip initializing failed"); + return NULL; + } +#endif if (!strip) { ESP_LOGE(TAG, "W2812 driver install failed"); - err = ESP_FAIL; + return NULL; } return (led_driver_handle_t)strip; } @@ -62,6 +76,7 @@ esp_err_t led_driver_set_RGB(led_driver_handle_t handle) ESP_LOGE(TAG, "led driver handle cannot be NULL"); err = ESP_FAIL; } else { +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) led_strip_t *strip = (led_strip_t *)handle; err = strip->set_pixel(strip, 0, mRGB.red, mRGB.green, mRGB.blue); if (err != ESP_OK) { @@ -70,6 +85,11 @@ esp_err_t led_driver_set_RGB(led_driver_handle_t handle) } ESP_LOGI(TAG, "led set r:%d, g:%d, b:%d", mRGB.red, mRGB.green, mRGB.blue); err = strip->refresh(strip, 100); +#else + led_strip_handle_t strip = (led_strip_handle_t)handle; + err = led_strip_set_pixel(strip, 0, mRGB.red, mRGB.green, mRGB.blue); + err |= led_strip_refresh(strip); +#endif if (err != ESP_OK) { ESP_LOGE(TAG, "strip_refresh failed"); } diff --git a/examples/blemesh_bridge/CMakeLists.txt b/examples/blemesh_bridge/CMakeLists.txt index 9ad7d3037..cf6dfc9ea 100644 --- a/examples/blemesh_bridge/CMakeLists.txt +++ b/examples/blemesh_bridge/CMakeLists.txt @@ -28,7 +28,6 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) set(EXTRA_COMPONENT_DIRS "../common" - "${IDF_PATH}/examples/common_components/qrcode" "${MATTER_SDK_PATH}/config/esp32/components" "${ESP_MATTER_PATH}/components" "${ESP_MATTER_PATH}/device_hal/device" diff --git a/examples/common/app_ble/app_ble.cpp b/examples/common/app_ble/app_ble.cpp index 0e71b93cd..f30e090ff 100644 --- a/examples/common/app_ble/app_ble.cpp +++ b/examples/common/app_ble/app_ble.cpp @@ -13,7 +13,9 @@ #include #include +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) #include +#endif #include #include @@ -33,7 +35,10 @@ esp_err_t app_ble_disable() return ESP_FAIL; } nimble_port_deinit(); - esp_err_t err = esp_nimble_hci_and_controller_deinit(); + esp_err_t err = ESP_OK; +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) + err = esp_nimble_hci_and_controller_deinit(); +#endif err |= esp_bt_mem_release(ESP_BT_MODE_BLE); if (err != ESP_OK) { ESP_LOGE(TAG, "BLE deinit failed"); diff --git a/examples/common/app_qrcode/idf_component.yml b/examples/common/app_qrcode/idf_component.yml new file mode 100644 index 000000000..ed852323c --- /dev/null +++ b/examples/common/app_qrcode/idf_component.yml @@ -0,0 +1,2 @@ +dependencies: + qrcode: "^0.1.0" diff --git a/examples/light/CMakeLists.txt b/examples/light/CMakeLists.txt index 9aeef3e00..8ebac2024 100644 --- a/examples/light/CMakeLists.txt +++ b/examples/light/CMakeLists.txt @@ -30,7 +30,6 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) set(EXTRA_COMPONENT_DIRS "../common" - "${IDF_PATH}/examples/common_components/qrcode" "${MATTER_SDK_PATH}/config/esp32/components" "${ESP_MATTER_PATH}/components" "${ESP_MATTER_PATH}/device_hal/device" @@ -38,8 +37,8 @@ set(EXTRA_COMPONENT_DIRS project(light) -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) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat -idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND) +idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security;-Wformat=0" APPEND) diff --git a/examples/light/main/CMakeLists.txt b/examples/light/main/CMakeLists.txt index b9a2c8e4b..90c133dcc 100644 --- a/examples/light/main/CMakeLists.txt +++ b/examples/light/main/CMakeLists.txt @@ -5,4 +5,4 @@ idf_component_register(SRC_DIRS "." PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) -target_compile_options(${COMPONENT_LIB} PRIVATE "-DLWIP_IPV6_SCOPES=0" "-DCHIP_HAVE_CONFIG_H") +target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/light/sdkconfig.defaults.esp32h2 b/examples/light/sdkconfig.defaults.esp32h2 index b94164d2f..284707ca2 100644 --- a/examples/light/sdkconfig.defaults.esp32h2 +++ b/examples/light/sdkconfig.defaults.esp32h2 @@ -1,4 +1,5 @@ CONFIG_IDF_TARGET="esp32h2" +CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2=y # Default to 921600 baud when flashing and monitoring device CONFIG_ESPTOOLPY_BAUD_921600B=y @@ -12,17 +13,12 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # libsodium CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y - -# Enable NIMBLE which is mynewt_nimble component out of bt component -# It will be merge to bt component soon +# NIMBLE CONFIG_BT_ENABLED=y CONFIG_BT_NIMBLE_ENABLED=y -CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT=y CONFIG_BT_NIMBLE_EXT_ADV=n -CONFIG_BT_NIMBLE_USE_ESP_TIMER=n -CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y -CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=n -CONFIG_BTDM_CTRL_MODE_BTDM=n +CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70 +CONFIG_DEINIT_BLE_ON_COMMISSIONING_COMPLETE=n # FreeRTOS should use legacy API CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y @@ -46,6 +42,7 @@ CONFIG_LWIP_MULTICAST_PING=y CONFIG_MBEDTLS_HARDWARE_AES=n CONFIG_MBEDTLS_HARDWARE_MPI=n CONFIG_MBEDTLS_HARDWARE_SHA=n +CONFIG_MBEDTLS_HARDWARE_ECC=y CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN=n CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY=n CONFIG_MBEDTLS_CMAC_C=y @@ -54,22 +51,18 @@ CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y # MDNS platform CONFIG_USE_MINIMAL_MDNS=n - -# Increase stacks size -CONFIG_NIMBLE_CONTROLLER_TASK_STACK_SIZE=5120 -CONFIG_NIMBLE_HOST_TASK_STACK_SIZE=5120 - -# ESP32H2 BLE using a ext 32k crystal -CONFIG_ESP32H2_RTC_CLK_SRC_EXT_CRYS=y +CONFIG_ENABLE_EXTENDED_DISCOVERY=y # Enable OTA Requestor CONFIG_ENABLE_OTA_REQUESTOR=y +# Disable STA and AP for ESP32H2 +CONFIG_ENABLE_WIFI_STATION=n +CONFIG_ENABLE_WIFI_AP=n + # Button CONFIG_BUTTON_PERIOD_TIME_MS=20 CONFIG_BUTTON_LONG_PRESS_TIME_MS=5000 -# disable chip-shell -# chip shell includes wifi commands which will cause a compiling error of RegisterWiFicommands -# It should be fixed on upstream repo -CONFIG_ENABLE_CHIP_SHELL=n +# Enable chip shell +CONFIG_ENABLE_CHIP_SHELL=y diff --git a/examples/light_switch/CMakeLists.txt b/examples/light_switch/CMakeLists.txt index 669ad2260..9775a1f34 100644 --- a/examples/light_switch/CMakeLists.txt +++ b/examples/light_switch/CMakeLists.txt @@ -28,7 +28,6 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) set(EXTRA_COMPONENT_DIRS "../common" - "${IDF_PATH}/examples/common_components/qrcode" "${MATTER_SDK_PATH}/config/esp32/components" "${ESP_MATTER_PATH}/components" "${ESP_MATTER_PATH}/device_hal/device" diff --git a/examples/zap_light/CMakeLists.txt b/examples/zap_light/CMakeLists.txt index e836ac925..759849adf 100644 --- a/examples/zap_light/CMakeLists.txt +++ b/examples/zap_light/CMakeLists.txt @@ -30,7 +30,6 @@ include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake) set(EXTRA_COMPONENT_DIRS "../common" - "${IDF_PATH}/examples/common_components/qrcode" "${MATTER_SDK_PATH}/config/esp32/components" "${ESP_MATTER_PATH}/components" "${ESP_MATTER_PATH}/device_hal/device"