Skip to content

Commit

Permalink
[bouffalolab] update macro define for header reserve size and etherne… (
Browse files Browse the repository at this point in the history
project-chip#37516)

* [bouffalolab] update macro define for header reserve size and ethernet zap configuration

* re-generate lighting-app-ethernet.matter
  • Loading branch information
wy-hh authored and pimpalemahesh committed Feb 12, 2025
1 parent 6531733 commit 09b2687
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 8 deletions.
1 change: 0 additions & 1 deletion examples/lighting-app/bouffalolab/bl602/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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}" ]
Expand Down
3 changes: 0 additions & 3 deletions examples/lighting-app/bouffalolab/bl702/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2127,6 +2127,18 @@ 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 attributeList;
callback attribute featureMap;
callback attribute clusterRevision;
}

server cluster AccessControl {
emits event AccessControlEntryChanged;
emits event AccessControlExtensionChanged;
Expand Down Expand Up @@ -2209,7 +2221,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;
Expand Down
174 changes: 172 additions & 2 deletions examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1199,7 +1369,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"defaultValue": "4",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -4151,4 +4321,4 @@
"parentEndpointIdentifier": null
}
]
}
}
6 changes: 5 additions & 1 deletion src/platform/bouffalolab/common/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 09b2687

Please sign in to comment.