From 80e874a93aa9ea12636c0cf49c0681dd34a2d10d Mon Sep 17 00:00:00 2001 From: wyhong Date: Tue, 11 Feb 2025 23:26:13 +0800 Subject: [PATCH 1/2] [bouffalolab] update macro define for header reserve size and ethernet zap configuration --- .../lighting-app/bouffalolab/bl602/BUILD.gn | 1 - .../lighting-app/bouffalolab/bl702/BUILD.gn | 3 - .../data_model/lighting-app-ethernet.matter | 15 +- .../data_model/lighting-app-ethernet.zap | 174 +++++++++++++++++- .../bouffalolab/common/SystemPlatformConfig.h | 6 +- 5 files changed, 191 insertions(+), 8 deletions(-) diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index c45251824fefbb..a487c81c00ad21 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -76,7 +76,6 @@ bl_iot_sdk("sdk") { "OTA_AUTO_REBOOT_DELAY=${ota_auto_reboot_delay_seconds}", "CHIP_UART_BAUDRATE=${baudrate}", "SYS_AOS_LOOP_ENABLE", - "CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE=48", ] defines += [ "PW_RPC_ENABLED=${chip_enable_pw_rpc}" ] diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn index 9cec7d240e0ff7..c86d3313ba6256 100644 --- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn @@ -96,9 +96,6 @@ bl_iot_sdk("sdk") { } defines += [ "CHIP_DEVICE_CONFIG_ENABLE_ETHERNET=${chip_enable_ethernet}" ] - if (chip_enable_ethernet) { - defines += [ "CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE=48" ] - } if (enable_psram) { defines += [ "CFG_USE_PSRAM=1" ] diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 277e8bc07c66ea..d033935bfeb8ab 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -2127,6 +2127,19 @@ endpoint 0 { binding cluster OtaSoftwareUpdateProvider; + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + callback attribute clusterRevision; + } + server cluster AccessControl { emits event AccessControlEntryChanged; emits event AccessControlExtensionChanged; @@ -2209,7 +2222,7 @@ endpoint 0 { ram attribute lastNetworkingStatus; ram attribute lastNetworkID; ram attribute lastConnectErrorValue; - ram attribute featureMap default = 1; + ram attribute featureMap default = 4; ram attribute clusterRevision default = 1; handle command ScanNetworks; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index 5e2fb2a77cde22..9c31d31bdc4f5a 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -63,6 +63,176 @@ "deviceTypeCode": 22, "deviceTypeProfileId": 259, "clusters": [ + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Access Control", "code": 31, @@ -1199,7 +1369,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "4", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -4151,4 +4321,4 @@ "parentEndpointIdentifier": null } ] -} \ No newline at end of file +} diff --git a/src/platform/bouffalolab/common/SystemPlatformConfig.h b/src/platform/bouffalolab/common/SystemPlatformConfig.h index 89a0a5a8f9a966..5802b386225b28 100644 --- a/src/platform/bouffalolab/common/SystemPlatformConfig.h +++ b/src/platform/bouffalolab/common/SystemPlatformConfig.h @@ -38,9 +38,13 @@ struct ChipDeviceEvent; // #define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(mbedtls_sha256_context) in hw_acc/sha256_alt.h #define CHIP_CONFIG_SHA256_CONTEXT_SIZE (32 + 64 + 64 + 19 * 32) #define CHIP_CONFIG_SHA256_CONTEXT_ALIGN 32 -#define CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE (388) #else // #define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(bl_sha_ctx_t) #define CHIP_CONFIG_SHA256_CONTEXT_SIZE ((7 + 1 + 5 + 18 + 16 + 16 + 7) * sizeof(unsigned int)) #endif + +#if CHIP_SYSTEM_CONFIG_USE_LWIP +#define CHIP_SYSTEM_CONFIG_HEADER_RESERVE_SIZE \ + (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN + CHIP_SYSTEM_HEADER_RESERVE_SIZE) +#endif From f4f17bfd20fa57798e4edcb693c9afcc97405511 Mon Sep 17 00:00:00 2001 From: wyhong Date: Wed, 12 Feb 2025 00:00:14 +0800 Subject: [PATCH 2/2] re-generate lighting-app-ethernet.matter --- .../bouffalolab/data_model/lighting-app-ethernet.matter | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index d033935bfeb8ab..ee41ac631a7982 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -2134,7 +2134,6 @@ endpoint 0 { callback attribute partsList; callback attribute generatedCommandList; callback attribute acceptedCommandList; - callback attribute eventList; callback attribute attributeList; callback attribute featureMap; callback attribute clusterRevision;