Merge branch 'use_idf_v5_0_1' into 'main'

Update default IDF version to v5.0.1

See merge request app-frameworks/esp-matter!342
This commit is contained in:
Shu Chen
2023-04-17 09:27:51 +08:00
10 changed files with 70 additions and 52 deletions
+9 -1
View File
@@ -162,7 +162,7 @@ variables:
# update caches only when setup succeed
- *update_build_caches
variables:
IDF_VERSION: "v4.4.3"
IDF_VERSION: "v5.0.1"
REPOS_PATH: "$CI_PROJECT_DIR/repos"
IDF_CCACHE_ENABLE: 1
@@ -173,6 +173,14 @@ build_esp_matter_examples:
- *build_examples
- *build_external_platform_example
build_esp_matter_examples_idf_v4_4:
extends:
- .build_examples_template
variables:
IDF_VERSION: "v4.4.3"
script:
- *build_examples
build_esp_matter_examples_idf_v5_1:
extends:
- .build_examples_template
+1 -1
View File
@@ -22,7 +22,7 @@ git clone --recursive https://github.com/espressif/esp-matter.git
## Supported ESP-IDF and connectedhomeip versions
- This SDK currently works with [commit bc8c9ece1](https://github.com/espressif/connectedhomeip/tree/bc8c9ece1) of connectedhomeip.
- For ESP32, ESP32-C3, and ESP32-S3, ESP-IDF [v4.4.3 release](https://github.com/espressif/esp-idf/releases/tag/v4.4.3) is required.
- For ESP32, ESP32-C3, and ESP32-S3, ESP-IDF [v5.0.1 release](https://github.com/espressif/esp-idf/releases/tag/v5.0.1) is required.
- For ESP32-C2, ESP32-H2(preview) and ESP32-C6(preview) and Zigbee Bridge example, ESP-IDF branch at [commit bb9200ace](https://github.com/espressif/esp-idf/tree/bb9200ace) in branch release/v5.1 should be used.
+7
View File
@@ -79,5 +79,12 @@ idf_component_register( SRC_DIRS ${SRC_DIRS_LIST}
# used uninitialized in this function
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=uninitialized;-Wno-error=maybe-uninitialized;-Wno-missing-field-initializers;" APPEND)
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=array-bounds" APPEND)
# For Xtensa chips, uint32_t was defined as 'unsigned' before v5.0, and after IDF v5.0 it is defined
# as 'unsigned long', same as RISC-V. add this compile option to avoid format errors.
# https://github.com/espressif/esp-idf/issues/6906#issuecomment-1207373706
if (CONFIG_IDF_TARGET_ARCH_XTENSA AND (${IDF_VERSION_MAJOR} LESS 5))
idf_build_set_property(COMPILE_OPTIONS "-Wno-format" APPEND)
endif()
target_compile_options(${COMPONENT_LIB} PUBLIC
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>")
@@ -1590,51 +1590,51 @@ void val_print(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id,
{
char action = (is_read) ? 'R' :'W';
if (val_is_null(val)) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is null **********", action, endpoint_id,
cluster_id, attribute_id);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is null **********", action,
endpoint_id, cluster_id, attribute_id);
return;
}
if (val->type == ESP_MATTER_VAL_TYPE_BOOLEAN) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", action, endpoint_id,
cluster_id, attribute_id, val->val.b);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %d **********", action,
endpoint_id, cluster_id, attribute_id, val->val.b);
} else if (val->type == ESP_MATTER_VAL_TYPE_INTEGER || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_INTEGER) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", action, endpoint_id,
cluster_id, attribute_id, val->val.i);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %d **********", action,
endpoint_id, cluster_id, attribute_id, val->val.i);
} else if (val->type == ESP_MATTER_VAL_TYPE_FLOAT || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_FLOAT) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %f **********", action, endpoint_id,
cluster_id, attribute_id, val->val.f);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %f **********", action,
endpoint_id, cluster_id, attribute_id, val->val.f);
} else if (val->type == ESP_MATTER_VAL_TYPE_UINT8 || val->type == ESP_MATTER_VAL_TYPE_BITMAP8
|| val->type == ESP_MATTER_VAL_TYPE_ENUM8 || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_UINT8
|| val->type == ESP_MATTER_VAL_TYPE_NULLABLE_BITMAP8 || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_ENUM8) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", action, endpoint_id,
cluster_id, attribute_id, val->val.u8);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %d **********", action,
endpoint_id, cluster_id, attribute_id, val->val.u8);
} else if (val->type == ESP_MATTER_VAL_TYPE_INT16 || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_INT16) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", action, endpoint_id,
cluster_id, attribute_id, val->val.i16);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %d **********", action,
endpoint_id, cluster_id, attribute_id, val->val.i16);
} else if (val->type == ESP_MATTER_VAL_TYPE_UINT16 || val->type == ESP_MATTER_VAL_TYPE_BITMAP16
|| val->type == ESP_MATTER_VAL_TYPE_NULLABLE_UINT16 || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_BITMAP16) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", action, endpoint_id,
cluster_id, attribute_id, val->val.u16);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %d **********", action,
endpoint_id, cluster_id, attribute_id, val->val.u16);
} else if (val->type == ESP_MATTER_VAL_TYPE_INT32|| val->type == ESP_MATTER_VAL_TYPE_NULLABLE_INT32) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", action, endpoint_id,
cluster_id, attribute_id, val->val.i32);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %ld **********", action,
endpoint_id, cluster_id, attribute_id, val->val.i32);
} else if (val->type == ESP_MATTER_VAL_TYPE_UINT32 || val->type == ESP_MATTER_VAL_TYPE_BITMAP32
|| val->type == ESP_MATTER_VAL_TYPE_NULLABLE_UINT32 || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_BITMAP32) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %d **********", action, endpoint_id,
cluster_id, attribute_id, val->val.u32);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %ld **********", action,
endpoint_id, cluster_id, attribute_id, val->val.u32);
} else if (val->type == ESP_MATTER_VAL_TYPE_INT64 || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_INT64) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %lld **********", action, endpoint_id,
cluster_id, attribute_id, val->val.i64);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %lld **********", action,
endpoint_id, cluster_id, attribute_id, val->val.i64);
} else if (val->type == ESP_MATTER_VAL_TYPE_UINT64 || val->type == ESP_MATTER_VAL_TYPE_NULLABLE_UINT64) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %lld **********", action, endpoint_id,
cluster_id, attribute_id, val->val.u64);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %lld **********", action,
endpoint_id, cluster_id, attribute_id, val->val.u64);
} else if (val->type == ESP_MATTER_VAL_TYPE_CHAR_STRING) {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is %.*s **********", action, endpoint_id,
cluster_id, attribute_id, val->val.a.s, val->val.a.b);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is %.*s **********", action,
endpoint_id, cluster_id, attribute_id, val->val.a.s, val->val.a.b);
} else {
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04X's Cluster 0x%04X's Attribute 0x%04X is <invalid type: %d> **********", action,
endpoint_id, cluster_id, attribute_id, val->type);
ESP_LOGI(TAG, "********** %c : Endpoint 0x%04x's Cluster 0x%08lx's Attribute 0x%08lx is <invalid type: %d> **********",
action, endpoint_id, cluster_id, attribute_id, val->type);
}
}
+2 -2
View File
@@ -38,14 +38,14 @@ void DispatchSingleClusterCommandCommon(const ConcreteCommandPath &command_path,
uint16_t endpoint_id = command_path.mEndpointId;
uint32_t cluster_id = command_path.mClusterId;
uint32_t command_id = command_path.mCommandId;
ESP_LOGI(TAG, "Received command 0x%08X for endpoint 0x%04X's cluster 0x%08X", command_id, endpoint_id, cluster_id);
ESP_LOGI(TAG, "Received command 0x%08lx for endpoint 0x%04x's cluster 0x%08lx", command_id, endpoint_id, cluster_id);
node_t *node = node::get();
endpoint_t *endpoint = endpoint::get(node, endpoint_id);
cluster_t *cluster = cluster::get(endpoint, cluster_id);
command_t *command = get(cluster, command_id, COMMAND_FLAG_ACCEPTED);
if (!command) {
ESP_LOGE(TAG, "Command 0x%04X not found", command_id);
ESP_LOGE(TAG, "Command 0x%08lx not found", command_id);
return;
}
esp_err_t err = ESP_OK;
+9 -9
View File
@@ -1023,7 +1023,7 @@ attribute_t *create(cluster_t *cluster, uint32_t attribute_id, uint8_t flags, es
_cluster_t *current_cluster = (_cluster_t *)cluster;
attribute_t *existing_attribute = get(cluster, attribute_id);
if (existing_attribute) {
ESP_LOGW(TAG, "Attribute 0x%04x on cluster 0x%04x already exists. Not creating again.", attribute_id,
ESP_LOGW(TAG, "Attribute 0x%08lx on cluster 0x%08lx already exists. Not creating again.", attribute_id,
current_cluster->cluster_id);
return existing_attribute;
}
@@ -1306,14 +1306,14 @@ esp_err_t store_val_in_nvs(attribute_t *attribute)
char nvs_namespace[16] = {0};
char attribute_key[16] = {0};
snprintf(nvs_namespace, 16, "endpoint_%X", endpoint_id); /* endpoint_id */
snprintf(attribute_key, 16, "%X:%X", cluster_id, attribute_id); /* cluster_id:attribute_id */
snprintf(attribute_key, 16, "%lX:%lX", cluster_id, attribute_id); /* cluster_id:attribute_id */
nvs_handle_t handle;
esp_err_t err = nvs_open_from_partition(ESP_MATTER_NVS_PART_NAME, nvs_namespace, NVS_READWRITE, &handle);
if (err != ESP_OK) {
return err;
}
ESP_LOGD(TAG, "Store attribute in nvs: endpoint_id-0x%x, cluster_id-0x%x, attribute_id-0x%x",
ESP_LOGD(TAG, "Store attribute in nvs: endpoint_id-0x%x, cluster_id-0x%lx, attribute_id-0x%lx",
endpoint_id, cluster_id, attribute_id);
if (current_attribute->val.type == ESP_MATTER_VAL_TYPE_CHAR_STRING ||
current_attribute->val.type == ESP_MATTER_VAL_TYPE_OCTET_STRING ||
@@ -1348,14 +1348,14 @@ esp_err_t get_val_from_nvs(attribute_t *attribute, esp_matter_attr_val_t *val)
char nvs_namespace[16] = {0};
char attribute_key[16] = {0};
snprintf(nvs_namespace, 16, "endpoint_%X", endpoint_id); /* endpoint_id */
snprintf(attribute_key, 16, "%X:%X", cluster_id, attribute_id); /* cluster_id:attribute_id */
snprintf(attribute_key, 16, "%lX:%lX", cluster_id, attribute_id); /* cluster_id:attribute_id */
nvs_handle_t handle;
esp_err_t err = nvs_open_from_partition(ESP_MATTER_NVS_PART_NAME, nvs_namespace, NVS_READONLY, &handle);
if (err != ESP_OK) {
return err;
}
ESP_LOGD(TAG, "read attribute from nvs: endpoint_id-0x%x, cluster_id-0x%x, attribute_id-0x%x",
ESP_LOGD(TAG, "read attribute from nvs: endpoint_id-0x%x, cluster_id-0x%lx, attribute_id-0x%lx",
endpoint_id, cluster_id, attribute_id);
if (current_attribute->val.type == ESP_MATTER_VAL_TYPE_CHAR_STRING ||
current_attribute->val.type == ESP_MATTER_VAL_TYPE_OCTET_STRING ||
@@ -1395,7 +1395,7 @@ command_t *create(cluster_t *cluster, uint32_t command_id, uint8_t flags, callba
_cluster_t *current_cluster = (_cluster_t *)cluster;
command_t *existing_command = get(cluster, command_id, flags);
if (existing_command) {
ESP_LOGW(TAG, "Command 0x%04x on cluster 0x%04x already exists. Not creating again.", command_id,
ESP_LOGW(TAG, "Command 0x%08lx on cluster 0x%08lx already exists. Not creating again.", command_id,
current_cluster->cluster_id);
return existing_command;
}
@@ -1529,20 +1529,20 @@ cluster_t *create(endpoint_t *endpoint, uint32_t cluster_id, uint8_t flags)
/* If a server already exists, do not create it again */
_cluster_t *_existing_cluster = (_cluster_t *)existing_cluster;
if ((_existing_cluster->flags & CLUSTER_FLAG_SERVER) && (flags & CLUSTER_FLAG_SERVER)) {
ESP_LOGW(TAG, "Server Cluster 0x%04x on endpoint 0x%04x already exists. Not creating again.", cluster_id,
ESP_LOGW(TAG, "Server Cluster 0x%08lx on endpoint 0x%04x already exists. Not creating again.", cluster_id,
current_endpoint->endpoint_id);
return existing_cluster;
}
/* If a client already exists, do not create it again */
if ((_existing_cluster->flags & CLUSTER_FLAG_CLIENT) && (flags & CLUSTER_FLAG_CLIENT)) {
ESP_LOGW(TAG, "Client Cluster 0x%04x on endpoint 0x%04x already exists. Not creating again.", cluster_id,
ESP_LOGW(TAG, "Client Cluster 0x%08lx on endpoint 0x%04x already exists. Not creating again.", cluster_id,
current_endpoint->endpoint_id);
return existing_cluster;
}
/* The cluster already exists, but is of a different type. Just update the 'Set' part from below. */
ESP_LOGI(TAG, "Cluster 0x%04x on endpoint 0x%04x already exists. Updating values.", cluster_id,
ESP_LOGI(TAG, "Cluster 0x%08lx on endpoint 0x%04x already exists. Updating values.", cluster_id,
current_endpoint->endpoint_id);
_existing_cluster->flags |= flags;
return existing_cluster;
+4 -4
View File
@@ -23,7 +23,7 @@ Additionally, we also support developing on Windows Host using WSL.
The Prerequisites for ESP-IDF and Matter:
- Please see `Prerequisites <https://docs.espressif.com/projects/esp-idf/en/v4.4.3/esp32/get-started/index.html#step-1-install-prerequisites>`__ for ESP IDF.
- Please see `Prerequisites <https://docs.espressif.com/projects/esp-idf/en/v5.0.1/esp32/get-started/index.html#step-1-install-prerequisites>`__ for ESP IDF.
- Please get the `Prerequisites <https://github.com/espressif/connectedhomeip/tree/bb9200ace/docs/guides/BUILDING.md#prerequisites>`__ for Matter.
@@ -47,16 +47,16 @@ For using VSCode for development, please check `Developing in WSL <https://code.
2.1.2 Getting the Repositories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. only:: esp32 or esp32c3
.. only:: esp32 or esp32c3 or esp32c2
::
git clone --recursive https://github.com/espressif/esp-idf.git
cd esp-idf; git checkout v4.4.3; git submodule update --init --recursive;
cd esp-idf; git checkout v5.0.1; git submodule update --init --recursive;
./install.sh
cd ..
.. only:: esp32h2 or esp32c6 or esp32c2
.. only:: esp32h2 or esp32c6
::
+3 -3
View File
@@ -138,7 +138,7 @@ verified software boot loader then checks the partition table and
verifies the active application firmware and then boots it.
Details about implementing the secure boot can be found here:
`secure_boot <https://docs.espressif.com/projects/esp-idf/en/v4.4.3/security/secure-boot.html>`__.
`secure_boot <https://docs.espressif.com/projects/esp-idf/en/v5.0.1/security/secure-boot.html>`__.
4.4.2 Flash Encryption
~~~~~~~~~~~~~~~~~~~~~~
@@ -152,7 +152,7 @@ allow to write the data to the flash by encrypting it. Both the
read/write encryption operations happen transparently.
Details about implementing the flash encryption can be found here:
`flash_encryption <https://docs.espressif.com/projects/esp-idf/en/v4.4.3/security/flash-encryption.html>`__.
`flash_encryption <https://docs.espressif.com/projects/esp-idf/en/v5.0.1/security/flash-encryption.html>`__.
4.4.3 NVS Encryption
~~~~~~~~~~~~~~~~~~~~
@@ -169,4 +169,4 @@ encryption becomes a mandatory feature to secure the NVS encryption
keys.
Details about implementing the NVS encryption can be found here:
`nvs_encryption <https://docs.espressif.com/projects/esp-idf/en/v4.4.3/api-reference/storage/nvs_flash.html#nvs-encryption>`__.
`nvs_encryption <https://docs.espressif.com/projects/esp-idf/en/v5.0.1/api-reference/storage/nvs_flash.html#nvs-encryption>`__.
+5 -4
View File
@@ -13,6 +13,7 @@
#include <esp_err.h>
#include <esp_log.h>
#include <esp_mac.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
@@ -383,11 +384,11 @@ static void ble_mesh_config_client_cb(esp_ble_mesh_cfg_client_cb_event_t event,
uint32_t opcode = param->params->opcode;
uint16_t addr = param->params->ctx.addr;
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04x",
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04lx",
__func__, param->error_code, event, param->params->ctx.addr, opcode);
if (param->error_code) {
ESP_LOGE(TAG, "Send config client message failed, opcode 0x%04x", opcode);
ESP_LOGE(TAG, "Send config client message failed, opcode 0x%04lx", opcode);
return;
}
@@ -526,11 +527,11 @@ static void ble_mesh_generic_client_cb(esp_ble_mesh_generic_client_cb_event_t ev
uint32_t opcode = param->params->opcode;
uint16_t addr = param->params->ctx.addr;
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04x",
ESP_LOGI(TAG, "%s, error_code = 0x%02x, event = 0x%02x, addr: 0x%04x, opcode: 0x%04lx",
__func__, param->error_code, event, param->params->ctx.addr, opcode);
if (param->error_code) {
ESP_LOGE(TAG, "Send generic client message failed, opcode 0x%04x", opcode);
ESP_LOGE(TAG, "Send generic client message failed, opcode 0x%04lx", opcode);
return;
}
@@ -74,13 +74,15 @@ esp_err_t blemesh_bridge_attribute_update(uint16_t endpoint_id, uint32_t cluster
if (bridged_device && bridged_device->dev && bridged_device->dev->endpoint) {
if (cluster_id == OnOff::Id) {
if (attribute_id == OnOff::Attributes::OnOff::Id) {
ESP_LOGD(TAG, "Update Bridged Device, ep: %d, cluster: %d, att: %d", endpoint_id, cluster_id, attribute_id);
ESP_LOGD(TAG, "Update Bridged Device, ep: 0x%x, cluster: 0x%lx, att: 0x%lx", endpoint_id, cluster_id,
attribute_id);
app_ble_mesh_onoff_set(bridged_device->dev_addr.blemesh_addr, val->val.b);
}
}
}
else{
ESP_LOGE(TAG, "Unable to Update Bridge Device, ep: %d, cluster: %d, att: %d", endpoint_id, cluster_id, attribute_id);
ESP_LOGE(TAG, "Unable to Update Bridge Device, ep: 0x%x, cluster: 0x%lx, att: 0x%lx", endpoint_id, cluster_id,
attribute_id);
}
return ESP_OK;
}